Hi Apsheet community members.
I would like you to help me with a problem I have when generating a webhook.
the json body is:
[
<<Start: [Related receptions]>>
{
"order_tracking": "<<[order_code]>>",
"date_reception": "<<[created_at]>>",
},
<<End>>
]
but when the webhook is activated the payload includes some unwanted values:
"Payload": "[\r\n {\r\n \"order_tracking\": \"CCC2234608\",\r\n \"date_reception\": \"3/8/2022 2:23:11 PM\",\r\n },\r\n {\r\n \"order_tracking\": \"CCC2243678\",\r\n \"date_reception\": \"3/8/2022 2:24:12 PM\",\r\n },\r\n {\r\n \"order_tracking\": \"CCC2234600\",\r\n \"date_reception\": \"3/8/2022 2:23:00 PM\",\r\n },\r\n {\r\n \"order_tracking\": \"CCC2234582\",\r\n \"date_reception\": \"3/8/2022 2:23:18 PM\",\r\n },\r\n {\r\n \"order_tracking\": \"CCC2243676\",\r\n \"date_reception\": \"3/8/2022 2:24:29 PM\",\r\n },\r\n]"
i need help, I have tried changing the structure of the json body, I have tried creating the json body again, I don't know what else to do, I have other json that have similar structures in other automation and they work correctly.
What are your other webhook setting?
/r and /n are just different kinds of line breaks. Are they even affecting the end result?
I managed to remove the \r \n, but I can't remove the \ and those are the ones that cause the 400 error.
the task properties:
{ "Exception": "Webhook HTTP post request failed with exception The remote server returned an error: (400) Bad Request. ", "Task Type": "Webhook", "Task Name": "enviar_webhook_receptions", "Url": "URL removed", "Verb": "Post", "MimeType": "application/json", "Headers": "Content-Type:application/json", "Payload": "[ {\"order_code\": \"CCC2243700\",\"date_recepcition\": \"2022-03-09\"}, {\"order_code\": \"CCC2234702\",\"date_recepcition\": \"2022-03-09\"}, {\"order_code\": \"CCC2234706\",\"date_recepcition\": \"2022-03-09\"}, {\"order_code\": \"CCC2234666\",\"date_recepcition\": \"2022-03-09\"}, {\"order_code\": \"CCC2243714\",\"date_recepcition\": \"2022-03-09\"}, {\"order_code\": \"CCC2234670\",\"date_recepcition\": \"2022-03-09\"}, {\"order_code\": \"CCC2234522\",\"date_recepcition\": \"2022-03-09\"}, {\"order_code\": \"CCC2234690\",\"date_recepcition\": \"2022-03-09\"}, {\"order_code\": \"CCC2234696\",\"date_recepcition\": \"2022-03-09\"}, {\"order_code\": \"CCC2243704\",\"date_recepcition\": \"2022-03-09\"}, {\"order_code\": \"CCC2234672\",\"date_recepcition\": \"2022-03-09\"}, {\"order_code\": \"CCC2234676\",\"date_recepcition\": \"2022-03-09\"}, {\"order_code\": \"CCC2234678\",\"date_recepcition\": \"2022-03-09\"}, {\"order_code\": \"CCC2243712\",\"date_recepcition\": \"2022-03-09\"}, {\"order_code\": \"CCC2234680\",\"date_recepcition\": \"2022-03-09\"}, {\"order_code\": \"CCC2243702\",\"date_recepcition\": \"2022-03-09\"}, {\"order_code\": \"CCC2234700\",\"date_recepcition\": \"2022-03-09\"}, {\"order_code\": \"CCC2234686\",\"date_recepcition\": \"2022-03-09\"}, {\"order_code\": \"CCC2234698\",\"date_recepcition\": \"2022-03-09\"}, {\"order_code\": \"CCC2234660\",\"date_recepcition\": \"2022-03-09\"}, {\"order_code\": \"CCC2243708\",\"date_recepcition\": \"2022-03-09\"}, {\"order_code\": \"CCC2234688\",\"date_recepcition\": \"2022-03-09\"}, {\"order_code\": \"CCC2234658\",\"date_recepcition\": \"2022-03-09\"}, {\"order_code\": \"CCC2243710\",\"date_recepcition\": \"2022-03-09\"}, {\"order_code\": \"CCC2234684\",\"date_recepcition\": \"2022-03-09\"}, {\"order_code\": \"CCC2234664\",\"date_recepcition\": \"2022-03-09\"}, {\"order_code\": \"CCC2234656\",\"date_recepcition\": \"2022-03-09\"}, {\"order_code\": \"CCC2234682\",\"date_recepcition\": \"2022-03-09\"}, {\"order_code\": \"CCC2234770\",\"date_recepcition\": \"2022-03-09\"}, {\"order_code\": \"CCC2243706\",\"date_recepcition\": \"2022-03-09\"}, {\"order_code\": \"CCC2243734\",\"date_recepcition\": \"2022-03-09\"}, {\"order_code\": \"CCC2234674\",\"date_recepcition\": \"2022-03-09\"}, {\"order_code\": \"CCC2234662\",\"date_recepcition\": \"2022-03-09\"}, {\"order_code\": \"CCC2244534\",\"date_recepcition\": \"2022-03-09\"}, {\"order_code\": \"CCC2244530\",\"date_recepcition\": \"2022-03-09\"}, {\"order_code\": \"CCC2234704\",\"date_recepcition\": \"2022-03-09\"}, {\"order_code\": \"CCC2234668\",\"date_recepcition\": \"2022-03-09\"},]" }
I can't get it to remove "\" which I think produce the error.
How did you remove the /r/n ?
Why do you think the remaining slashes are causing the error? Those are pretty typical.
I would try to remove the content type header.
I was able to remove "\r\n" by removing all spaces from the body template.
this is how the body template looks:
[<<Start: [Related receptions]>> {"order_code": "<<[order_code]>>","date_recepcition": "<<[fecha_webhook]>>"},<<End>>]
I think that the backslashes cause the error because I tried with postman and everything works correctly. and if in postman I try with the slash it throws the error.
User | Count |
---|---|
18 | |
9 | |
8 | |
5 | |
5 |