Question

Zapier API token validation

  • 28 March 2022
  • 1 reply
  • 129 views

Hello,

 

I am trying to create my first zapier app, I choose the authentication to be token based. When ever the end point returns any valid json on testing url the validation passes.

How can I fail the validation if token is not valid? Do I return specific http status or there is some sort of json error I need to return, I could find any documentation

 

 


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

1 reply

Userlevel 7
Badge +9

Your auth test endpoint should return a 401 or 403 HTTP status code if the token is bad or not included at all. Basically this represents a normal request to a protected resource so that Zapier can exercise their credentials and make sure that subsequent API requests are going to be allowed, so it should work like the rest of your API. 

If your API returns a 200 status for what is actually an error, you’ll have to handle each response and throw the appropriate error yourself. See https://zapier.github.io/zapier-platform/#zerrors. If you’re using the UI tool, switch to code mode to do this.