Communication with the API interface takes place exclusively over HTTPS, i.e. encrypted. All requests use the GET method.
Some methods can be passed input parameters – these are inserted directly into the request URL as GET parameters.
URL and response format
The API interface is available at:
https://api.wedos.as/partner/{method_name}
All methods return a response in the format JSON.
Each response includes requestId, which uniquely identifies the specific request.
All data in the response is encoded in UTF-8.
Based on requestId we are able to trace the specific communication in the internal logs if a problem occurs.
Authentication
Every API request must be authenticated. This is done using API key, which works similarly to a password but is intended exclusively for the API.
The API key is not the same as the password you use to log in to the partner administration.
You generate the API key after logging in to the partner administration, in the section
Account, settings – API settings.
HTTP headers
Authentication is done using two HTTP headers that must be added to every request:
- X-Auth-Id – API key ID
- X-Auth-Key – the API key itself
Example of an HTTPS request
Below is an example of a simple API request including the necessary HTTP headers.
It is the method ping, which you can use to verify that communication works correctly.
GET /partner/ping HTTP/1.1 Host: api.wedos.as Accept: application/json X-Auth-Id: KEYID X-Auth-Key: YOURKEY
Example response
On a successful call of the ping method, the API returns the partner ID and the current date and time:
{ "stamp": 1495544024, "time": "2017-05-23 14:53:44", "partnerId": 300000, "requestId": "1495544024.0084.8420" }
Error responses
In case of an error, the server returns an HTTP code other than 200 and the response body contains the error code and its description.
For example, for a request with incorrect authentication:
{ "error": { "code": "C507", "error": "Authentication failed" }, "requestId": "1495544185.1615.8422" }
If you run into a problem with the API or need to trace a specific request by requestId,
you can write to
affiliate@wedos.com.