Why do Zendesk REST API calls fail when using an API Integration in AI Agents Advanced?

Question

I use Postman to successfully call the Zendesk REST API, but I get authentication errors when I make the same API calls from AI Agents Advanced. Why does this happen?

Answer

If you authenticate calls to the Zendesk REST API in Postman with an API token and enter your email address in the Username field as MY_EMAIL@DOMAIN.COM/token, Postman creates the authorization headers and sends the correct parameters to authenticate your request.

The API endpoint expects the email/token combination in BASE64 format used by Postman to automatically encode the credentials for you. For more information, see this article:  How can I authenticate API requests?.

To obtain the necessary value for the Key field in the API Integration builder in AI Agents Advanced, you need to manually encode the string email_address/token:api_token in BASE64 format. You can use a third-party website to do this, as seen in the image below.

From the Integration builder in AI Agents Advanced, set the obtained value in the Key field, then use the following format in the Headers tab:

"Authorization": "Basic {{apiToken}}"

At this point, you can click Test Production and receive data from your Zendesk Support endpoint. Make sure to click Save first.

For more information, see this article: About the integration builder for advanced AI agents.