Responses and Errors
Status Codes
Every request will return an HTTP status code that indicates the success or failure of the operation. For more information about response codes, see the MDN HTTP response status code documentation.
Success Codes
In general: Codes in the 2xx range indicate success.
Error Response Codes
Codes in the 4xx range indicate an error that failed given the information provided (e.g., a required parameter was omitted, a resource could not be found, etc.). Codes in the 5xx range indicate an error with the Green Stack backend (these are rare).
Timeouts
If Green Stack takes more than 10 seconds to process an API request, Green Stack will terminate the request and you will receive an error. Counterbalance reserves the right to change the timeout window to protect the speed and reliability of the API.
Response Headers
Every response will include headers that give more details about the response and status. Headers that start with X-
or x-
are custom to Green Stack.
Standard HTTP Headers
These headers are standard HTTP headers that the client can use to evaluate the response.
Green Stack Headers
These headers are included in all responses.
Green Stack Edge Headers
These headers are returned when the API operation involves a request to an edge device.
Green Stack Error Headers
These headers are included in when an error is returned.
Response Body
Many operations will return a response body. Unless otherwise specified, the response body is in JSON format. Responses will include a Content-Type
header that indicates the type of data returned in the response.
Summary Representation
When you fetch a list of resources, the response includes a subset of the attributes for that resource. This is the "summary" representation of the resource. Some attributes are computationally expensive for the API to provide. For performance reasons, the summary representation excludes those attributes. To obtain those attributes, fetch the "detailed" representation.
Detailed representations
When you fetch an individual resource, the response typically includes all attributes for that resource. This is the "detailed" representation of the resource. Note that authorization sometimes influences the amount of detail included in the representation.
Errors
Error responses will vary depending on the situation. In general, a brief description of the error will be provided with suggested next steps.
Error Tracing
Most errors are automatically logged and reported. These errors will return a trace
ID in the error response body. Counterbalance Support may request this trace ID value to assist with troubleshooting or debugging the API.
This trace ID is also added as a header in the response.
Last updated