Zendesk API token authentication error. How to connect to API?
I am trying to connect to Zendesk API using a token, generated in Zendesk API settings, but I can't authenticate the request.
To connect, I am using:
Basic {email_address}/token:{api_token}
I am getting invalid token error:
{"error":"invalid_token","error_description":"The access token provided is expired, revoked, malformed or invalid for other reasons."}
How can I connect to Zendesk API ?
First, you have to check if you are using valid API token. Then you have to put together Email address and API token, according to the format: {email_address}/token:{api_token}
so it should look like: email@example.com/token:abcde12345fghij67890klmno12345
and encode it to Base64 format:
ZW1haWxAZXhhbXBsZS5jb20vdG9rZW46YWJjZGUxMjM0NWZnaGlqNjc4OTBrbG1ubzEyMzQ1
Zendesk authentication via headers
Header name: Authorization
Header value: Basic ZW1haWxAZXhhbXBsZS5jb20vdG9rZW46YWJjZGUxMjM0NWZnaGlqNjc4OTBrbG1ubzEyMzQ1
To encode a string to Base64 format, you can use an online application.
You need to use Base64 encoding also in case of email and password authentication.
1 answer