Domains¶
Getting domains list¶
- GET /api/v2/domains¶
Example request:
GET /api/v2/domains HTTP/1.1 X-Access-Token: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE0NDIwMDIxNzkzNTh9.pKXWfzXqbp8FMbOKocNaSlT1bYq4Xqzol-0kEXOY0_s X-Key: 8fd26a17-eb28-4c74-aa6f-a3794f4f466c
Example response:
HTTP/1.1 200 OK { "status":"OK", "data":{ "777":{ "id":"777", "domain":"d1.webitel.com", "user":"7", "acc/dvc":"7/0" }, "demo.webitel.com":{ "id":"demo.webitel.com", "domain":"demo.webitel.com", "user":"30", "acc/dvc":"30/0" }, "webitel.com":{ "id":"webitel.com", "domain":"webitel.com", "user":"25", "acc/dvc":"25/0" } } }
- Request Headers
X-Key and X-Access-Token – Auth Token
- Status Codes
200 OK – No error
400 Bad Request – Bad request
CURL example:
curl -XGET -H 'X-Access-Token: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE0NDIwMDY1MTUxNzB9.3L4D21aMdNxnm9lZTklt6EvjeNP9RLLKLJtFqVLnSCs' -H 'X-Key: eb76bb9f-6366-4168-b0f1-dac6f15adceb' "https://api.webitel.com:10022/api/v2/domains"
Create a domain¶
- POST /api/v2/domains¶
Example request:
POST /api/v2/domains HTTP/1.1 Content-Type: application/json X-Access-Token: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE0NDIwMDIxNzkzNTh9.pKXWfzXqbp8FMbOKocNaSlT1bYq4Xqzol-0kEXOY0_s X-Key: 8fd26a17-eb28-4c74-aa6f-a3794f4f466c { "domain_name": "mydomain.com", "customer_id": "20150909", "variables": ["default_language=ru"], "parameters": [] }
Example response:
HTTP/1.1 200 OK { "status":"OK", "info":"+OK [mydomain.com] created !\n", "more info":"" }
- Request JSON Object
domain_name (string) – The domain name
customer_id (string) – The customer license ID
variables (array) – Additional variables
parameters (array) – Additional parameters
- Request Headers
X-Key and X-Access-Token – Auth Token
Content-Type – application/json
- Status Codes
200 OK – No error
400 Bad Request – Bad request
CURL example:
curl -XPOST -H 'X-Access-Token: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE0NDIwMDY1MTUxNzB9.3L4D21aMdNxnm9lZTklt6EvjeNP9RLLKLJtFqVLnSCs' -H 'X-Key:eb76bb9f-6366-4168-b0f1-dac6f15adceb' -H 'Content-Type: application/json' -d '{"domain_name": "mydomain.com","customer_id": "20150909","variables": ["default_language=ru"],"parameters": []}' "https://api.webitel.com:10022/api/v2/domains"
Delete a domain¶
- DELETE /api/v2/domains/(domain_name)¶
Example request:
DELETE /api/v2/domains/mydomain.com HTTP/1.1 X-Access-Token: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE0NDIwMDIxNzkzNTh9.pKXWfzXqbp8FMbOKocNaSlT1bYq4Xqzol-0kEXOY0_s X-Key: 8fd26a17-eb28-4c74-aa6f-a3794f4f466c
Example response:
HTTP/1.1 200 OK { "status":"OK", "info":"+OK [mydomain.com] destroy !\n", "more info":"" }
- Parameters
domain_name (string) – The domain name
- Request Headers
X-Key and X-Access-Token – Auth Token
- Status Codes
200 OK – No error
400 Bad Request – Bad request
CURL example:
curl -XDELETE -H 'X-Access-Token: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE0NDIwMDY1MTUxNzB9.3L4D21aMdNxnm9lZTklt6EvjeNP9RLLKLJtFqVLnSCs' -H 'X-Key:eb76bb9f-6366-4168-b0f1-dac6f15adceb' "https://api.webitel.com:10022/api/v2/domains/mydomain.com"