Introduction

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:

GETUsed for retrieving information
POSTUsed for creating new objects
PUTUsed for altering object properties
DELETEUsed 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:

SuccessError
{
    "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*

Contact Us

 ______     ______    ______  
|      \\  /_   _//  /_   _// 
|  --  //   -| ||-     | ||   
|  --  \\   _| ||_    _| ||   
|______//  /_____//  /__//    
`------`   `-----`   `--`