How can i send data in REST POST connector?

Hello, my name is SAIDI Mejdeddine, im newest in Bonitasoft.

So my problem is, in the REST POST connector, i want to send data in the payload, but the payload keeps return empty.

  • I choose in the Content-Type "application/json"
  • Charset "UTF-8"
  • in the Payload zone i write:

                                    {
                                          "userName":"New.User",
                                           "password":"bpm",
                                           "password_confirm":"bpm",
                                           "icon":"",
                                            "firstname":"New",
                                            "lastname":"User",
                                            "title":"Mr",
                                           "job_title":"Human resources benefits",
                                          "manager_id":"3"
                                    }

And when i test the connector you can see the image (image 1.png --> https://drive.google.com/open?id=19Ry1gSHJHrQB-NzCZY8VSsJdxfSAKouX ). the output parameter in empty.

My real problem is how to send variable from the process to an endpoint API over HTTP?

Thank you very much

open?id=19Ry1gSHJHrQB-NzCZY8VSsJdxfSAKouX

Hello,

Could you try your REST CALL out of Bonita? When you send the same rest call, do you have an empty result?

When you say "My real problem is how to send variable from the process to an endpoint API over HTTP?", your question is to SEND or to RECEIVE data? 

To use data in the POST, click on "switch editor". Then, you can use a Groovy Script to calculate the information you SEND to the rest call.

You can use the JSon Groovy Library (use HashMap, ArrayList... and then use the JSON library

                String jsonSt = JSONValue.toJSONString( myMap );

to calculate the JSON String.
 

Hope this help