The HTTP API allows you to send and receive requests from your server to Wix.
Every call to the HTTP API shares a common entry point: openapi.wix.com/v1
To enable Wix to identify the site and application calling the HTTP API, all HTTP calls must be authenticated. Wix uses an HMAC scheme and requires HTTPS to ensure the integrity and authenticity of each request.
When issuing a HTTP request, your request must be signed with your secret key, and include the request parameters either as query parameters or as headers.
Header | Description |
---|---|
x-wix-application-id | App ID |
x-wix-instance-id | App Instance ID: the unique ID per user per site |
x-wix-timestamp | Timestamp in UTC format (ISO 8601); for example, 2013-07-01T08:07:40.802Z. Valid for one minute only |
x-wix-signature | HMACSHA-256 signature, generated using the app secret key and the request headers |
Every call is sent with a digital signature in the x-wix-signature header, for authentication purposes.
To encode the signature:
For endpoints that return large amounts of data, the HTTP API employs a technique called cursoring to navigate large sets of data. Cursoring separates result data into pages of a fixed size and provides a way to move forwards and backwards through these pages.
For initial calls to APIs that support cursors, it is possible to either omit the cursor parameter or to pass a cursor with the value of -1. Each call to a cursoring-enabled endpoint will return a JSON object that includes a cursor to the previous page, a cursor to the next page and an array containing the data for the current page. If either the next or previous page does not exist, the value of the cursor will be 0.
All cursors are associated with the initial data request and expire within 30 minutes.
Data cursor:
All API errors from the HTTP API use standard HTTP error codes, as well as a JSON response containing information relevant to the error.
Wix API Error Example
Standard API Errors
HTTP Error Code | Description | Area |
---|---|---|
400 | Bad request. Authentication credentials may be missing | Authentication |
400 | Missing endpoint version number | Versioning |
403 | Bad authentication credentials | Authentication |
404 | Invalid endpoint or version number specified | Versioning |
408 | Timestamp expired on the request, please submit again with a fresh signature | Authentication |