A method may not return anything. Then its HTTP return code ("200 OK") indicates that it went well.
When a method has to return some data, it will be done using a JSON document.
If a call ask for a binary file, the method will return a JSON document containing a link to the binary resource.
HTTP return code
Queries return an HTTP error code based on the result of their action:
Code | Description |
---|---|
200 OK | The query was executed correctly. |
400 Bad Request | The request is badly formed. |
401 Unauthorized | The authentication is incorrect, or the user is not allowed to use the API (he has not validated and activated his account, or his trial period is over and he has no valid license). |
403 Forbidden | The user does not have the right to access the requested resource or execute the requested request. |
404 Not Found | The requested resource does not exist. |
503 Service Unavailable | When an unsupported version of the API is requested. |
Error
In case of error, a JSON document is returned, containing the description of the encountered error (in addition to the HTTP return code other than 200 OK):
{ "errCode": 403, "errMsg": "You do not have access to this project.", "errLink": "https://help.skriv.com/api/..." }
The errCode and errMsg fields are mandatory, the errLink field is optional.