Introduction
The API enables integration with third party applications.
- The API is REST
- The API accepts only HTTPS requests
- All function calls need authorization and authentication (Basic HTTP)
To authenticate using HTTP Basic use your API username and password combination. Curl example:
curl -u username:password
HTTP methods
The API uses the following HTTP methods:
GET | Used for retrieving information |
POST | Used for creating new objects |
PUT | Used for altering object properties |
DELETE | Used for object deletion |
Curl example
curl -i -X POST -u username:password -H 'Accept: application/json' -H 'Content-type: application/json' --url https://cdnsun.com/api/cdns -d '{"cdn":{"service_type":"HTTP_PULL", "service_domain":"cdn.mycompany.com", "source_dmain":"mycompany.com" "location_ids":[1,2,3]}'
HTTP response codes
The API returns appropriate HTTP status code for every request.
HTTP response bodies
The API returns appropriate HTTP response body for every request:
Success | Error |
---|---|
{ "status": "success", "response_code": 200, "resource": "locations", "action": "get", "message": "success", "data": { "location": { "id": 47, "label": "Zurich", "latitude": "47.3667", "longitude": "8.55" } } } |
{ "status": "error", "response_code": 401, "resource": "index", "action": "index", "message": "unknown api username", "data": null } |
Formatting and naming conventions
The table below represents all the existing formatting and naming conventions used here:
Convention | Explanation | Example |
---|---|---|
ID | Stands for the resource ID. | 23 |
italic | All the parameters are italicised. | service_domain |
* (asterisk) | Marks the required parameters. | service_domain* |