REST API source troubleshooting

In this article

This page provides tools and information on how to troubleshoot issues with the REST API source.

API call is unsuccessful

Your REST API source makes API calls to retrieve the application content. If an API call is unsuccessful, the content is not indexed, and the source logs the error in the Log Browser (platform-ca | platform-eu | platform-au).

Symptoms:

  • Coveo fails to index some or all of the desired content. Items or metadata might be missing.

  • Logs show error codes such as 401 or 403, which indicate that the API call was unsuccessful.

  • Logs show messages such as The page of items was empty for the offset…​ or The page of items was empty for the next page reference…​.

  • The error message is not detailed enough to understand the cause of the issue.

To further investigate this issue, you can enable the logging of the response body and/or headers in the source logs when a call is unsuccessful.

Important

Depending on the API, the response body and/or headers may contain sensitive data that will appear in logs and therefore be exposed. Coveo automatically removes the Set-Cookie headers before logging, but custom headers may contain additional sensitive information.

We highly recommend you ensure that the response body and/or headers don’t contain any sensitive data before logging them.

To log the response body and/or headers when an API call is unsuccessful

  1. On the Sources (platform-ca | platform-eu | platform-au) page, select your REST API source, and then click Edit configuration with JSON in the More menu.

  2. In the source JSON configuration, add "LogResponseBodyWhenUnsuccessful": {"value": "true"} and/or "LogResponseHeadersWhenUnsuccessful": {"value": "true"} to the parameters object.

  3. Save your changes.

  4. Rebuild your source.

During the rebuild, Coveo will log the response body and/or headers of any unsuccessful call in the Log Browser (platform-ca | platform-eu | platform-au).