Welcome to the Product Accessories API. If you're looking to integrate your application with Product Accessories or create your own application in concert with data inside of Product Accessories, you're in the right place.
Making a request
All URLs start withhttps://accessories.w3apps.co/
. URLs are HTTPS only. The path is prefixed with /api/v1
to indicate the API version. The current version of the API is v1.
Example
To make a request for all the accessories on your shop, append the accessories index path to the base URL to form something like https://accessories.w3apps.co/api/v1/accessories
.
Authentication
All REST API queries require a valid Product Accessories API token.
Include your token as an x-api-key
header on all API queries.
Your API token can be found in the app under settings > integrations. Remember to keep the API key secure just as you would your username and passwords. It is also recommended to refresh your API keys periodically.
JSON only
We use JSON for all API data. The style is no root element and snake_case for object keys. This means that you have to send the Content-Type
header Content-Type: application/json; charset=utf-8
when you're POSTing or PUTing data into Product Accessories.
You'll receive a415 Unsupported Media Type
response code if you don't include the Content-Type
header.
Pagination
Collection APIs will contain a data
property that contains an array of the resources that are returned.
Most collection APIs paginate their results. The number of resources that'll appear in the data
property is variable based on the page_size
parameter that you pass. page_size
can be any any number between 1
and 100
. The default is 25
.
If there are more results in the collection, the response will contain a value in the next_page
property. This can be used in following requests with the page
property to get the next page of results. If the next_page
property in the response is NULL, it means that there are no more records. Even though the next_page
value is numeric, it is not the actual number of the page you are requesting. It is a token that is used internally to determine the next set of records in the collection to return. This value is only available after making a request.
The response will also contain a total_count
property which displays the total number of resources in the collection.
Example
A sample request with page_size
and page
will look something like this. https://accessories.w3apps.co/api/v1/accessories?page_size=25&page=1234
This request will return the next 25 accessories in the shop for page 1234
.
Handling errors
API clients must expect and gracefully handle transient errors, such as rate limiting or server errors. We recommend baking 5xx and 429 response handling into your low-level HTTP client so your integration can handle most errors automatically.
Rate limiting (429 Too Many Requests)
You can perform up to 50 requests per 10-second period using the same API key. If you exceed this limit, you'll get a 429 Too Many Requests response for subsequent requests.
500 server errors
If Product Accessories is having trouble, you will get a response with a 5xx status code indicating a server error. 500 (Internal Server Error), 502 (Bad Gateway), 503 (Service Unavailable), and 504 (Gateway Timeout) may be retried with exponential backoff.
404 Not Found
API requests may 404 due to deleted content, an inactive account, missing user permissions, etc. Detect these conditions and do not automatically retry these requests.