Hello All,
I’m trying to figure out why my custom app module is sending the body or the request as a json array. Here is what is specified in the Communication of the module:
{
“url”: “/v2/integration/assign”,
“method”: “POST”,
“headers”: {
“Authorization”: “Bearer {{connection.token}}”
},
“qs”: {},
“body”: {
“userId”: “{{parameters.userId}}”,
“projectId”: “{{parameters.projectId}}”,
“addToAllSteps”: “{{parameters.addToAllSteps}}”,
“addToCustomerFacing”: “{{parameters.addToCustomerFacing}}”,
“addToStepsWithTags”: “{{parameters.addToStepsWithTags}}”,
“selectedTagIds”: [“{{parameters.selectedTagIds}}”]
},
“response”: {
“output”: “{{body}}”
},
“log”: {
“sanitize”: [“request.headers.authorization”]
}
}
When testing this module, I noticed that the input bundle is wrapping the JSON object in an array like this:
[
{
“userId”: 711,
“projectId”: 80,
“addToAllSteps”: false,
“selectedTagIds”: [
3
],
“addToStepsWithTags”: true,
“addToCustomerFacing”: false
}
]
The endpoint is not expecting an array but a single object. Like this:
{
“userId”: 711,
“projectId”: 80,
“addToAllSteps”: false,
“selectedTagIds”: [
3
],
“addToStepsWithTags”: true,
“addToCustomerFacing”: false
}
Why is the content getting created like it is and what do I need to change so that the array is not created?
Thanks.