Методы авторизации к API
Через Bearer авторизацию
GET /v2/rest/account/{account_id}vpbx.json HTTP/1.1
Host: api.mcn.ru
Authorization: Bearer mytoken
Cache-Control: no-cache
Через Basic авторизацию
GET /v2/rest/account/{account_id}/vpbx.json HTTP/1.1
Host: api.mcn.ru
Authorization: Basic encoded_login_pass
Cache-Control: no-cache
где encoded_login_pass base64_encode («user:password»)
Пост-запрос и передача пост-переменных
Например:
POST /v2/rest/account/{account_id}/did/countries/get-cities/ HTTP/1.1
Host: api.mcn.ru
Authorization: Bearer mytoken
Cache-Control: no-cache
Content-Type: application/x-www-form-urlencoded
country_id=643
или через json:
POST /v2/rest/account/{account_id}/did/countries/get-cities/ HTTP/1.1
Host: api.mcn.ru
Authorization: Bearer mytoken
Cache-Control: no-cache
{ «country_id»: 643 }
Воспользуйтесь наиболее подходящим методом.
Также:
https://api.mcn.ru/v2/rest/account/{account_id}/vpbx.json — выдаст ответ в json
https://api.mcn.ru/v2/rest/account/{account_id}/vpbx.xml или (https://api.mcn.ru/v2/rest/account/{account_id}/vpbx) выдаст ответ в xml
Также см.:
«Загрузка звонков через API»