Error handling
Endpoint error response
In the case of non-2xx HTTP status responses, endpoints return details of errors using the following schema (the errors array is relevant to POST endpoints which receive JSON in the request body).
{
"status": <int>,
"errors": [
{
"property": <string>,
"messages": [
<string>
]
}, ...
],
"message": <string>
}
An example HTTP 400 response would look like this:
{
"status": 400,
"errors": [
{
"property": "amountRequested",
"messages": [
"key missing from body",
"must be greater than zero",
"value must be a number"
]
},
{
"property": "investorReferenceType",
"messages": [
"must be one of nino, lei, concat"
]
}
],
"message": "Bad Request"
}
HTTP response codes
An overview of response messages that the PrimaryBid Connect API can throw following a request.
Code | Name | Description |
---|---|---|
20x | OK | Indicates that the request has succeeded. |
201 | Created | Indicates that the request has succeeded and a new resource has been created as a result. |
204 | No content | Response to a successful event will not return a body (e.g. a DELETE op). |
400 | Bad request | The request was unacceptable, often due to a missing required parameter or field, or that parameter or field was of an incorrect type. |
401 | Unauthorised | No valid API key/secret was supplied (authentication failure). |
403 | Forbidden | The request is valid, but the server is refusing to respond to it (authorisation failure). |
404 | Not found | The server can't find the requested resource. |
405 | Method not allowed | Invalid HTTP method on the requested resource. |
409 | Conflict | The request could not be processed due to a conflict in the current state of the resource e.g. edit conflict between multiple simultaneous updates. |
422 | Unprocessable entity | The parameters had the correct type but one or more were not valid. |
429 | Too many requests | The request is rejected because you made too many API calls within a short period of time. Check out the Rate Limits. |
5xx | Server errors |