Build POST Request in Camunda Modeler and add Body to it

Hello,

At the moment I’m only working with the Camunda Modeler and wanna build a Task Which makes a POST request by using the HTTP-Connector.
I already build the general connector and tried a normal POST request which worked fine.
My next step would be to add a JSON body to the request so it fills fields in the destination form.
The JSON body would look like:
{
“variables”:

    "key": {"type": "string", "value": test2,
    "email": {"type": "string", "value": test
}

}
So my question is how to implement this in the Camunda Modeler.

Thanks in Advance :slight_smile:

Hi @Patrick_Unverricht,

you have to provide a input parameter named payload with the value of your need.

have a look at the reference for further details: https://docs.camunda.org/manual/7.11/reference/connect/http-connector/#using-the-generic-api

The payload can be entered as plain text or as a script returning your payload.

Hope this helps, Ingo

Hey @Ingo_Richtsmeier,

Thanks for your respone!

But how would I need to use it so the Variables get all filled right?
How do I send my Text as JSON?

Hi @Patrick_Unverricht,

you should use a script to create the payload: https://docs.camunda.org/manual/7.11/user-guide/process-engine/scripting/#use-scripts-as-inputoutput-parameters.

If this is too limited for full featured service invocation, consider to switch to external tasks and write a worker in the programming language of your choice. https://docs.camunda.org/manual/7.11/user-guide/process-engine/external-tasks/

Hope this helps, Ingo