Bearer Token access 401 fail in Postman
RespondidaI created a new API token on the Zendesk API | Settings tab. In postman I set up authorization type Bearer Token with the token created in Zendesk.
Using a GET method to https://{my sub domain}.zendesk.com/api/v2/tickets/:ticket_id
Result:

-
Hi Jerrold! It's difficult to say what the cause may be with the information that you shared, but it's possible that there is something different that Postman does when using the authorization option like this. Could you instead add the bearer token directly to the headers (example here) to see if that resolves the issue for you?
-
The token is an API token and so I needed to change to Basic Auth and use a username myemail@email.com/token with the API token as the password.
-
Ah yeah, that'll do it...thanks for the update and glad you're sorted now.
-
Jerrold Patterson I ran into the same issue. Do you mind showing an example code on how you were able to resolve it? Thanks in anticipation.
-
When you use a Basic Authorization you encode the email_address:password
Authorization: Basic {base-64-encoded email_address:password}
When using an API token, you replace the password with the token. It is like a magic password that works with any user account/email address, so be careful. The other issue is to ensure the user account has the correct role/access to accomplish what you want in the API call.
Authorization: Basic {base-64-encoded email_address:API Token}
-
Thanks for the explanation.
Iniciar sesión para dejar un comentario.
6 Comentarios