All non-empty response bodies, including errors, will be formatted as JSON objects. In general, a successful GET request (or any other request that retrieves data) will return an object with the data contained inside a single key-value pair. This key is always associated with the relevant endpoint. For example, GET /api/v1/company_clients will return an object with users as the key and the list of users as its value.
If You are fetching multiple entries, such as the previous GET /api/v1/users example, the data will be returned as a list. If you are fetching a single entry, such as GET api/v1/users/31175, the data will be returned as a single object.
Additionally, InvestGlass's API use standard HTTP status codes to indicate the status of a request.
Below is a brief overview of the most common status codes
Code | Definition |
---|---|
1xx | Informational. |
2xx | Success. |
201 | Created - Returned after a new object was created. Typically, the newly created object will be available in the response body. |
204 | No Content - Usually returned on a DELETE request. This indicates that the object was successfully removed, but there is no actual data to return. |
4xx | Client-side error. |
400 | Bad Request - There was an issue with the given parameters. This could be due to a missing required field, a malformed parameter, etc. |
401 | Unauthorized - The API credentials or access token used is incorrect. |
403 | Forbidden - You do not have access to the requested endpoint or action. |
404 | Not Found - Returned if the given resource either does not exist or you do not have access to it. |
409 | Conflict - This indicates that you are trying to perform an action that would interrupt or conflict with another ongoing action. |
5xx | Server Error |
500 | Internal Server Error - There are internal or API-related errors on InvestGlass's side. Additional requests will not resolve the issue. |
503 | Service Unavailable - The targeted endpoint is currently unavailable. This is caused by temporary issues; access to the endpoint will return momentarily. |