In this article, we will explore the most common error messages and codes you might encounter while using Gleans' REST APIs, explain their causes, and provide guidance on how to resolve them
400 Bad Request
Description:
This error occurs when the server cannot process the request. This can happen if the request syntax is malformed or the request body is missing a field.
Solution/Troubleshooting:
Review the documentation for the API endpoint and confirm the request syntax is correct.
401 Unauthorized
Description:
This error occurs when the request lacks valid authentication credentials such as a token being expired or incorrect.
Solution/Troubleshooting:
Ensure that you include a valid authentication token in your request headers. In the Admin Workspace > API Tokens page, an Admin can reference the token name to check if the token is expired. If you don’t remember the token name, try creating and testing a new token.
404 Missing Permissions
Description:
This error indicates that the user does not have the necessary permissions to access the requested resource. This can happen if your token is missing a required scope to use the endpoint.
Solution/Troubleshooting:
Check the scopes of the token you are using. An Admin can check the scopes by navigating to the Admin Workspace > API Tokens page. Glean’s documentation on Scopes can be used to review which endpoint each scope has permission to.
405 Method Not Allowed OR Name or service not known
Description:
The request URL domain may be incorrect.
Solution/Troubleshooting:
You can find the domain for your instance by following the below steps:
- Open Glean in a browser
- Navigate to your browser Developer Tools > Network tab
- Select Fetch/XHR
- Reload the page
- Select a log event name
- In the Headers > General section you will see the request URL field that shows your deployments domain.
In the example request URL “https://support-sandbox-be.glean.com/api/v1/productstatus” the domain is “support-sandbox”
408 Request Timeout
Description:
This error occurs when the server times out waiting for the request because the request took too long to complete.
Solution/Troubleshooting:
Ensure that your internet connection is stable and not experiencing any interruptions. Sometimes, the error is temporary. Retrying the request after a short delay might resolve the issue.
429 Too Many Requests
Description:
This error indicates that the user has sent too many requests in a given amount of time and is facing a rate limit.
Solution/Troubleshooting:
Try reducing the frequency of requests sent to the endpoint. Implementing a delay between requests can help stay within the rate limits.
If any of these errors persist after trying the solution/troubleshooting steps please reach out to Glean Support for help.