Recent searches


No recent searches

JSON Issues with Webhooks



Posted Aug 02, 2021

I have been trying to overcome this issue for a day and cannot seem to find an appropriate way to make this work. I have a Trigger that has only one Action which calls a Notify active webhook. This is what the very simplified json looks like:

I am copy/pasting the placeholders directly from the list of available placeholders as shown. This is showing that I have an error on the "id" line which appears to be because I am not passing a "string" as the value. If I put double quotes around the "{{Placeholder}}", this will work. The same issue happens with the "external_id" key/value pair because in my example the value would result in a null but because I am not placing double quotes around the "{{placeholder}}" which would result in the string "null" and not a null value.

I can go to the webhooks section of the Admin area and run a custom test as shown here:

All of the values here are manually placed, since this cannot pickup ticket placeholders, and this works just fine with an integer and a null value.

Am I missing some simple element to allow me to pass non-string values in my json data? I am hoping that I do not have to pass strings and go to the effort of evaluating and converting on the receiving side of this monster.

You valued assistance is much appreciated.
-greg


0

2

2 comments

I have performed some additional testing and found that the above error indicators in the JSON does not prevent the proper assembly of the JSON output.I pointed my endpoint to a diagnostic site so I could see what was being sent out and I was surprised to see differences in Content-Length even though the content was visibly identical. I can only speculate the difference is that the Test interface is sending <CR> at the end of each line and the standard trigger output is sending <CR><LF> because the difference in length is exactly one extra character for every line in the visible output.

My focus is turning now towards the Microsoft Power Automate platform for answers. When I send data from the Webhook Test interface, the content-length matches the test site I used above and I get a perfectly formatted json that gets parsed and all items are properly identified. If I use the standard Trigger json data, the content length reports zero (0) characters and needless to say, nothin gets parsed. I have compared the headers in the request and the only thing that really matters is the request needs to have content-type : application/json as a header and as far as I can tell, I am getting this from both the test and standard interfaces

One final test was that I took a manually crafted json body and placed it into the trigger event action and submitted it to the Power Automate endpoint and I got the same zero content length issue.

{
"ticket": {
"url": "MYTENNANT.zendesk.com/agent/tickets/44628",
"id": 44628
}
}

I am still not clear where the problem is but the only thing I see different is the <CR> vs <CR><LF> difference coming out of ZenDesk.

0


So to add one additional curiosity, I submitted the same static json data from Postman and it went through but I get an Accepted 202 where all of my ZenDesk submissions are getting Accepted 200. I do not think this is an issue but thout I would include it just in case.

Finally, I submitted the same static json data test using curl from both my local Linux machine and an Azure Linux VM and both worked as expected.

0


Please sign in to leave a comment.

Didn't find what you're looking for?

New post