Http Request
Before using the API, users need to make sure the HTTP request follows the format below.
HTTP Request Header
Ensure that the following HTTP request headers are included in your requests:
| Request Header | Description |
|---|---|
API-Key | The API Key string generated in API Key record. This header is mandatory. |
Key-ID | The Key ID string generated in API Key record. This header is mandatory. |
The values for these headers can be copied from the "API Keys" tab of the "Settings" page in the OneRewards web application.
HTTP Request Body
Please note that body objects required in any requests are JSON objects.
In addition, all requests containing a body object should have the "Content-Type" header present with value "application/json".
| Request Header | Description |
|---|---|
Content-Type | "application/json". This header is required when a request contains a body object. |
All requests with parameters in the body are required to pass an empty object in JSON string at the very least. Meaning in order to return an empty body object in the request, your request body would look like this:
{}
HTTP Response
The table below shows the HTTP Response Codes returned by Integration API.
The response code is returned to indicate if the request succeed or fail.
| Code | Summary | Description |
|---|---|---|
| 200 | OK | Successful API call for retrieving information for GET API. |
| 201 | Created | Successful API call for creating new record. |
| 204 | No Content | Successful API call for modifying existing record, such as update, delete, void, unvoid. |
| 400 | Bad Request | A validation exception has occurred. |
| 401 | Unauthorized | Invalid authorization credentials. |
| 403 | Forbidden | No permission to call this API method. Can set permission in permission settings of the api key. |
| 404 | Not Found | The resource you have specified cannot be found. |
| 429 | Rate Limit Exceeded | The API rate limit for your account book has been exceeded. |
| 500 | Internal Error | An unhandled error with the OneRewards API. Contact the customer support if problems persist. |
Error Response
When the API call failed, it will return an error response and a message to indicate what causes an error to occur.
Response Body
Error Response Model
| Field | Description | Type |
|---|---|---|
statusCode | Error status code. | number |
message | Error message information. | string |
Example of Error Response Body
{
"statusCode": 401,
"message": "401 Unauthorized."
}