You read the Interana API documentation, you tried to send a request, and...something went wrong! Here are a couple things to check.
What kind of error are you getting?
The response code and error message you see can tell you a lot about what the problem might be.
"400 Bad Request" errors could be caused by many different things, so you should definitely check the error message. Check out the tips below if you're stuck.
"401 Unauthorized: Not using authentication token" might mean there's a problem with the header. You might want to double-check how you're formatting the authorization portion.
"401 Unauthorized: Not logged in" errors might mean that you have mistyped your token, or that it is not valid.
"403 Forbidden: not authorized" errors might mean that you are trying to query against a dataset that doesn't exist or that you don't have permission to access.
"404: Not found" or "Could not resolve host" errors might be caused by sending the request to the wrong endpoint. You should use the endpoint https://<your interana instance URL>/api/v1/query.
"429 Server error: Request limit exceeded for token" errors occur when the API token used to authenticate the external API request has either exceeded its daily limit (default 1000 / day) or rate limit (default 1 / second).
A couple other things to check...
Request type: you should send an HTTP GET request with the query object as URL-encoded parameter.
- Spelling! For example, if your query uses a filter, make sure your key says "filter," not "filters." Also, your top-level object is called "query," but the nested array is called "queries." Check the Query API documentation to make sure everything matches up.
- Special characters: if your request uses any special characters, make sure you are escaping them properly. For example, any filter text you include needs to be surrounded by escaped double quotes.
- Column names: if you reference a column that has a familiar ("friendly") name that differs from its source name, you should use the familiar name in your request.
- Encoding: make sure you send the query object as a URL-encoded parameter!
- Timestamps: make sure your start and end times are formatted as epoch timestamps in milliseconds