jitterbit

Jitterbit - How to pass json request body to the Http connector (POST/Patch)


In Jitterbit cloud studio I want to pass below JSON as a Request Body to the HTTP Connector (PATCH/POST) but I do not see option for it I only see Request Headers, Request Parameters & Additional Settings which accepts only Key Value data.

As per my understanding I can set Request Body via Jitterbit Api variable ($jitterbit.api.request.body) but not sure how and where within HTTP connector I can do that?

JSON Request Body

{
    "custom_fields": [
        {
            "id": 6449064007,
            "value": "Passed"
        },
{
            "id": 545,
            "value": "www.test.com"
        }

    ]
}

HTTP PATCH ADDITIONALSETTINGS


Solution

  • You have two primary options:

    1. In your operation, just before the HTTP connector for the POST, you can add a transformation. That transformation would have the JSON schema and you can either hard-code those values (if that's truly the only body you would ever send in the POST call) or complete a mapping from a source schema. This is a basic transformation pattern, with the HTTP connector as the target activity.
    2. If you are calling the HTTP connector through a script, such as through the WriteFile function, the file contents can passed in the function call. Those contents would be the stringified version of the JSON.