Good day community,
I'm having trouble with adding the correct JSON path for my request body.
I have to send a POST request with the following JSON below:
{ "members": [ { "@odata.type": "--TYPE HERE--", "user@odata.bind": "--USER 1 HERE--" }, { "@odata.type": "--TYPE HERE--", "user@odata.bind": "--USER 2 HERE--" } ] }
This is how my parameter structure looks:
Generated JSON here:
{ "chatType": "oneOnOne", "members": [ { "@odata": { "type": "--TYPE HERE--" }, "user@odata": { "bind": "--USER 1 HERE--" } } ] }
The problem with this structure is that it generates a nested key for type under @odata, and for bind as well. I don't wan't this to happen if possible.
Is there any way to get this to work using parameters in web service? Or would my only resort be to generate the request body via script?
Like
Hello,
The body of the webservice seems to be generated properly since "members" is the array of objects "@odata" and "user@odata". The request was properly parsed and that's why you saw the result as on the screenshot. If this structure won't work in your business case then a separate script task should be created to sent the request.
Best regards,
Oscar
Hi Oscar,
Thank you for you response.
In forming the json path, I would have made it as $.[members]["@odata.dataType"] or $.[members]["user@odata.bind"], but I'm guessing that this is not possible using the built-in function (nesting parameters) in Creatio?
I think I'll instead be resorting to creating a script task for this.
Thank you!
Lyle