Creating a Request
Requests and responses follow standard HTTP response status codes for success and failures. Request bodies should have content typeapplication/json
and be valid JSON. For instructions on creating a valid X-CB-ACCESS-SIGNATURE
, see API Authentication.
Required IDs
Many API requests require either aportfolio_id
or an entity_id
value:
- Your
portfolio_id
can be retrieved by calling List Portfolios. - Your
entity_id
can be retrieved by calling List Portfolios, or List Portfolio Users with yourportfolio_id
.
Sample Requests
The following Python and JavaScript snippets demonstrate an end-to-end Prime API request.Python
JavaScript
Errors
Unless otherwise stated, bad requests respond with HTTP4xx
or 5xx
status codes. The body also contains a message
parameter indicating the cause.
Your implementation language’s HTTP library should be configured to provide message bodies for non-2xx
requests so that you can read the message field from the body.
Common error codes
Error Code | Meaning | Description |
---|---|---|
400 | Bad Request | Invalid request format |
401 | Unauthorized | Invalid API Key |
403 | Forbidden | You do not have access to the requested resource |
404 | Not Found | Requested resource could not be found |
500 | Internal Server Error | Server-side error occurred |
Success
A successful response is indicated by HTTP status code200
and may contain an optional body. If the response has a body, it will be documented under the related endpoint resource below.