GET Get accounts list

REQUEST HEADERS
X-Access-Token: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE0NDIwMDY1MTUxNzB9.3L4D21aMdNxnm9lZTklt6EvjeNP9RLLKLJtFqVLnSCs
X-Key: eb76bb9f-6366-4168-b0f1-dac6f15adceb
RESPONSE BODY
{
"status":"OK",
"data":{
	"100":{
		"id":"100",
		"domain":"10.10.10.144",
		"scheme":"account",
		"online":false,
		"state":"nonreg"},
	"101":{
		"id":"101",
		"domain":"10.10.10.144",
		"scheme":"account",
		"online":false,
		"state":"nonreg"}
	}
}
CURL EXAMPLE
curl -XGET -H 'X-Access-Token: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE0NDIxNzA0NDk2NTB9.WqTx_dpbuTyp-l8w6rmQhzoatI-qPRkoM-hmxXTAzaU' -H 'X-Key: bed5ea60-84e7-4eba-b6ad-e3a23f220be1'  "https://api.webitel.com:10022/api/v2/accounts"


GET /api/v2/accounts/:account_id - Get account info

REQUEST HEADERS
X-Access-Token: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE0NDIwMDY1MTUxNzB9.3L4D21aMdNxnm9lZTklt6EvjeNP9RLLKLJtFqVLnSCs
X-Key: eb76bb9f-6366-4168-b0f1-dac6f15adceb
RESPONSE BODY
{
"status":"OK",
"data":{
	"a1-hash":"dbe77b19c3d79717d910900a2595bed7",
	"dial-string":"{webitel_call_uuid=${create_uuid()},sip_invite_domain=10.10.10.144}${sofia_contact(*/[email protected])},${verto_contact([email protected])}",
	"jsonrpc-allowed-event-channels":"demo,conference,presence",
	"jsonrpc-allowed-methods":"verto,fsapi",
	"jsonrpc-password":"100",
	"jsonrpc-allowed-fsapi":"version",
	"cc-agent":"true",
	"cc-agent-type":"callback",
	"vm-enabled":"true",
	"vm-password":"1234",
	"cc-agent-contact":"{[email protected]}{webitel_call_uuid=${create_uuid()},sip_invite_domain=10.10.10.144}${sofia_contact(*/[email protected])},${verto_contact([email protected])}",
	"cc-agent-max-no-answer":"3",
	"webitel-extensions":"100",
	"http-allowed-api":"voicemail",
	"webitel-admin":"true",
	"variable_w_domain":"10.10.10.144",
	"variable_user_scheme":"account",
	"variable_user_context":"default",
	"variable_effective_caller_id_name":"Igor",
	"variable_outbound_caller_id_name":"100",
	"variable_account_role":"admin",
	"variable_default_language":"ru"
	}
}
CURL EXAMPLE
curl -XGET -H 'X-Access-Token: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE0NDIxNzA0NDk2NTB9.WqTx_dpbuTyp-l8w6rmQhzoatI-qPRkoM-hmxXTAzaU' -H 'X-Key: bed5ea60-84e7-4eba-b6ad-e3a23f220be1' "https://api.webitel.com:10022/api/v2/accounts/100"

 

POST Create a new account

REQUEST HEADERS
Content-Type: application/json
X-Access-Token: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE0NDIwMDY1MTUxNzB9.3L4D21aMdNxnm9lZTklt6EvjeNP9RLLKLJtFqVLnSCs
X-Key: eb76bb9f-6366-4168-b0f1-dac6f15adceb
REQUEST BODY
{
	"login": "109",
	"password": "109",
	"role": "user",
	"domain": "10.10.10.144",
	"parameters": ["vm-enabled=true", "webitel-extensions=109"],
	"variables": ["default_language=ru"]
}
RESPONSE BODY
{
"status":"OK",
"data":{
	"a1-hash":"5a3b8a1408181a5a9613b639cf2f65f6",
	"dial-string":"{webitel_call_uuid=${create_uuid()},sip_invite_domain=10.10.10.144}${sofia_contact(*/[email protected])},${verto_contact([email protected])}",
	"webitel-admin":"true",
	"jsonrpc-allowed-event-channels":"demo,conference,presence",
	"jsonrpc-allowed-methods":"verto",
	"jsonrpc-password":"109",
	"cc-agent":"true",
	"webitel-extensions":"109",
	"vm-enabled":"false",
	"variable_w_domain":"10.10.10.144",
	"variable_user_scheme":"account",
	"variable_user_context":"default",
	"variable_effective_caller_id_name":"109",
	"variable_outbound_caller_id_name":"109",
	"variable_account_role":"admin",
	"variable_default_language":"ru"
	}
}
CURL EXAMPLE
curl -XPOST -H 'X-Access-Token: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE0NDIxNzA0NDk2NTB9.WqTx_dpbuTyp-l8w6rmQhzoatI-qPRkoM-hmxXTAzaU' -H 'X-Key: bed5ea60-84e7-4eba-b6ad-e3a23f220be1'  -H 'Content-Type: application/json' -d '{"login": "109","password": "109","role": "user","domain": "10.10.10.144", "parameters": ["vm-enabled=true", "webitel-extensions=109"], "variables": ["default_language=ru"]}' "https://api.webitel.com:10022/api/v2/accounts"

 

PUT /api/v2/accounts/:account_id - update an account

REQUEST HEADERS
Content-Type: application/json
X-Access-Token: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE0NDIwMDY1MTUxNzB9.3L4D21aMdNxnm9lZTklt6EvjeNP9RLLKLJtFqVLnSCs
X-Key: eb76bb9f-6366-4168-b0f1-dac6f15adceb

 

REQUEST BODY
{
	"password": "103",
	"variables": ["default_language=ru"]
} 
RESPONSE BODY
{
"status":"OK",
"info":{
	"a1-hash":"5a3b8a1408181a5a9613b639cf2f65f6",
	"dial-string":"{webitel_call_uuid=${create_uuid()},sip_invite_domain=10.10.10.144}${sofia_contact(*/[email protected])},${verto_contact([email protected])}",
	"webitel-admin":"true",
	"jsonrpc-allowed-event-channels":"demo,conference,presence",
	"jsonrpc-allowed-methods":"verto",
	"jsonrpc-password":"103",
	"cc-agent":"true",
	"webitel-extensions":"103",
	"vm-enabled":"false",
	"variable_w_domain":"10.10.10.144",
	"variable_user_scheme":"account",
	"variable_user_context":"default",
	"variable_effective_caller_id_name":"103",
	"variable_outbound_caller_id_name":"103",
	"variable_account_role":"admin",
	"variable_default_language":"ru"
	}
} 
CURL EXAMPLE
curl -XPUT -H 'X-Access-Token: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE0NDIxNzA0NDk2NTB9.WqTx_dpbuTyp-l8w6rmQhzoatI-qPRkoM-hmxXTAzaU' -H 'X-Key: bed5ea60-84e7-4eba-b6ad-e3a23f220be1' -H 'Content-Type: application/json' -d '{"password": "103","variables": ["default_language=ru"]}' "https://api.webitel.com:10022/api/v2/accounts/103"

 

DELETE /api/v2/accounts/:account_idDelete an account

REQUEST HEADERS
X-Access-Token: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE0NDIwMDY1MTUxNzB9.3L4D21aMdNxnm9lZTklt6EvjeNP9RLLKLJtFqVLnSCs
X-Key: eb76bb9f-6366-4168-b0f1-dac6f15adceb
RESPONSE BODY
{
	"status":"OK",
	"info":"+OK destroyed!\n"
}
CURL EXAMPLE
curl -XDELETE -H 'X-Access-Token: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE0NDIxNzA0NDk2NTB9.WqTx_dpbuTyp-l8w6rmQhzoatI-qPRkoM-hmxXTAzaU' -H 'X-Key: bed5ea60-84e7-4eba-b6ad-e3a23f220be1' "https://api.webitel.com:10022/api/v2/accounts/109"
  • No labels