Connecting to API ================= This API is based on [REST]( principles. API authentication ---------------------------------- We use HTTP Basic authentication where username is the api key and password is the calculated request signature that changes with every request. The secret should never be sent, instead it's used to generate the request signature. Api key and secret can be generated in our Admin. The signature is a hex-encoded HMAC-SHA1 hash calculated from the canonical request using provided secret. Canonical request takes form of `{http method} {complete request path} {unix timestamp}`, e.g. `GET /v1/some/url?attributes=123&some=aaa 1548240417` **PHP example** ```php :`) Additionally all request must contain a valid `Date` header with the time used for the signature in the ISO8601 basic format, in the GMT timezone. Connection is encrypted with SSL, so all your requests are safe. Request and response formats ---------------------------- This API is using **JSON** format in both directions. Please add these two headers to your request: - `Content-Type: application/json` - `Accept: application/json` The communication through API is using [UTF-8 encoding]( Allowed HTTPs requests --------------------- * __GET:__ to get a resource or list of resources * __PUT:__ to update resource * __POST:__ to create resource * __DELETE:__ to delete resource Most frequent server response descriptions --------------------- * 200 __OK__ - the request was successful (however some API calls may return 201 instead) * 201 __Created__ - the request was successful and the resource was created * 204 __No Content__ - the request was successful, but there is no representation to return (i.e. the response is empty) * 400 __Bad Request__ - the request could not be understood or was missing parameters required * 401 __Unauthorized__ - authentication failed or user doesn't have permissions for requested operation * 403 __Forbidden__ - access denied * 404 __Not Found__ - resource was not found * 500 __Internal Server Error__ - something bad happened * 501 __Not Implemented__ - you are calling a not implemented method #### Messages above 400 are in the following format: >response `400` ```json { "code": 400, "message": "This is an example error message!" } ``` Language -------- API supports different languages in validation messages. You can change language with header `Accept-Language: en_us`. Supported languages are: `en_us`, `sk`, `cs_cz`, `hu`.