General information
End point / URL
The end point for calling the API begins with the base URL for your specific deployment of Direct Response™
Example: https://abccompany.mydirectresponse.com
Content-Type
Each request must specify the HTTP header Content-Type of either application/json or application/xml. This is used to control the format of any posted data as well as the format of the response.
Response codes
200 - Successful
201 - Successful create
400 - Fatal or general error
403 - Unauthorized - If you receive this error check the allowed methods on the API key you are using
404 - Method not found
422 - Validation error
500 - Internal error
Validation error response
A validation error occurs when a request contains invalid data types or missing elements from the request.
JSON
{ "response": { "error": { "number": -6600, "description": "Inventory number is required." } } }
XML
<?xml version="1.0" encoding="UTF-8"?> <response> <error number="-6600">Inventory number is required.</error> </response>
General error response
A general error response is given when a process or business rule is violated or some piece of data can not be located based upon the request.
JSON
{ "response": { "error": { "number": -100, "description": "Unable to locate Inventory by Number." } } }
XML
<?xml version="1.0" encoding="UTF-8"?> <response> <error number="-100">Unable to locate Inventory by Number.</error> </response>
Fatal error response
A fatal response is given when a fatal error is encountered. Typically this is when the request can not be parsed or there is an internal error with the request. The HTTP status will be 400.
JSON
{ "fatalError": "Error parsing JSON" }
XML
<?xml version="1.0" encoding="UTF-8"?> <fatalError>Content is not allowed in prolog.</fatalError>
Unauthorized response
An unauthorized response, HTTP status 403, is given when the API key provided is invalid or otherwise unauthorized. The response is empty. If you receive this error check the allowed methods on the API key you are using.
Method not found
A method not found response, HTTP status 404, is given when the API can not match a API method based on URL and HTTP method (POST, PUT, GET, DELETE). The response is empty.
302 - Moved temporarily
This is indicative of attempting to communicate over an unsecured channel using HTTP protocol instead of HTTPS protocol. All calls to the Direct ResponseTM API must use HTTPS.
Data types
The following table explains the various types of data and provides examples for each.
| Type | Description | Example |
|---|---|---|
| String() | A string is any alpha numeric value with the exception of comma, single quote or double quote. The maximum length of this data type is indicated in the parenthesis | ABC123 |
| Integer | Any positive whole number | 1337 |
| Decimal | Any positive number with no more than 4 decimal places | 1923.4501 |
| Date | A date in the MM/DD/YYYY format | 02/14/2016 |
| Time | A twenty four hour format of HH:MM | 13:42 |
| Boolean | true, false, 1, or 0 | true |
Comments
0 comments
Please sign in to leave a comment.