Skip to main content

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 HeaderDescription
API-KeyThe API Key string generated in API Key record. This header is mandatory.
Key-IDThe 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 HeaderDescription
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.

CodeSummaryDescription
200OKSuccessful API call for retrieving information for GET API.
201CreatedSuccessful API call for creating new record.
204No ContentSuccessful API call for modifying existing record, such as update, delete, void, unvoid.
400Bad RequestA validation exception has occurred.
401UnauthorizedInvalid authorization credentials.
403ForbiddenNo permission to call this API method. Can set permission in permission settings of the api key.
404Not FoundThe resource you have specified cannot be found.
429Rate Limit ExceededThe API rate limit for your account book has been exceeded.
500Internal ErrorAn 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
FieldDescriptionType
statusCodeError status code.number
messageError message information.string
Example of Error Response Body
{
"statusCode": 401,
"message": "401 Unauthorized."
}