Best answer

Webhook via Postman is working, but not via Zapier Webhook action


Userlevel 1

Hey guys,

has anybody had the case where a webhook works just fine via Postman but not via Zapier? I’m trying to add a comment in Zendesk, and it simply won’t work. I don’t even get an error message, the comment just never arrives in Zendesk. Postman works just fine, with the exact same code, same credentials, everything identical. Am I missing anything?

Best

Johannes

icon

Best answer by GetUWired 19 July 2021, 15:07

View original

This post has been closed for comments. Please create a new post if you need help or have a question about this topic.

12 replies

Userlevel 7
Badge +12

So this issue can be closed, the request was missing ‘Content-Type’ header. Adding that in resolved the issue. 

Userlevel 7
Badge +12

I will send you a private message

Userlevel 1

Hey Tim @GetUWired,

I tried so many things by now, I believe a Zoom Call would be great. I talked to your support already, but they didn’t offer this. How can I request a call with you?

 

Best

Johannes 

Userlevel 7
Badge +12

Hi @Johannes 

My apologies. That was not intended to be a code for you to attempt to run in Zapier. That was a screenshot taken from the API docs you linked in your above message. (https://developer.zendesk.com/api-reference/ticketing/tickets/ticket_comments/). It is not valid Python code. I was adding it because in your above message you stated the request you are making in Zapier is: 

https://subdomain.zendesk.com/api/v2/tickets/2072.json


{
"ticket": {
"comment": {
"body": "Why via Postman, but not Zapier",
"author_id": "376848464420"
}
}
}


But the docs show that author_id is of type integer which shouldn’t be wrapped in double quotes. 

The custom request function is brutally unforgiving in its formatting. It may be better to make a PUT request action and use double underscores to indicated nesting as opposed to using a custom request action. https://zapier.com/help/doc/how-get-started-webhooks-zapier 

It is not something we can troubleshoot on our end as I wouldn’t have valid credentials to your Zendesk. If you’d like direct support please send us a message and I would be happy to hop on a zoom call with you. 

Thanks,

Tim @Getuwired

Userlevel 1

Hi @GetUWired 

Thanks for your input. I ran the code you provided above as a Python Action in the Code app in Zapier, but I’m getting the following error message:

Traceback (most recent call last):

SyntaxError: invalid syntax (<string>, line 8)

 

This is my code:

 

Are you able to test this on your end? I’m starting to wonder if it’s my Zendesk account.

Userlevel 7
Badge +12

@Johannes 

Have you also tried specifying your content type header? Content-Type: application/json

 

Beyond that it also looks like author_id should be an integer not a string as there are not double quotes around the value. 
 


Also, possibly try setting unflatten to false but that really shouldn’t do anything since you are sending raw data and not form data. 

Let me know if none of that works and I’ll throw out some other suggestions

Userlevel 1

Hi @Johannes 

I would set data pass through to False and try again as you do not want your inputted data to be overwritten from whatever was returned in step 6. 

Thanks @GetUWired , but that didn’t do the trick. My code looks alright, as it has been confirmed by Zendesk. I’m just surprised that I seem to be the only one with that problem. Can it be a user account problem? 

 

Userlevel 7
Badge +12

Hi @Johannes 

I would set data pass through to False and try again as you do not want your inputted data to be overwritten from whatever was returned in step 6. 

Userlevel 1

Hi @Troy Tessalone ,

here’s the screenshot. Using a PUT request on a webhook app Action.

 

Thanks

J

 

 

Userlevel 7
Badge +14

@Johannes

Can you show the full screenshot of how your have this code configured in your Zap step.

Are you using a Code app step or a Webhooks app step?

Are you using a GET or POST request method?

 

RESOURCES

https://zapier.com/apps/webhook/help

https://zapier.com/help/doc/code-examples

Userlevel 1

Hi @Troy Tessalone ,

thanks for your reply. 

 

Here’s the webhook. As you can see a very standard one.

https://subdomain.zendesk.com/api/v2/tickets/2072.json


{
"ticket": {
"comment": {
"body": "Why via Postman, but not Zapier",
"author_id": "376848464420"
}
}
}

I got the code from here.

 

As I described, Postman doesn’t make any trouble at all.

Userlevel 7
Badge +14

Hi @Johannes 

Can you post how your Webhook is configured in the Zap?

Can you link to the Zendesk API documentation you are using for this?