Partner API
Overview
The Partner REST API gives you the most control over your integration, and, like a good API it is, has predictable, resource-oriented URLs.
View the PartnerStack API reference for the most up to date list of supported resources
Authentication
Authenticate your requests using Bearer Auth.
Simply use your api_key
from your user settings and set it as the bearer token in the authorization header of your request.
GET https://api.partnerstack.com/api/v2/rewards
Authorization: Bearer {api_key}
Responses
All endpoints return a JSON body, even if returning an error.
Our API libraries convert responses to appropriate language-specific objects.
The structure for a successful response will be in the form of:
{
"data": {...},
"message": "...",
"status": "2xx"
}
where all relevant information is stored within the data
property.
For error responses, it will be:
{
"message": "...",
"status": "3xx|4xx|5xx"
}
where message
will contain a description of the error.
Pagination
Endpoints (primarily GET
a list of items) that accepts starting_after
or ending_before
, and limit
will return paginated results.
Query Parameter | Description |
---|---|
starting_after | A cursor for use in pagination. starting_after is an item key that defines your place in the list.For instance, if you make a list request and receive 100 items, then the last item with "key":"rew_1234" , can be used in your subsequent call as the parameter value to fetch the next page of results: ?starting_after=rew_1234 .This is mutually exclusive with ending_before . |
ending_before | The inverse of starting_after and will return items that are in the previous page. Instead of using the last item's key in the result set, you would use the first item's key .This is mutually exclusive with starting_after . |
limit | The number of items to retrieve per result set (page). The boundary is [1, 250] with a default value of 10. |
An example response for paginated results:
{
"data": {
"has_more": true,
"items": [...]
},
"message": "Page returned successfully",
"status": 200
}
The property has_more
is used to determine if there are more items to be retrieved.
Time & Date
Date and time specific properties, such as created_at
are in epoch timestamp milliseconds. In addition, this also applies to query parameters. As such, the date to provide as parameters must be converted to an integer of epoch ms.
Updated 11 months ago