API basics¶
API description¶
Title¶
The main category of API. Normally, it represents general API URI.
Purpose¶
The purpose of API.
Methods¶
List of supported command with simple description.
Method: <command>¶
Method description with command in detail. It shown also added version.
Call¶
Description of how to call this API. It will explain about method parameters and data parameters.
<method> <call URI>
<required data>
Method parameters
* method
: API calling method. i.e. GET, PUT, POST, …
* call URI
: URI. Uniform Resource Identifier
Data parameters
* required data
: Required data to call the API.
Returns¶
Description of reply. Described in detail. These are common return objects. This objects will not be explain again.
{
$defhdr,
"result": {
"message": "<message-name>",
"type": "<message-type>",
"timestamp": "<YYYY-mm-ddTHH:MM:SS.fffZ>"
}
}
message
: Represents message name. Fixed.type
: Represents message type. Fixed.timestamp
Denotes when the message has been created. See the Timestamp.
Example¶
Simple example of how to use the API. It would be little bit different with real response.
Normally, to test the API curl is used. curl is a tool to transfer data from or to a server, using one of the supported protocols. See detail at link below.
https://curl.haxx.se/docs/manpage.html
Some of APIs requires a returned uuid for the request. But one must expect that these information are only valid within the user sessions and are temporary.
API¶
/agents¶
Methods¶
GET : Get list of all agents info.
Method: GET¶
Get list of all agents info.
Call¶
GET /agents
Returns¶
{
$defhdr,
"reuslt": {
"list": [
{
"id": "<string>"
},
...
]
}
}
list
: array of agents id.id
: agent id.
Example¶
$ curl -X GET 192.168.200.10:8081/agents
{
"api_ver": "0.1",
"result": {
"list": [
{
"id": "1001"
},
{
"id": "1002"
}
]
},
"statuscode": 200,
"timestamp": "2017-03-13T17:19:07.48261155Z"
}
/agents/¶
Methods¶
GET : Get agent’s detail info of given agent id.
Method: GET¶
Get agent’s detail info of given agent id.
Returns¶
{
$defhdr,
"reuslt": {
"id": "<string>",
"name": "<string>",
"status": "<string>",
"logged_in_time": <integer>,
"channel_name": "<string>",
"channel_state": <integer>,
"channel_state_desc": "<string>",
"caller_id_name": "<string>",
"caller_id_num": "<string>",
"connected_line_name": "<string>",
"connected_line_num": "<string>",
"context": "<string>",
"exten": "<string>",
"priority": "<string>",
"account_code": "<string>",
"language": "<string>",
"unique_id": "<string>",
"linked_id": "<string>",
"tm_update": "<string>",
}
}
Return parameters
id
: Agent id.name
: Agent name.status
: Agent status. See detail Agent status.logged_in_time
: Logged in time.channel_name
: Agent channel’s name.channel_state
: Agent channel’s state.channel_state_desc
: Agent channel’s state description.caller_id_name
: Caller’s id name.caller_id_num
: Caller’s id number.connected_line_name
: Connected line name.connected_line_num
: Connected line number.context
: Context.exten
: Extension.priority
: Prioritycaller_id_name
: Caller’s id name.caller_id_num
: Caller’s id number.connected_line_name
: Caller’s line name.connected_line_num
: Caller’s line number.account_code
: Account code.language
: Language.unique_id
: Channel’s unique id.linked_id
: Channel’s linked id.
Example¶
$ curl -X GET 192.168.200.10:8081/agents/ -d '{"id": "1001"}'
{
"api_ver": "0.1",
"result": {
"account_code": "",
"caller_id_name": "300",
"caller_id_num": "300",
"channel_name": "SIP/300-00000425",
"channel_state": 6,
"channel_state_desc": "Up",
"connected_line_name": "<unknown>",
"connected_line_num": "<unknown>",
"context": "sample_agent_login",
"exten": "s",
"id": "1001",
"language": "en",
"linked_id": "1489423716.2037",
"logged_in_time": 1489423716,
"name": "Agent 1001",
"priority": "2",
"status": "AGENT_IDLE",
"tm_update": "2017-03-13T17:19:06.724533682Z",
"unique_id": "1489423716.2037"
},
"statuscode": 200,
"timestamp": "2017-03-13T17:20:01.778206702Z"
}
/device_states¶
Methods¶
GET : Get list of all device_state device info.
Method: GET¶
Get list of all device_state device info.
Call¶
GET /device_states
Returns¶
{
$defhdr,
"reuslt": {
"list": [
{
"device": "<string>"
},
...
]
}
}
Return parameters
list
: array of channels.device
: device name.
Example¶
$ curl -X GET example.com:8081/device_states
{
"api_ver": "0.1",
"result": {
"list": [
{"device": "Agent:1001"},
...
]
},
"statuscode": 200,
"timestamp": "2017-04-04T23:09:36.539677164Z"
}
/device_states/¶
Methods¶
GET : Get device_state’s detail info of given info.
Method: GET¶
Get device_state’s detail info of given info.
Returns¶
{
$defhdr,
"reuslt": {
"device": "<string>",
"state": "<string>",
"tm_update": "2017-04-04T23:08:40.878892472Z"
}
}
Return parameters
device
: Device name.state
: Device state. See detail Device state.
Example¶
$ curl -X GET example.com/device_states/ -d \
'{"device": "Agent:1001"}'
{
"api_ver": "0.1",
"result": {
"device": "Agent:1001",
"state": "UNAVAILABLE",
"tm_update": "2017-04-04T23:08:40.878892472Z"
},
"statuscode": 200,
"timestamp": "2017-04-04T23:10:37.684581876Z"
}
/peers¶
Methods¶
GET : Get list of all peer info.
Method: GET¶
Get list of all peer info.
Call¶
GET /peers
Returns¶
{
$defhdr,
"reuslt": {
"list": [
{"peer": "<string>"},
...
]
}
}
list
: array of peer entry info.peer
: Peer entry info.
Example¶
$ curl -X GET saturn.pchero21.com:8081/peers
{
"api_ver": "0.1",
"result": {
"list": [
{
"peer": "SIP/300"
},
...
]
},
"statuscode": 200,
"timestamp": "2017-04-09T01:42:24.765567356Z"
}
/peers/¶
Methods¶
GET : Get peer detail info of given peer info.
Method: GET¶
Get peer detail info of given peer info.
Returns¶
{
$defhdr,
"reuslt": {
"peer": "<string>",
"status": "<string>",
"address": "<string>",
"monitor_status": "<string>",
"channel_type": "<string>",
"chan_object_type": "<string>",
"dynamic": "<string>",
"auto_comedia": "<string>",
"auto_force_port": "<string>",
"acl": "<string>",
"comedia": "<string>",
"description": "<string>",
"force_port": "<string>",
"realtime_device": "<string>",
"text_support": "<string>",
"video_support": "<string>",
"tm_update": "<timestamp>",
}
}
peer
: Peer name.status
: Peer’s status. See detail Peer status.address
: Registered peer’s address. “<ip>:<port>”monitor_status
: Peer monitoring status. See detail Peer monitoring status.dynamic
: Peer’s dynamic option value.auto_comedia
: Peer’s auto_comedia option value.auto_force_port
: Peer’s auto_force_port option value.acl
: Peer’s dynamic acl value.comedia
: Peer’s comedia option value.description
: Peer’s description option value.force_port
: Peer’s force_port option value.realtime_device
: Peer’s realtime_device option value.text_support
: Peer’s text support option value.video_support
: Peer’s video support option value.tm_update
: Updated timestamp.
Example¶
$ curl -X GET saturn.pchero21.com:8081/peers/ -d '{"peer": "agent-01"}'
{
"api_ver": "0.1",
"result": {
"acl": "no",
"address": "192.168.200.1:5060",
"auto_comedia": "yes",
"auto_force_port": "no",
"chan_object_type": "peer",
"channel_type": "SIP",
"comedia": "yes",
"description": "",
"dynamic": "yes",
"force_port": "no",
"monitor_status": "OK (22 ms)",
"peer": "SIP/agent-01",
"realtime_device": "no",
"status": "Registered",
"text_support": "no",
"tm_update": "2017-04-09T02:08:18.756977409Z",
"video_support": "no"
},
"statuscode": 200,
"timestamp": "2017-04-09T02:09:55.226677432Z"
}
/registries¶
Methods¶
GET : Get list of all registry accounts info.
Method: GET¶
Get list of all registry accounts info.
Call¶
GET /registries
Returns¶
{
$defhdr,
"reuslt": {
"list": [
{"account": "<string>"},
...
]
}
}
list
: array of registry account.account
: Registry account info.
Example¶
$ curl -X GET 192.168.200.10:8081/registries
{
"api_ver": "0.1",
"result": {
"list": [
{"account": "2345@sip_proxy:5060"},
{"account": "1234@mysipprovider.com:5060"}
]
},
"statuscode": 200,
"timestamp": "2017-03-12T00:27:18.798367307Z"
}
/registries/¶
Methods¶
GET : Get registry detail info of given account info.
Method: GET¶
Get registry detail info of given account info.
Returns¶
{
$defhdr,
"reuslt": {
"account": "<string>",
"state": "<string>",
"username": "<string>",
"domain": "<string>",
"domain_port": <integer>,
"host": "<string>",
"port": <integer>,
"refresh": <integer>,
"registration_time": <integer>,
"tm_update": "<timestamp>"
}
}
account
: Registry’s account info.state
: state info.username
: Registry’s username.domain
: Registry’s domain info.domain_port
: Registry’s domain port.host
: Registry’s host info.port
: Registry’s port info.refresh
: Refresh.registration_time
: registration time.tm_update
: Updated timestamp.
Example¶
$ curl -X GET 192.168.200.10:8081/registries/ -d '{"account": "2345@sip_proxy"}'
{
"api_ver": "0.1",
"result": {
"account": "2345@sip_proxy",
"domain": "sip_proxy",
"domain_port": 5060,
"host": "sip_proxy",
"port": 5060,
"refresh": 120,
"registration_time": "0",
"state": "Request Sent",
"tm_update": "2017-03-09T09:12:06.652539075Z",
"username": "2345"
},
"statuscode": 200,
"timestamp": "2017-03-09T09:13:00.969355467Z"
}
/admin/core/channels¶
Methods¶
GET : Get list of all channels info.
Method: GET¶
Get list of all channels info.
Call¶
GET /admin/core/channels
Returns¶
{
$defhdr,
"reuslt": {
"list": [
{
"unique_id": "<string>",
"linked_id": "<string>",
"channel": "<string>",
"channel_state": <integer>,
"channel_state_desc": "<string>",
"context": "<string>",
"exten": "<string>",
"priority": "<string>",
"caller_id_name": "<string>",
"caller_id_num": "<string>",
"connected_line_name": "<string>",
"connected_line_num": "<string>",
"account_code": "<string>",
"language": "<string>",
"hangup_cause": <number>,
"hangup_cause_desc": "<string>",
"variables": {},
"tm_update": "<timestamp>"
},
...
]
}
}
list
: array of channels. * See detail at Method: GET.
Example¶
$ curl -k -X GET https://192.168.200.10:8081/v1/admin/core/channels
{
"api_ver": "0.1",
"result": {
"list": [
{
"account_code": "",
"application": "Queue",
"application_data": "",
"bridge_id": null,
"caller_id_name": "pjagent-01",
"caller_id_num": "pjagent-01",
"channel": "PJSIP/pjagent-01-00000007",
"channel_state": 4,
"channel_state_desc": "Ring",
"connected_line_name": "<unknown>",
"connected_line_num": "<unknown>",
"context": "queue_sales",
"duration": null,
"exten": "s",
"hangup_cause": null,
"hangup_cause_desc": null,
"language": "en",
"linked_id": "1513946896.7",
"priority": "2",
"tm_update": "2017-12-22T12:48:17.211205731Z",
"unique_id": "1513946896.7",
"variables": {}
}
]
},
"statuscode": 200,
"timestamp": "2017-12-22T12:48:26.824442473Z"
}
/admin/core/channels/<detail>¶
Method: GET¶
Get channel’s detail info of given channel info.
Returns¶
{
$defhdr,
"reuslt": {
"unique_id": "<string>",
"linked_id": "<string>",
"channel": "<string>",
"channel_state": <integer>,
"channel_state_desc": "<string>",
"context": "<string>",
"exten": "<string>",
"priority": "<string>",
"caller_id_name": "<string>",
"caller_id_num": "<string>",
"connected_line_name": "<string>",
"connected_line_num": "<string>",
"account_code": "<string>",
"language": "<string>",
"application": "<string>",
"application_data": "<string>",
"hangup_cause": <number>,
"hangup_cause_desc": "<string>",
"variables": {},
"tm_update": "<timestamp>"
}
}
Return parameters
unique_id
: Channel’s unique id.linked_id
: Channel’s linked id.channel
: Channel’s name.channel_state
: Channel’s state.channel_state_desc
: Channel’s state description.context
: Context.exten
: Extension.priority
: Prioritycaller_id_name
: Caller’s id name.caller_id_num
: Caller’s id number.connected_line_name
: Caller’s line name.connected_line_num
: Caller’s line number.account_code
: Account code.language
: Language.application
: Application name.application_data
: Application data.hangup_cause
: Hangup reason.hangup_cause_desc
: Hangup reason description.variables
: List of channel’s variables.
Example¶
$ curl -k -X GET https://localhost:8081/v1/admin/core/channels/1513946896.7
{
"api_ver": "0.1",
"result": {
"account_code": "",
"application": "Queue",
"application_data": "",
"bridge_id": null,
"caller_id_name": "pjagent-01",
"caller_id_num": "pjagent-01",
"channel": "PJSIP/pjagent-01-00000007",
"channel_state": 4,
"channel_state_desc": "Ring",
"connected_line_name": "<unknown>",
"connected_line_num": "<unknown>",
"context": "queue_sales",
"duration": null,
"exten": "s",
"hangup_cause": null,
"hangup_cause_desc": null,
"language": "en",
"linked_id": "1513946896.7",
"priority": "2",
"tm_update": "2017-12-22T12:48:17.211205731Z",
"unique_id": "1513946896.7",
"variables": {}
},
"statuscode": 200,
"timestamp": "2017-12-22T12:49:31.608415721Z"
}
/admin/core/modules¶
Methods¶
GET : Get list of all modules info.
Method: GET¶
Get list of all modules info.
Call¶
GET /admin/core/modules
Returns¶
{
$defhdr,
"reuslt": {
"list": [
{
"load": "<string>",
"name": "<string>",
"size": number,
"tm_update": "<timestamp>"
},
...
]
}
}
list
: array of channels. * See detail at Method: GET.
Example¶
$ curl -k -X GET https://localhost:8081/v1/admin/core/modules
{
"api_ver": "0.1",
"result": {
"list": [
{
"load": "unknown",
"name": "app_voicemail",
"size": 1083280,
"tm_update": "2017-12-17T22:11:40.375546224Z"
}
]
},
"statuscode": 200,
"timestamp": "2017-12-17T23:14:08.548863974Z"
}
/admin/core/modules/<detail>¶
Methods¶
GET : Get detail info of given module
POST : Load given module.
PUT : Reload given module.
DELETE : Unload given module.
Method: GET¶
Get list of all modules info.
Returns¶
{
$defhdr,
"reuslt": {
"load": "<string>",
"name": "<string>",
"size": number,
"tm_update": "<timestamp>"
}
}
load
: load status.name
: module name.size
: module size.
Example¶
$ curl -k -X GET https://localhost:8081/v1/admin/core/modules/app_voicemail
{
"api_ver": "0.1",
"result": {
"load": "unknown",
"name": "app_voicemail",
"size": 1083280,
"tm_update": "2017-12-17T23:28:02.30024695Z"
},
"statuscode": 200,
"timestamp": "2017-12-17T23:28:07.214355673Z"
}
Method: POST¶
Load the given module.
Returns¶
{
$defhdr
}
Example¶
$ curl -k -X POST https://localhost:8081/v1/admin/core/modules/app_voicemail
{
"api_ver": "0.1",
"statuscode": 200,
"timestamp": "2017-12-17T23:35:07.579784864Z"
}
Method: PUT¶
Reload the given module.
Returns¶
{
$defhdr
}
Example¶
$ curl -k -X PUT https://localhost:8081/v1/admin/core/modules/app_voicemail
{
"api_ver": "0.1",
"statuscode": 200,
"timestamp": "2017-12-17T23:36:24.508748449Z"
}
/admin/core/systems¶
Methods¶
GET : Get list of all systems info.
Method: GET¶
Get list of all modules info.
Call¶
GET /admin/core/systems
Returns¶
{
$defhdr,
"reuslt": {
"list": [
{
"id": "<string>",
"system_name": "<string>",
"ami_version": "<string>",
"ast_version": "<string>",
"cdr_enabled": "<string>",
"http_enabled": "<string>",
"current_calls": <number>,
"max_calls": <number>,
"max_file_handles": <number>,
"max_load_avg": <real>,
"real_time_enabled": "<string>",
"reload_date": "<string>",
"reload_time": "<string>",
"run_group": "<string>",
"run_user": "<string>",
"startup_date": "<string>",
"startup_time": "<string>",
"tm_update": "<string>"
},
...
]
}
}
list
: array of channels. * See detail at Method: GET.
Example¶
$ curl -k -X GET https://localhost:8081/v1/admin/core/systems
{
"api_ver": "0.1",
"result": {
"list": [
{
"ami_version": "4.0.0",
"ast_version": "GIT-master-e97e415M",
"cdr_enabled": "Yes",
"current_calls": 0,
"http_enabled": "No",
"id": "1",
"max_calls": 0,
"max_file_handles": 0,
"max_load_avg": 0.0,
"real_time_enabled": "No",
"reload_date": "2017-12-17",
"reload_time": "23:36:24",
"run_group": "",
"run_user": "",
"startup_date": "2017-12-17",
"startup_time": "10:17:20",
"system_name": "",
"tm_update": "2017-12-17T23:38:54.940300313Z"
}
]
},
"statuscode": 200,
"timestamp": "2017-12-17T23:38:55.914253052Z"
}
/admin/core/systems/<detail>¶
Methods¶
GET : Get detail info of given system.
Method: GET¶
Get detail info of given system.
Returns¶
{
$defhdr,
"reuslt": {
"id": "<string>",
"system_name": "<string>",
"ami_version": "<string>",
"ast_version": "<string>",
"cdr_enabled": "<string>",
"http_enabled": "<string>",
"real_time_enabled": "<string>",
"current_calls": <number>,
"max_calls": <number>,
"max_file_handles": <number>,
"max_load_avg": <real>,
"reload_date": "<string>",
"reload_time": "<string>",
"run_group": "<string>",
"run_user": "<string>",
"startup_date": "<string>",
"startup_time": "<string>",
"tm_update": "<string>"
}
}
id
: system id.system_name
: system name.ami_version
: AMI version.ast_version
: Asterisk version.cdr_enabled
: Cdr enanbled or not. If enabled “Yes”.http_enabled
: http enabled or not. If enabled “Yes”.real_time_enabled
: real time enabled or not. If enabled “Yes”.current_calls
: Current call count.max_calls
: Maximum call count.max_file_handles
: Maximum file handle count.max_load_avg
: Max load average.reload_date
: Reloaded date.reload_time
: Reloaded time.run_group
: Process running group.run_user
: Process running user.startup_date
: Startup date.startup_time
: Startup time.
Example¶
$ curl -k -X GET https://localhost:8081/v1/admin/core/systems/1
{
"api_ver": "0.1",
"result": {
"ami_version": "4.0.0",
"ast_version": "GIT-master-e97e415M",
"cdr_enabled": "Yes",
"current_calls": 0,
"http_enabled": "No",
"id": "1",
"max_calls": 0,
"max_file_handles": 0,
"max_load_avg": 0.0,
"real_time_enabled": "No",
"reload_date": "2017-12-17",
"reload_time": "23:36:24",
"run_group": "",
"run_user": "",
"startup_date": "2017-12-17",
"startup_time": "10:17:20",
"system_name": "",
"tm_update": "2017-12-17T23:42:16.933212413Z"
},
"statuscode": 200,
"timestamp": "2017-12-17T23:42:17.210353468Z"
}
/admin/dialplan/adps¶
Methods¶
GET : Get list of all adp(async dialplan)s info.
POST : Create new adp(async dialplan) info.
Method: GET¶
Get list of all adp(async dialplan)s info.
Call¶
GET /admin/dialplan/adps
Returns¶
{
$defhdr,
"reuslt": {
"list": [
{
...
},
...
]
}
}
Return parameters
list
: array of itmes. * See detail dialplans detail info.
Example¶
$ curl -k -X GET https://localhost:8081/v1/admin/dialplan/adps
{
"api_ver": "0.1",
"result": {
"list": [
{
"command": null,
"detail": null,
"dpma_uuid": "1d47735d-2265-463c-908a-d37dea085c21",
"name": "test_dialplan_1",
"sequence": 10,
"tm_create": "2018-01-23T01:05:53.878811167Z",
"tm_update": "2018-01-23T01:27:54.670312624Z",
"uuid": "91bba56b-7ec5-4fe2-a724-9f39d527da8c"
}
]
},
"statuscode": 200,
"timestamp": "2018-01-23T01:29:02.718231538Z"
}
Method: POST¶
Create new adp(async dialplan) info.
Call¶
POST /admin/dialplan/adps
{
...
}
Returns¶
{
$defhdr
}
Example¶
$ curl -k -X POST https://localhost:8081/v1/admin/dialplan/adps -d
'{"name": "test_dialplan_1", "dpma_uuid":"1d47735d-2265-463c-908a-d37dea085c21", "sequence": 1}'
{
"api_ver": "0.1",
"statuscode": 200,
"timestamp": "2018-01-23T01:38:38.709550080Z"
}
/admin/dialplan/adps/<detail>¶
Methods¶
GET : Get async dialplan detail info of given detail.
PUT : Update async dialplan detail info of given detail.
DELETE : Delete the given async dialplan info.
Method: GET¶
Get async dialplan detail info of given detail.
Returns¶
{
$defhdr,
"reuslt": {
"uuid": "<string>",
"dpma_uuid": "<string>",
"sequence": <number>,
"name": "<string>",
"detail": "<string>",
"command": "<string>",
"tm_create": "<timestamp>",
"tm_update": "<timestamp>"
}
}
Return parameters
uuid
: dialplan uuid.dpma_uuid
: Dpma uuid.sequence
: Sequence.name
: Name.detail
: Detail info.command
: Command.tm_create
: timestamp.tm_update
: timestamp.
Example¶
$ curl -k https://localhost:8081/v1/admin/dialplan/adps/abde9ef2-7255-4e64-acbe-a6edb964c442
{
"api_ver": "0.1",
"result": {
"command": null,
"detail": null,
"dpma_uuid": "1d47735d-2265-463c-908a-d37dea085c21",
"name": "test_dialplan_1",
"sequence": 1,
"tm_create": "2018-01-23T01:38:38.698487606Z",
"tm_update": null,
"uuid": "abde9ef2-7255-4e64-acbe-a6edb964c442"
},
"statuscode": 200,
"timestamp": "2018-01-23T01:38:53.794937064Z"
}
Method: PUT¶
Update async dialplan detail info of given detail.
Returns¶
{
$defhdr
}
Example¶
$ curl -k -X PUT https://localhost:8081/v1/admin/dialplan/adps/91bba56b-7ec5-4fe2-a724-9f39d527da8c -d \
'{"uuid": "91bba56b-7ec5-4fe2-a724-9f39d527da8c", \
"dpma_uuid": "1d47735d-2265-463c-908a-d37dea085c21", "sequence": 10}'
{
"api_ver": "0.1",
"statuscode": 200,
"timestamp": "2018-01-23T01:27:54.683794074Z"
}
Method: DELETE¶
DELETE : Delete the given async dialplan info.
Call¶
DELETE /admin/dialplan/adps/<detail>
Returns¶
{
$defhdr
}
Example¶
$ curl -k -X DELETE https://localhost:8081/v1/admin/dialplan/adps/91bba56b-7ec5-4fe2-a724-9f39d527da8c
{
"api_ver": "0.1",
"statuscode": 200,
"timestamp": "2018-01-23T01:29:34.538575375Z"
}
/admin/dialplan/adpmas¶
Method: GET¶
Get list of all adpma info.
Call¶
GET /admin/dialplan/adpmas
Returns¶
{
$defhdr,
"reuslt": {
"list": [
{
...
},
...
]
}
}
Return parameters
list
: array of itmes. * See detail adpma detail info.
Example¶
$ curl -k https://localhost:8081/v1/admin/dialplan/adpmas
{
"api_ver": "0.1",
"result": {
"list": [
{
"detail": "test dpma dpma",
"name": "test dpma",
"tm_create": "2018-01-22T23:40:55.513269352Z",
"tm_update": null,
"uuid": "1d47735d-2265-463c-908a-d37dea085c21"
}
]
},
"statuscode": 200,
"timestamp": "2018-01-22T23:41:06.819146813Z"
}
Method: POST¶
Create new adpma info.
Call¶
POST /admin/dialplan/adpmas
{
...
}
Returns¶
{
$defhdr
}
Example¶
$ curl -k -X POST https://localhost:8081/v1/admin/dialplan/adpmas -d '{"name": "test dpma", "detail": "test dpma dpma"}'
{
"api_ver": "0.1",
"statuscode": 200,
"timestamp": "2018-01-22T23:40:55.524091997Z"
}
/admin/dialplan/adpmas/<detail>¶
Methods¶
GET : Get adpmas detail info of given detail.
PUT : Update adpmas detail info of given detail.
DELETE : Delete the given adpmas info.
Method: GET¶
Get adpma detail info of given detail.
Returns¶
{
$defhdr,
"reuslt": {
"uuid": "<string>",
"name": "<string>",
"detail": "<string>",
"tm_create": "<string>",
"tm_update": "<string>"
}
}
Return parameters
uuid
: adpma uuid.name
: Name.detail
: Detail info.tm_create
: timestamp.tm_update
: timestamp.
Example¶
$ curl -k https://localhost:8081/v1/admin/dialplan/adpmas/1d47735d-2265-463c-908a-d37dea085c21
{
"api_ver": "0.1",
"result": {
"detail": "test dpma dpma",
"name": "test dpma",
"tm_create": "2018-01-22T23:40:55.513269352Z",
"tm_update": null,
"uuid": "1d47735d-2265-463c-908a-d37dea085c21"
},
"statuscode": 200,
"timestamp": "2018-01-22T23:43:06.585017860Z"
}
Method: PUT¶
Update adpmas detail info of given detail.
Returns¶
{
$defhdr
}
Example¶
$ curl -k -X PUT https://localhost:8081/v1/admin/dialplan/adpmas/1d47735d-2265-463c-908a-d37dea085c21 -d
'{"name": "test change name" }'
{
"api_ver": "0.1",
"statuscode": 200,
"timestamp": "2018-01-22T23:46:38.238159711Z"
}
Method: DELETE¶
DELETE : Delete the given adpma info.
Call¶
DELETE /admin/dialplan/adpmas/<detail>
Returns¶
{
$defhdr
}
Example¶
$ curl -k -X DELETE https://localhost:8081/v1/admin/dialplan/adpmas/1d47735d-2265-463c-908a-d37dea085c21
{
"api_ver": "0.1",
"statuscode": 200,
"timestamp": "2018-01-23T01:59:22.411717755Z"
}
/admin/dialplan/configurations/<detail>¶
Methods¶
GET: Get given dialplan configuration detail info.
PUT: Update given dialplan configuration detail info.
DELETE: Delete given dialplan configuration detail info.
Method: GET¶
Get given dialplan configuration detail info.
Example¶
$ curl -k https://localhost:8081/v1/admin/dialplan/configurations/extensions.conf\?authtoken=86f7c25d-54db-4ffd-9bf8-8f691fbb4b97
{
"api_ver": "0.1",
"result": {
"data": "...",
"name": "extensions.conf"
},
"statuscode": 200,
"timestamp": "2018-05-22T13:33:06.376506142Z"
}
Method: PUT¶
Update given dialplan configuration detail info.
Method: DELETE¶
Delete given dialplan configuration detail info.
Example¶
$ curl -k -X DELETE https://localhost:8081/v1/admin/dialplan/configurations/extensions.conf.2018-05-21T08:49:27.783332067Z\?authtoken=86f7c25d-54db-4ffd-9bf8-8f691fbb4b97
{
"api_ver": "0.1",
"statuscode": 200,
"timestamp": "2018-05-22T13:35:18.521871974Z"
}
/admin/dialplan/sdps¶
Methods¶
GET: Get all of dialplam’s static dialplans info.
Method: GET¶
Example¶
$ curl -k https://localhost:8081/v1/admin/dialplan/sdps\?authtoken=86f7c25d-54db-4ffd-9bf8-8f691fbb4b97
{
"api_ver": "0.1",
"result": {
"list": [
{
"data": [
{
"exten": "> _X.,1,NoOp(jade-queue)"
},
{
"same": "> n,Queue(jade-queue)"
}
],
"name": "jade-queue"
},
{
"data": [],
"name": "jade_demo2"
},
{
"data": [
{
"exten": "> 100,1,NoOp(sample_park)"
},
{
"same": "> n,park()"
},
{
"exten": "> _X.,1,BackGround(demo-congrats)"
},
{
"same": "> n,Hangup()"
}
],
"name": "jade_demo"
},
{
"data": [],
"name": "jade_demo3"
}
]
},
"statuscode": 200,
"timestamp": "2018-05-22T13:36:41.645574898Z"
}
/admin/dialplan/sdps/<detail>¶
Methods¶
Get: Get detail info of the given sdp.
PUT: Update detail info of the given sdp.
DELETE: Delete detail info of the given sdp.
Method: GET¶
Get detail info of the given sdp.
Example¶
$ curl -k https://localhost:8081/v1/admin/dialplan/sdps/jade_demo\?authtoken=86f7c25d-54db-4ffd-9bf8-8f691fbb4b97
{
"api_ver": "0.1",
"result": {
"data": [
{
"exten": "> 100,1,NoOp(sample_park)"
},
{
"same": "> n,park()"
},
{
"exten": "> _X.,1,BackGround(demo-congrats)"
},
{
"same": "> n,Hangup()"
}
],
"name": "jade_demo"
},
"statuscode": 200,
"timestamp": "2018-05-22T13:39:39.664914968Z"
}
/admin/info¶
Method: GET¶
Get current user’s info.
Example¶
$ curl -k https://localhost:8081/v1/admin/info\?authtoken=86f7c25d-54db-4ffd-9bf8-8f691fbb4b97
{
"api_ver": "0.1",
"result": {
"name": "Test Administrator",
"tm_create": "2018-04-28T05:03:36.560694725Z",
"tm_update": "2018-04-28T07:10:29.116108422Z",
"username": "admin",
"uuid": "ed629979-802b-40f0-9098-b30b2988f9b6"
},
"statuscode": 200,
"timestamp": "2018-05-22T13:42:29.17642767Z"
}
Method: PUT¶
Update current user’s info.
/admin/login¶
/admin/park/cfg_parkinglots¶
Method: GET¶
Get all of the config parkinglots info.
Example¶
$ curl -k -X GET https://localhost:8081/v1/admin/park/cfg_parkinglots\?authtoken=0e81eee1-f215-4397-ac99-e0de58b87b88
{
"api_ver": "0.1",
"result": {
"list": [
{
"data": {
"context": "teset",
"parkpos": "851-900"
},
"name": "test_park1"
},
{
"data": {},
"name": "jade-tesetqueue2"
},
{
"data": {
"comebackcontext": "edvinapark-timeout",
"comebackdialtime": "90",
"comebacktoorigin": "no",
"context": "edvina_park",
"findslot": "next",
"parkedmusicclass": "edvina",
"parkpos": "800-850"
},
"name": "edvina"
},
{
"data": {},
"name": "jade-testqueue2"
}
]
},
"statuscode": 200,
"timestamp": "2018-05-22T14:09:47.561146235Z"
}
/admin/park/cfg_parkinglots/<detail>¶
Methods¶
GET: Get detail info of the given config parkinglot.
PUT: Update detail info of the given config parkinglot.
DELETE: Delete detail info of the given config parkinglot.
Method: GET¶
Get detail info of the given config parkinglot.
Example¶
$ curl -k -X GET https://localhost:8081/v1/admin/park/cfg_parkinglots/edvina\?authtoken=0e81eee1-f215-4397-ac99-e0de58b87b88
{
"api_ver": "0.1",
"result": {
"data": {
"comebackcontext": "edvinapark-timeout",
"comebackdialtime": "90",
"comebacktoorigin": "no",
"context": "edvina_park",
"findslot": "next",
"parkedmusicclass": "edvina",
"parkpos": "800-850"
},
"name": "edvina"
},
"statuscode": 200,
"timestamp": "2018-05-22T14:14:53.789233359Z"
}
Method: PUT¶
Update detail info of the given config parkinglot.
Method: DELETE¶
Delete detail info of the given config parkinglot.
Example¶
$ curl -k -X DELETE https://localhost:8081/v1/admin/park/cfg_parkinglots/jade-tesetqueue2\?authtoken=0e81eee1-f215-4397-ac99-e0de58b87b88
{
"api_ver": "0.1",
"statuscode": 200,
"timestamp": "2018-05-22T14:17:32.187887090Z"
}
/admin/park/configurations¶
/admin/park/configurations/<detail>¶
/admin/park/parkedcalls¶
Methods¶
GET : Get list of all parked calls info.
Method: GET¶
Get list of all parked calls info.
Call¶
GET /admin/park/parkedcalls
Returns¶
{
$defhdr,
"reuslt": {
"list": [
{
...
},
...
]
}
}
Return parameters
list
: array of itmes. * See detail parkedcall detail info.
Example¶
$ curl -k -X GET https://localhost:8081/v1/admin/park/parkedcalls
{
"api_ver": "0.1",
"result": {
"list": [
{
"parkee_account_code": "",
"parkee_caller_id_name": "pjagent-01",
"parkee_caller_id_num": "pjagent-01",
"parkee_channel": "PJSIP/pjagent-01-00000044",
"parkee_channel_state": "6",
"parkee_channel_state_desc": "Up",
"parkee_connected_line_name": "<unknown>",
"parkee_connected_line_num": "<unknown>",
"parkee_context": "sample_park",
"parkee_exten": "s",
"parkee_linked_id": "1514423807.111",
"parkee_priority": "2",
"parkee_unique_id": "1514423807.111",
"parker_dial_string": "PJSIP/pjagent-01",
"parking_duration": 0,
"parking_lot": "default",
"parking_space": "701",
"parking_timeout": 45,
"tm_update": "2017-12-28T01:16:48.343347741Z"
}
]
},
"statuscode": 200,
"timestamp": "2017-12-28T01:17:10.187476889Z"
}
/admin/park/parkedcalls/<detail>¶
Methods¶
GET : Get parked_call’s detail info of given info.
DELETE : Hangup the given parked call info.
Method: GET¶
Get parked_call’s detail info of given info.
Returns¶
{
$defhdr,
"reuslt": {
"parkee_unique_id": "<string>",
"parkee_linked_id": "<string>",
"parkee_channel": "<string>",
"parkee_channel_state": "<string>",
"parkee_channel_state_desc": "<string>",
"parkee_caller_id_name": "<string>",
"parkee_caller_id_num": "<string>",
"parkee_connected_line_name": "<string>",
"parkee_connected_line_num": "<string>,
"parkee_account_code": "<string>",
"parkee_context": "<string>",
"parkee_exten": "<string>",
"parkee_priority": "<string>",
"parker_dial_string": "<string>",
"parking_duration": <integer>,
"parking_lot": "<string>",
"parking_space": "<string>",
"parking_timeout": <integer>,
"tm_update": "<timestamp>"
}
}
Return parameters
parkee_unique_id
: Parkee’s unique id.parkee_linked_id
: Parkee’s linked id.parkee_channel
: Parkee’s channel name.parkee_channel_state
: Parkee’s channele state.parkee_channel_state_desc
: Parkee’s channel state description.parkee_caller_id_name
: Parkee’s caller id name.parkee_caller_id_num
: Parkee’s caller id number.parkee_connected_line_name
: Parkee’s connected line name.parkee_connected_line_num
: Parkee’s connected line number.parkee_account_code
: Parkee’s account code.parkee_context
: Parkee’s current context.parkee_exten
: Parkee’s current exten.parkee_priority
: Parkee’s current priority.parker_dial_string
: Dial String that can be used to call back the parker on ParkingTimeout.parking_duration
: Time the parkee has been in the parking bridge since tm_update(in seconds).parking_lot
: Name of the parking lot that the parkee is parked in.parking_space
: Parking Space that the parkee is parked in.parking_timeout
: Time remaining until the parkee is forcefully removed from parking in seconds since tm_update.
Example¶
$ curl -X GET localhost:8081/park/parkedcalls/1514423984.115
{
"api_ver": "0.1",
"result": {
"parkee_account_code": "",
"parkee_caller_id_name": "pjagent-01",
"parkee_caller_id_num": "pjagent-01",
"parkee_channel": "PJSIP/pjagent-01-00000046",
"parkee_channel_state": "6",
"parkee_channel_state_desc": "Up",
"parkee_connected_line_name": "<unknown>",
"parkee_connected_line_num": "<unknown>",
"parkee_context": "sample_park",
"parkee_exten": "s",
"parkee_linked_id": "1514423984.115",
"parkee_priority": "2",
"parkee_unique_id": "1514423984.115",
"parker_dial_string": "PJSIP/pjagent-01",
"parking_duration": 0,
"parking_lot": "default",
"parking_space": "701",
"parking_timeout": 45,
"tm_update": "2017-12-28T01:19:44.271005802Z"
},
"statuscode": 200,
"timestamp": "2017-12-28T01:19:53.629685348Z"
}
/admin/park/parkinglots¶
Methods¶
GET : Get list of all parking lot info.
Method: GET¶
Get list of all parking lots info.
Call¶
GET /admin/park/parkinglots
Returns¶
{
$defhdr,
"reuslt": {
"list": [
{
...
},
...
]
}
}
Return parameters
list
: array of itmes.- See detail at parking lot detail info.
Example¶
$ curl -k -X GET https://localhost:8081/v1/admin/park/parkinglots
{
"api_ver": "0.1",
"result": {
"list": [
{
"name": "default",
"start_space": "701",
"stop_spcae": "720",
"timeout": 45,
"tm_update": "2017-12-28T01:16:46.350523532Z"
}
]
},
"statuscode": 200,
"timestamp": "2017-12-28T01:21:57.180448453Z"
}
/admin/park/parkinglots/<detail>¶
Methods¶
GET : Get parking lot’s detail info of given detail.
PUT : Update parking lot’s detail info of given detail.
DELETE : Delete the given parking lot info.
Method: GET¶
Get parking lot’s detail info of given info.
Call¶
GET /admin/park/parkinglots/<detail>
Method parameters
detail
: url encoded parking lot’s name.
Returns¶
{
$defhdr,
"reuslt": {
"name": "<string>",
"start_space": "<string>",
"stop_spcae": "<string>",
"timeout": <integer>,
"tm_update": "<timestamp>"
}
}
Return parameters
name
: Parking lot’s name.start_space
: Parking lot’s start space.stop_spcae
: Parking lot’s stop space.timeout
: Timeout second in the parking lot.
Example¶
$ curl -k -X GET https://localhost:8081/v1/admin/park/parkinglots/default
{
"api_ver": "0.1",
"result": {
"name": "default",
"start_space": "701",
"stop_spcae": "720",
"timeout": 45,
"tm_update": "2017-12-28T01:16:46.350523532Z"
},
"statuscode": 200,
"timestamp": "2017-12-28T01:25:47.123913131Z"
}
Method: PUT¶
Update parking lot’s detail info of given detail.
Call¶
PUT /admin/park/parkinglots/<detail>
{
...
}
Method parameters
detail
: url encoded parking lot’s name.
Returns¶
{
$defhdr
}
Example¶
$ curl -k -X PUT https://localhost:8081/v1/admin/park/parkinglots/test_parkinglot -d \
'{"context": "> edvina_park", "parkpos": "> 800-900", "findslot": "> next", \
"comebacktoorigin": "no", "comebackdialtime": "90", \
"comebackcontext": "edvinapark-timeout", "parkedmusicclass": "edvina" }'
{
"api_ver": "0.1",
"timestamp": "2018-01-03T22:17:22.76376966Z",
"statuscode": 200
}
Method: DELETE¶
DELETE : Delete the given parking lot info.
Call¶
DELETE /admin/park/parkinglots/<detail>
Returns¶
{
$defhdr
}
Example¶
$ curl -k -X DELETE https://localhost:8081/v1/admin/park/parkinglots/test_parkinglot
{
"api_ver": "0.1",
"timestamp": "2018-01-03T21:50:01.672074605Z",
"statuscode": 200
}
/admin/pjsip/aors¶
Methods¶
GET : Get all list of aors.
Method: GET¶
GET : Get all list of aors.
Call¶
GET ^/admin/pjsip/aors
Returns¶
{
$defhdr,
"result": {
"list": [
{
"object_name": "<string>",
"object_type": "<string>",
"endpoint_name": "<string>",
"contacts": "<string>",
"contacts_registered": <number>,
"total_contacts": <number>,
"authenticate_qualify": "<string>",
"default_expiration": <number>,
"mailboxes": "<string>",
"max_contacts": <number>,
"maximum_expiration": <number>,
"minimum_expiration": <number>,
"outbound_proxy": "<string>",
"qualify_frequency": <number>,
"qualify_timeout": <number>,
"remove_existing": "<string>",
"support_path": "<string>",
"voicemail_extension": "<string>",
"tm_update": "<timestamp>"
},
...
]
}
}
Example¶
$ curl -k -X GET https://localhost:8081/v1/admin/pjsip/aors
{
"api_ver": "0.1",
"result": {
"list": [
{
"authenticate_qualify": "false",
"contacts": "",
"contacts_registered": 0,
"default_expiration": 3600,
"endpoint_name": "199",
"mailboxes": "",
"max_contacts": 1,
"maximum_expiration": 7200,
"minimum_expiration": 60,
"object_name": "199",
"object_type": "aor",
"outbound_proxy": "",
"qualify_frequency": 0,
"qualify_timeout": 3,
"remove_existing": "true",
"support_path": "false",
"tm_update": "2017-12-19T20:03:34.948197060Z",
"total_contacts": 0,
"voicemail_extension": ""
},
...
]
},
"statuscode": 200,
"timestamp": "2017-12-19T20:03:41.263715886Z"
}
/admin/pjsip/aors/<detail>¶
Methods¶
GET : Get detail aor info of given aor info.
Method: GET¶
GET : Get detail aor info of given aor info.
Returns¶
{
$defhdr,
"reuslt": {
"object_name": "<string>",
"object_type": "<string>",
"endpoint_name": "<string>",
"contacts": "<string>",
"contacts_registered": <number>,
"total_contacts": <number>,
"authenticate_qualify": "<string>",
"default_expiration": <number>,
"mailboxes": "<string>",
"max_contacts": <number>,
"maximum_expiration": <number>,
"minimum_expiration": <number>,
"outbound_proxy": "<string>",
"qualify_frequency": <number>,
"qualify_timeout": <number>,
"remove_existing": "<string>",
"support_path": "<string>",
"voicemail_extension": "<string>",
"tm_update": "<timestamp>"
}
}
object_name
: aor name.object_type
: type. Always would be “aor”.
Example¶
$ curl -k -X GET https://localhost:8081/v1/admin/pjsip/aors/pjagent-01
{
"api_ver": "0.1",
"result": {
"authenticate_qualify": "false",
"contacts": "pjagent-01/sip:35740219@10.12.118.159:49027",
"contacts_registered": 1,
"default_expiration": 3600,
"endpoint_name": "pjagent-01",
"mailboxes": "",
"max_contacts": 1,
"maximum_expiration": 7200,
"minimum_expiration": 60,
"object_name": "pjagent-01",
"object_type": "aor",
"outbound_proxy": "",
"qualify_frequency": 0,
"qualify_timeout": 3,
"remove_existing": "true",
"support_path": "false",
"tm_update": "2017-12-19T20:03:36.64487822Z",
"total_contacts": 1,
"voicemail_extension": ""
},
"statuscode": 200,
"timestamp": "2017-12-19T20:21:29.736727558Z"
}
/admin/pjsip/auth¶
Methods¶
GET : Get all list of auths.
Method: GET¶
GET : Get all list of auths.
Call¶
GET /admin/pjsip/auths
Returns¶
{
$defhdr,
"result": {
"list": [
{
"object_name": "<string>",
"object_type": "<string>",
"username": "<string>",
"auth_type": "<string>",
"password": "<string>",
"md5_cred": "<string>",
"realm": "<string>",
"nonce_lifetime": <number>,
"endpoint_name": "<string>",
"tm_update": "<timestamp>"
},
...
]
}
}
list
object_name
: auth name.object_type
: type. Always will be “auth”.
Example¶
$ curl -k -X GET https://localhost:8081/v1/admin/pjsip/auths
{
"api_ver": "0.1",
"result": {
"list": [
{
"auth_type": "userpass",
"endpoint_name": "pjagent-01",
"md5_cred": "",
"nonce_lifetime": 32,
"object_name": "pjagent-01",
"object_type": "auth",
"password": "pjagent-01",
"realm": "",
"tm_update": "2017-12-19T20:03:36.42243261Z",
"username": "pjagent-01"
},
...
]
},
"statuscode": 200,
"timestamp": "2017-12-19T20:26:09.770460034Z"
}
/admin/pjsip/auth/<detail>¶
Methods¶
GET : Get detail auth info of given auth info.
Method: GET¶
GET : Get detail auth info of given auth info.
Returns¶
{
$defhdr,
"reuslt": {
"object_name": "<string>",
"object_type": "<string>",
"username": "<string>",
"auth_type": "<string>",
"password": "<string>",
"md5_cred": "<string>",
"realm": "<string>",
"nonce_lifetime": <number>,
"endpoint_name": "<string>",
"tm_update": "<timestamp>"
}
}
object_name
: aor name.object_type
: type. Always would be “aor”.
Example¶
$ curl -k -X GET https://localhost:8081/v1/admin/pjsip/auths/pjagent-01
{
"api_ver": "0.1",
"result": {
"auth_type": "userpass",
"endpoint_name": "pjagent-01",
"md5_cred": "",
"nonce_lifetime": 32,
"object_name": "pjagent-01",
"object_type": "auth",
"password": "pjagent-01",
"realm": "",
"tm_update": "2017-12-19T20:03:36.42243261Z",
"username": "pjagent-01"
},
"statuscode": 200,
"timestamp": "2017-12-19T20:34:54.165290324Z"
}
/admin/pjsip/configurations¶
/admin/pjsip/configurations/<detail>¶
/admin/pjsip/contacts¶
Methods¶
GET : Get all list of contacts.
Method: GET¶
GET : Get all list of contacts.
Call¶
GET /admin/pjsip/contacts
Returns¶
{
$defhdr,
"result": {
"list": [
{
"id": "<string>",
"call_id": "<string>",
"uri": "<string>",
"aor": "<string>",
"endpoint_name": "<string>",
"status": "<string>",
"qualify_frequency": 0,
"qualify_timout": 3,
"authentication_qualify": 0,
"outbound_proxy": "<string>",
"path": "<string>",
"reg_expire": 1513714265,
"round_trip_usec": "<string>",
"user_agent": "<string>",
"via_address": "<string>",
"tm_update": "<string>"
},
...
]
}
}
list
object_name
: auth name.object_type
: type. Always will be “auth”.
Example¶
$ curl -k -X GET https://localhost:8081/v1/admin/pjsip/contacts
{
"api_ver": "0.1",
"result": {
"list": [
{
"aor": "pjagent-01",
"authentication_qualify": 0,
"call_id": "c67ef58c-3b65-44cd-a9a8-784e2af542d3",
"endpoint_name": "pjagent-01",
"id": "pjagent-01;@116e48d167ff94856cbc9009cdc735b2",
"outbound_proxy": "",
"path": "",
"qualify_frequency": 0,
"qualify_timout": 3,
"reg_expire": 1513714265,
"round_trip_usec": "0",
"status": "Unknown",
"tm_update": "2017-12-19T20:29:36.751968068Z",
"uri": "sip:35740219@10.12.118.159:49027",
"user_agent": "Blink 3.0.3 (Linux)",
"via_address": "10.12.118.159:49027"
}
]
},
"statuscode": 200,
"timestamp": "2017-12-19T20:38:09.405901164Z"
}
/admin/pjsip/contacts/<detail>¶
Methods¶
GET : Get detail contact info of given contact info.
Method: GET¶
GET : Get detail contact info of given contact info.
Returns¶
{
$defhdr,
"reuslt": {
"id": "<string>",
"call_id": "<string>",
"uri": "<string>",
"aor": "<string>",
"endpoint_name": "<string>",
"status": "<string>",
"qualify_frequency": 0,
"qualify_timout": 3,
"authentication_qualify": 0,
"outbound_proxy": "<string>",
"path": "<string>",
"reg_expire": 1513714265,
"round_trip_usec": "<string>",
"user_agent": "<string>",
"via_address": "<string>",
"tm_update": "<string>"
}
}
Example¶
$ curl -X GET localhost:8081/pjsip/contacts/pjagent-01%3B%40116e48d167ff94856cbc9009cdc735b2
{
"api_ver": "0.1",
"result": {
"aor": "pjagent-01",
"authentication_qualify": 0,
"call_id": "c67ef58c-3b65-44cd-a9a8-784e2af542d3",
"endpoint_name": "pjagent-01",
"id": "pjagent-01;@116e48d167ff94856cbc9009cdc735b2",
"outbound_proxy": "",
"path": "",
"qualify_frequency": 0,
"qualify_timout": 3,
"reg_expire": 1513716547,
"round_trip_usec": "N/A",
"status": "Unknown",
"tm_update": "2017-12-19T20:45:42.698151858Z",
"uri": "sip:35740219@10.12.118.159:49027",
"user_agent": "Blink 3.0.3 (Linux)",
"via_address": "10.12.118.159:49027"
},
"statuscode": 200,
"timestamp": "2017-12-19T20:51:43.977637876Z"
}
/admin/pjsip/endpoints¶
Methods¶
GET : Get all list of endpoints.
Method: GET¶
GET : Get all list of endpoints.
Call¶
GET /admin/pjsip/endpoints
Returns¶
{
$defhdr,
"result": {
"list": [
{
...
},
...
]
}
}
Example¶
$ curl -k -X GET https://localhost:8081/v1/admin/pjsip/endpoints
{
"api_ver": "0.1",
"result": {
"list": [
{
"account_code": "",
"acl": "",
"active_channels": "",
"aggregate_mwi": "true",
"allow": "(codec2|g723|ulaw|alaw|gsm|g726|g726aal2|adpcm|slin|slin|slin|slin|slin|slin|slin|slin|slin|lpc10|g729|speex|speex|speex|ilbc|g722|siren7|siren14|testlaw|g719|opus|jpeg|png|h261|h263|h263p|h264|mpeg4|vp8|vp9|red|t140|t38|silk|silk|silk|silk)",
"allow_overlap": "true",
"allow_subscribe": "true",
"allow_transfer": "true",
"aors": "pjagent-01",
"asymmetric_rtp_codec": "false",
"auth": "pjagent-01",
"bind_rtp_to_media_address": "false",
"bundle": "false",
"call_group": "",
"caller_id": "<unknown>",
"caller_id_privacy": "allowed_not_screened",
"caller_id_tag": "",
"connected_line_method": "invite",
"contact_acl": "",
"context": "demo",
"cos_audio": 0,
"cos_video": 0,
"device_state": "Not in use",
"device_state_busy_at": 0,
"direct_media": "true",
"direct_media_glare_mitigation": "none",
"direct_media_method": "invite",
"disable_direct_media_on_nat": "false",
"disallow": "",
"dtls_ca_file": "",
"dtls_ca_path": "",
"dtls_cert_file": "",
"dtls_cipher": "",
"dtls_fingerprint": "SHA-256",
"dtls_private_key": "",
"dtls_rekey": 0,
"dtls_setup": "active",
"dtls_verify": "No",
"dtmf_mode": "rfc4733",
"fax_detect": "false",
"fax_detect_time": 0,
"force_avp": "false",
"force_rport": "true",
"from_domain": "",
"from_user": "",
"g_726_non_standard": "false",
"ice_support": "false",
"identify_by": "username,ip",
"inband_progress": "false",
"incoming_mwi_mailbox": "pjagent-01@vm-demo",
"language": "",
"mailboxes": "pjagent-01@vm-demo",
"max_audio_streams": 1,
"max_video_streams": 1,
"media_address": "",
"media_encryption": "no",
"media_encryption_optimistic": "false",
"media_use_received_transport": "false",
"message_context": "",
"moh_passthrough": "false",
"moh_suggest": "default",
"mwi_from_user": "",
"mwi_subscribe_replaces_unsolicited": "false",
"named_call_group": "",
"named_pickup_group": "",
"notify_early_inuse_ringing": "false",
"object_name": "pjagent-01",
"object_type": "endpoint",
"one_touch_recording": "false",
"outbound_auth": "",
"outbound_proxy": "",
"pickup_group": "",
"preferred_codec_only": "false",
"record_off_feature": "automixmon",
"record_on_feature": "automixmon",
"redirect_method": "",
"refer_blind_progress": "true",
"rel_100": "yes",
"rewrite_contact": "false",
"rpid_immediate": "false",
"rtcp_mux": "false",
"rtp_engine": "asterisk",
"rtp_ipv6": "false",
"rtp_keepalive": 0,
"rtp_symmetric": "false",
"rtp_timeout": 0,
"rtp_timeout_hold": 0,
"sdp_owner": "-",
"sdp_session": "Asterisk",
"send_diversion": "true",
"send_pai": "false",
"send_rpid": "false",
"set_var": "",
"srtp_tag32": "false",
"sub_min_expiry": "0",
"subscribe_context": "",
"t38_udptl": "false",
"t38_udptl_ec": "none",
"t38_udptl_ipv6": "false",
"t38_udptl_maxdatagram": 0,
"t38_udptl_nat": "false",
"timers": "yes",
"timers_min_se": "90",
"timers_sess_expires": 1800,
"tm_update": "2017-12-19T20:45:42.632334496Z",
"tone_zone": "",
"tos_audio": 0,
"tos_video": 0,
"transport": "transport-udp",
"trust_id_inbound": "false",
"trust_id_outbound": "false",
"use_avpf": "false",
"use_ptime": "false",
"user_eq_phone": "false",
"voicemail_extension": "",
"webrtc": "no"
},
...
]
},
"statuscode": 200,
"timestamp": "2017-12-19T20:55:13.546370914Z"
}
/admin/pjsip/endpoints/<detail>¶
Methods¶
GET : Get detail endpoint info of given endpoint info.
Method: GET¶
GET : Get detail endpoint info of given endpoint info.
Returns¶
{
$defhdr,
"reuslt": {
...
}
}
Example¶
$ curl -k -X GET https://localhost:8081/v1/admin/pjsip/endpoints/pjagent-01
{
"api_ver": "0.1",
"result": {
"account_code": "",
"acl": "",
"active_channels": "",
"aggregate_mwi": "true",
"allow": "(codec2|g723|ulaw|alaw|gsm|g726|g726aal2|adpcm|slin|slin|slin|slin|slin|slin|slin|slin|slin|lpc10|g729|speex|speex|speex|ilbc|g722|siren7|siren14|testlaw|g719|opus|jpeg|png|h261|h263|h263p|h264|mpeg4|vp8|vp9|red|t140|t38|silk|silk|silk|silk)",
"allow_overlap": "true",
"allow_subscribe": "true",
"allow_transfer": "true",
"aors": "pjagent-01",
"asymmetric_rtp_codec": "false",
"auth": "pjagent-01",
"bind_rtp_to_media_address": "false",
"bundle": "false",
"call_group": "",
"caller_id": "<unknown>",
"caller_id_privacy": "allowed_not_screened",
"caller_id_tag": "",
"connected_line_method": "invite",
"contact_acl": "",
"context": "demo",
"cos_audio": 0,
"cos_video": 0,
"device_state": "Not in use",
"device_state_busy_at": 0,
"direct_media": "true",
"direct_media_glare_mitigation": "none",
"direct_media_method": "invite",
"disable_direct_media_on_nat": "false",
"disallow": "",
"dtls_ca_file": "",
"dtls_ca_path": "",
"dtls_cert_file": "",
"dtls_cipher": "",
"dtls_fingerprint": "SHA-256",
"dtls_private_key": "",
"dtls_rekey": 0,
"dtls_setup": "active",
"dtls_verify": "No",
"dtmf_mode": "rfc4733",
"fax_detect": "false",
"fax_detect_time": 0,
"force_avp": "false",
"force_rport": "true",
"from_domain": "",
"from_user": "",
"g_726_non_standard": "false",
"ice_support": "false",
"identify_by": "username,ip",
"inband_progress": "false",
"incoming_mwi_mailbox": "pjagent-01@vm-demo",
"language": "",
"mailboxes": "pjagent-01@vm-demo",
"max_audio_streams": 1,
"max_video_streams": 1,
"media_address": "",
"media_encryption": "no",
"media_encryption_optimistic": "false",
"media_use_received_transport": "false",
"message_context": "",
"moh_passthrough": "false",
"moh_suggest": "default",
"mwi_from_user": "",
"mwi_subscribe_replaces_unsolicited": "false",
"named_call_group": "",
"named_pickup_group": "",
"notify_early_inuse_ringing": "false",
"object_name": "pjagent-01",
"object_type": "endpoint",
"one_touch_recording": "false",
"outbound_auth": "",
"outbound_proxy": "",
"pickup_group": "",
"preferred_codec_only": "false",
"record_off_feature": "automixmon",
"record_on_feature": "automixmon",
"redirect_method": "",
"refer_blind_progress": "true",
"rel_100": "yes",
"rewrite_contact": "false",
"rpid_immediate": "false",
"rtcp_mux": "false",
"rtp_engine": "asterisk",
"rtp_ipv6": "false",
"rtp_keepalive": 0,
"rtp_symmetric": "false",
"rtp_timeout": 0,
"rtp_timeout_hold": 0,
"sdp_owner": "-",
"sdp_session": "Asterisk",
"send_diversion": "true",
"send_pai": "false",
"send_rpid": "false",
"set_var": "",
"srtp_tag32": "false",
"sub_min_expiry": "0",
"subscribe_context": "",
"t38_udptl": "false",
"t38_udptl_ec": "none",
"t38_udptl_ipv6": "false",
"t38_udptl_maxdatagram": 0,
"t38_udptl_nat": "false",
"timers": "yes",
"timers_min_se": "90",
"timers_sess_expires": 1800,
"tm_update": "2017-12-19T20:45:42.632334496Z",
"tone_zone": "",
"tos_audio": 0,
"tos_video": 0,
"transport": "transport-udp",
"trust_id_inbound": "false",
"trust_id_outbound": "false",
"use_avpf": "false",
"use_ptime": "false",
"user_eq_phone": "false",
"voicemail_extension": "",
"webrtc": "no"
},
"statuscode": 200,
"timestamp": "2017-12-19T21:07:25.80668047Z"
}
/admin/pjsip/registration_outbounds¶
/admin/pjsip/registration_outbounds/<detail>¶
/admin/queue/cfg_queues¶
/admin/queue/cfg_queues/<detail>¶
/admin/queue/configurations¶
/admin/queue/configurations/<detail>¶
/admin/queue/entries¶
Methods¶
GET : Get list of all queue entries info.
Method: GET¶
Get list of all queue entries info.
Call¶
GET /admin/queue/entries
Returns¶
{
$defhdr,
"reuslt": {
"list": [
{
"unique_id": "<string>",
"queue_name": "<string>",
"channel": "<string>",
"caller_id_name": "<string>",
"caller_id_num": "<string>",
"connected_line_name": "<string>",
"connected_line_num": "<string>",
"position": <number>,
"wait": <number>,
"tm_update": "<timestamp>"
},
...
]
}
}
list
: array of queue entries. * See detail at Method: GET.
Example¶
$ curl -k -X GET https://localhost:8081/v1/admin/queue/entries
{
"api_ver": "0.1",
"result": {
"list": [
{
"caller_id_name": "pjagent-01",
"caller_id_num": "pjagent-01",
"channel": "PJSIP/pjagent-01-00000002",
"connected_line_name": "<unknown>",
"connected_line_num": "<unknown>",
"position": 1,
"queue_name": "sales_1",
"tm_update": "2017-12-18T00:23:39.821137155Z",
"unique_id": "1513556618.4",
"wait": null
}
]
},
"statuscode": 200,
"timestamp": "2017-12-18T00:23:40.94974824Z"
}
/admin/queue/entries/<detail>¶
Methods¶
GET : Get queue entry detail info of given queue entry info.
Method: GET¶
Get queue entry detail info of given queue entry info.
Returns¶
{
$defhdr,
"reuslt": {
"unique_id": "<string>",
"queue_name": "<string>",
"channel": "<string>",
"caller_id_name": "<string>",
"caller_id_num": "<string>",
"connected_line_name": "<string>",
"connected_line_num": "<string>",
"position": <number>,
"wait": <number>,
"tm_update": "<timestamp>"
}
}
Return parameters
unique_id
: Unique id of channel.caller_id_num
: The name of the queue.channel
: Channel name.caller_id_name
: Caller’s name.caller_id_num
: Caller’s number.connected_line_name
: Connected line’s name.connected_line_num
: Connected line’s number.position
: Position in the queue.wait
: If set when paused, the reason the queue member was paused.
Example¶
$ curl -k -X GET https://localhost:8081/v1/admin/queue/entries/1513557067.6
{
"api_ver": "0.1",
"result": {
"caller_id_name": "pjagent-01",
"caller_id_num": "pjagent-01",
"channel": "PJSIP/pjagent-01-00000004",
"connected_line_name": "<unknown>",
"connected_line_num": "<unknown>",
"position": 1,
"queue_name": "sales_1",
"tm_update": "2017-12-18T00:31:08.754950500Z",
"unique_id": "1513557067.6",
"wait": null
},
"statuscode": 200,
"timestamp": "2017-12-18T00:31:18.894580134Z"
}
/admin/queue/members¶
Methods¶
GET : Get list of all queue members info.
Method: GET¶
Get list of all queue members info.
Call¶
GET /admin/queue/members
Returns¶
{
$defhdr,
"reuslt": {
"list": [
{
"id": "<string>",
"name": "<string>",
"queue_name": "<string>",
"status": <integer>,
"membership": "<string>",
"state_interface": "<string>",
"location": "<string>",
"paused": <integer>,
"paused_reason": "<string>",
"penalty": <integer>,
"calls_taken": <integer>,
"in_call": <integer>,
"last_call": <integer>,
"last_pause": <integer>,
"ring_inuse": <integer>,
"tm_update": "<timestamp>"
},
...
]
}
}
list
: array of registry account. * See detail at Method: GET.
Example¶
$ curl -k -X GET https://localhost:8081/v1/admin/queue/members
{
"api_ver": "0.1",
"result": {
"list": [
{
"id": "sip/agent-02@sales_1",
"calls_taken": 0,
"in_call": 0,
"last_call": 0,
"last_pause": 0,
"location": "sip/agent-02",
"membership": "dynamic",
"name": "sip/agent-02",
"paused": 0,
"paused_reason": "",
"penalty": 0,
"queue_name": "sales_1",
"ring_inuse": null,
"state_interface": "sip/agent-02",
"status": 4,
"tm_update": "2017-12-18T00:31:04.175880809Z"
},
...
]
},
"statuscode": 200,
"timestamp": "2017-12-18T00:34:45.370734689Z"
}
/admin/queue/members/<detail>¶
Methods¶
GET : Get queue member detail info of given queue member info.
Method: GET¶
Get queue member detail info of given queue member info.
Call¶
GET /admin/queue/members/<detail>?queue_name=<string>
Method parameters
detail
: member name.queue_name
: queue name.
Returns¶
{
$defhdr,
"reuslt": {
"id": "<string>",
"name": "<string>",
"queue_name": "<string>",
"status": <integer>,
"membership": "<string>",
"state_interface": "<string>",
"location": "<string>",
"paused": <integer>,
"paused_reason": "<string>",
"penalty": <integer>,
"calls_taken": <integer>,
"in_call": <integer>,
"last_call": <integer>,
"last_pause": <integer>,
"ring_inuse": <integer>,
"tm_update": "<timestamp>"
}
}
Return parameters
* id
: member’s id.
name
: The name of the queue member.queue_name
: The name of the queue.status
: The numeric device state status of the queue member.membership
: Membership of queue member.state_interface
: Channel technology or location from which to read device state changes.location
: The queue member’s channel technology or location.paused
: Paused.paused_reason
: If set when paused, the reason the queue member was paused.penalty
: The penalty associated with the queue member.calls_taken
: The number of calls this queue member has serviced.in_call
: Set to 1 if member is in call. Set to 0 after LastCall time is updated.last_call
: The time this member last took a call, expressed in seconds since 00:00, Jan 1, 1970 UTC.last_pause
: The time when started last paused the queue member.ring_inuse
: Ring in use option.
Example¶
$ curl -k -X GET https://localhost:8081/v1/admin/queue/members/Agent%2F10001\?queue_name=sales_1
{
"api_ver": "0.1",
"result": {
"id": "Agent/10001@sales_1",
"calls_taken": 0,
"in_call": 0,
"last_call": 0,
"last_pause": 0,
"location": "Agent/10001",
"membership": "static",
"name": "Agent/10001",
"paused": 0,
"paused_reason": "",
"penalty": 0,
"queue_name": "sales_1",
"ring_inuse": null,
"state_interface": "Agent/10001",
"status": 4,
"tm_update": "2017-12-18T00:31:04.234368754Z"
},
"statuscode": 200,
"timestamp": "2017-12-18T00:38:27.704665757Z"
}
/admin/queue/queues¶
Methods¶
GET : Get list of all queues info.
Method: GET¶
Get list of all queues info
Call¶
GET /admin/queue/queues
Returns¶
{
$defhdr,
"reuslt": {
"list": [
{
"name": "<string>",
"strategy": "<string>",
"max": <integer>,
"weight": <integer>,
"calls": <integer>,
"completed": <integer>,
"abandoned": <integer>,
"hold_time": <integer>,
"talk_time": <integer>,
"service_level": <integer>,
"service_level_perf": <integer>,
"tm_update": "<timestamp>"
},
...
]
}
}
list
: array of registry account. * See detail at Method: GET.
Example¶
$ curl -k -X GET https://localhost:8081/v1/admin/queue/queues
{
"api_ver": "0.1",
"result": {
"list": [
{
"abandoned": 2,
"calls": 0,
"completed": 0,
"hold_time": 0,
"max": 0,
"name": "sales_1",
"service_level": 5,
"service_level_perf": 0.0,
"strategy": "ringall",
"talk_time": 0,
"tm_update": "2017-12-18T00:31:04.142068111Z",
"weight": 0
}
]
},
"statuscode": 200,
"timestamp": "2017-12-18T00:46:25.124236613Z"
}
/admin/queue/queues/<detail>¶
Methods¶
GET : Get queue detail info of given queue info.
Method: GET¶
Get queue detail info of given queue info.
Returns¶
{
$defhdr,
"reuslt": {
"name": "<string>",
"strategy": "<string>",
"max": <integer>,
"weight": <integer>,
"calls": <integer>,
"completed": <integer>,
"abandoned": <integer>,
"hold_time": <integer>,
"talk_time": <integer>,
"service_level": <integer>,
"service_level_perf": <integer>,
"tm_update": "<timestamp>"
}
}
Return parameters
name
: Queue name.strategy
: Call distribution.max
: Max waiting call count.weight
: Queue priority.calls
: Waiting call count.completed
: Completed call count.abandoned
: Abandoned call count.hold_time
: Average waiting time.talk_time
: Average talk time.service_level
: Service_level_perf interval time.service_leve_perf
: Service level performance.
Example¶
$ curl -k -X GET https://localhost:8081/v1/admin/queue/queues/sales_1
{
"api_ver": "0.1",
"result": {
"abandoned": 2,
"calls": 0,
"completed": 0,
"hold_time": 0,
"max": 0,
"name": "sales_1",
"service_level": 5,
"service_level_perf": 0.0,
"strategy": "ringall",
"talk_time": 0,
"tm_update": "2017-12-18T00:31:04.142068111Z",
"weight": 0
},
"statuscode": 200,
"timestamp": "2017-12-18T00:43:30.189014882Z"
}
/admin/user/users¶
Method: GET¶
Get the all users info.
Example¶
$ curl -k https://192.168.200.10:8081/v1/admin/user/users\?authtoken=986d5648-3905-4def-8479-009b33939273
{
"api_ver": "0.1",
"result": {
"list": [
{
"name": "Test Administrator",
"password": "admin",
"tm_create": "2018-04-28T05:03:36.560694725Z",
"tm_update": "2018-04-28T07:10:29.116108422Z",
"username": "admin",
"uuid": "ed629979-802b-40f0-9098-b30b2988f9b6"
},
{
"name": "test1",
"password": "test1",
"tm_create": "2018-04-29T07:19:00.56688782Z",
"tm_update": "2018-05-02T16:18:36.730339477Z",
"username": "test1",
"uuid": "65abf0b4-9cd5-4bff-8ec9-c03c1aea22d4"
},
{
"name": "test2",
"password": "test2",
"tm_create": "2018-05-02T13:52:58.303710170Z",
"tm_update": "2018-05-03T03:55:08.886606228Z",
"username": "test2",
"uuid": "16d1e8ea-1331-4ba7-a371-2c6261e1ce33"
}
]
},
"statuscode": 200,
"timestamp": "2018-05-03T08:46:52.150892217Z"
}
Method: POST¶
Create user info
Example¶
$ curl -k -X POST https://192.168.200.10:8081/v1/admin/user/users\?authtoken=986d5648-3905-4def-8479-009b33939273 -d '{"name": "test3", "password": "test3", "username": "test3"}'
{
"api_ver": "0.1",
"statuscode": 200,
"timestamp": "2018-05-03T08:48:05.464359109Z"
}
/admin/user/users/<detail>¶
Methods¶
GET : Get the given detail user info.
PUT : Update the given detail user info.
DELETE : Delete the given detail user info.
Method: GET¶
Get the given detail user info.
Example¶
$ curl -k https://192.168.200.10:8081/v1/admin/user/users/16d1e8ea-1331-4ba7-a371-2c6261e1ce33\?authtoken=986d5648-3905-4def-8479-009b33939273
{
"api_ver": "0.1",
"result": {
"name": "test2",
"password": "test2",
"tm_create": "2018-05-02T13:52:58.303710170Z",
"tm_update": "2018-05-03T03:55:08.886606228Z",
"username": "test2",
"uuid": "16d1e8ea-1331-4ba7-a371-2c6261e1ce33"
},
"statuscode": 200,
"timestamp": "2018-05-03T08:47:13.766737242Z"
}
Method: PUT¶
Update the given detail user info.
Example¶
$ curl -k -X PUT https://192.168.200.10:8081/v1/admin/user/users/4364a7cc-982b-448c-ba18-8a9b0fb3040d\?authtoken=986d5648-3905-4def-8479-009b33939273 -d '{"name": "test3 change"}'
{
"api_ver": "0.1",
"statuscode": 200,
"timestamp": "2018-05-03T08:53:07.924367640Z"
}
/admin/user/contacts¶
/admin/user/contacts/<detail>¶
/admin/user/permissions¶
/admin/user/permissions/<detail>¶
/manager/sdialplans¶
/manager/sdialplans/<detail>¶
Methods¶
GET : Get the given detail static dialplan info.
PUT : Update the given detail static dialplan info.
DELETE : Delete the given detail static dialplan info.
/manager/trunks/<detail>¶
Methods¶
GET : Get the given detail trunk info.
PUT : Update the given detail trunk info.
DELETE : Delete the given detail trunk info.
/manager/users¶
Method: GET¶
Get the all users info.
Example¶
$ curl -k https://192.168.200.10:8081/v1/manager/users?authtoken=06d838a0-71b4-4236-8e93-b7ff59c61502
{
"api_ver": "0.1",
"result": {
"list": [
{
"context": "",
"name": "Test Administrator",
"password": "admin",
"permissions": [
{
"permission": "admin"
},
{
"permission": "user"
}
],
"tm_create": "2018-04-28T05:03:36.560694725Z",
"tm_update": "2018-04-28T07:10:29.116108422Z",
"username": "admin",
"uuid": "ed629979-802b-40f0-9098-b30b2988f9b6"
},
{
"context": "demo",
"name": "test1",
"password": "test1",
"permissions": [
{
"permission": "user"
}
],
"tm_create": "2018-04-29T07:19:00.56688782Z",
"tm_update": null,
"username": "test1",
"uuid": "65abf0b4-9cd5-4bff-8ec9-c03c1aea22d4"
}
]
},
"statuscode": 200,
"timestamp": "2018-05-02T13:24:50.821980931Z"
}
Method: POST¶
Create user info
Example¶
$ curl -k -X POST https://192.168.200.10:8081/v1/manager/users?authtoken=06d838a0-71b4-4236-8e93-b7ff59c61502 -d '{"context": "demo", "name": "test2", "username": "test2", "password": "test2", "permissions": [{"permission": "user"}]}'
{
"api_ver": "0.1",
"statuscode": 200,
"timestamp": "2018-05-02T13:28:31.201418110Z"
}
/manager/users/<detail>¶
Methods¶
GET : Get the given detail user info.
PUT : Update the given detail user info.
DELETE : Delete the given detail user info.
Method: GET¶
Get the given detail user info.
Example¶
$ curl -k https://192.168.200.10:8081/v1/manager/users/3305c47b-fc87-4186-b4ef-30cef0c8f5b2?authtoken=06d838a0-71b4-4236-8e93-b7ff59c61502
{
"api_ver": "0.1",
"result": {
"context": "demo",
"name": "test2",
"password": "test2",
"permissions": [
{
"permission": "user"
}
],
"tm_create": "2018-05-02T13:28:31.101851891Z",
"tm_update": null,
"username": "test2",
"uuid": "3305c47b-fc87-4186-b4ef-30cef0c8f5b2"
},
"statuscode": 200,
"timestamp": "2018-05-02T13:30:52.782019666Z"
}
Method: PUT¶
Update the given detail user info.
Example¶
$ curl -k -X PUT https://192.168.200.10:8081/v1/manager/users/3305c47b-fc87-4186-b4ef-30cef0c8f5b2?authtoken=06d838a0-71b4-4236-8e93-b7ff59c61502 -d '{"context": "demo-test", "name": "test2", "username": "test2", "password": "test2", "permissions": [{"permission": "user"}]}'
{
"api_ver": "0.1",
"statuscode": 200,
"timestamp": "2018-05-02T13:38:39.731423546Z"
}
/me/buddies¶
Method: GET¶
Get the all buddy info.
Example¶
$ curl -k https://localhost:8081/me/buddies\?authtoken=490d3714-348a-4fb4-9748-0e6eef484b33
{
"api_ver": "0.1",
"result": [
{
"detail": null,
"name": null,
"tm_create": "2018-03-28T01:37:52.133197867Z",
"tm_update": null,
"uuid": "611f9902-00c9-4765-9775-20fbaf8261b0",
"uuid_user": "980404a2-f509-4140-9c92-96a018d1b61c"
}
],
"statuscode": 200,
"timestamp": "2018-03-28T01:46:34.598437496Z"
}
/me/contacts¶
Methods¶
GET : Get all contacts info.
Method: GET¶
Get all contacts info.
Example¶
$ curl -k https://localhost:8081/v1/me/contacts\?authtoken=73fe26da-bdcf-4558-afb8-b241deb00aba
{
"api_ver": "0.1",
"result": {
"list": [
{
"detail": "test target detail 4",
"info": {
"id": "199",
"password": "199",
"public_url": "sip:199@192.168.200.10",
"realm": "localhost"
},
"name": "test target",
"target": "199",
"tm_create": "2018-02-13T17:54:12.399972783Z",
"tm_update": "2018-03-28T01:15:50.278779412Z",
"type": "pjsip_endpoint",
"user_uuid": "59e3a7d5-b05f-43cd-abdf-db7009eed6cf",
"uuid": "62a78a12-34ba-4b4f-b9ea-e52e4bac6459"
}
]
},
"statuscode": 200,
"timestamp": "2018-04-12T14:28:30.181544876Z"
}
/me/chats¶
Method: GET¶
Get the all chat info
Example¶
$ curl -k https://localhost:8081/me/chats\?authtoken=17cd592d-2706-44b6-b6e2-1c244b946cf0
{
"api_ver": "0.1",
"result": [
{
"detail": "test chat detail",
"name": "test chat name",
"room": {
"members": [
"59e3a7d5-b05f-43cd-abdf-db7009eed6cf",
"980404a2-f509-4140-9c92-96a018d1b61c"
],
"tm_create": "2018-03-27T06:53:37.432474880Z",
"tm_update": null,
"type": 1,
"uuid": "57b8706a-67e7-4c3a-a070-b164a08562ab",
"uuid_creator": "59e3a7d5-b05f-43cd-abdf-db7009eed6cf",
"uuid_owner": "59e3a7d5-b05f-43cd-abdf-db7009eed6cf"
},
"tm_create": "2018-03-27T06:53:37.496918935Z",
"tm_update": null,
"uuid": "15130428-6f27-456d-b744-6156e3a4b7a8"
}
],
"statuscode": 200,
"timestamp": "2018-03-27T10:44:06.311937832Z"
}
Method: POST¶
Create chat info
Example¶
$ curl -k -X POST https://localhost:8081/me/chats\?authtoken=32644555-58e5-4d03-9608-a66ed1651f12 -d \
'{"name": "test chat name", "detail": "test chat detail", "type": 1, \
"members": ["980404a2-f509-4140-9c92-96a018d1b61c", "59e3a7d5-b05f-43cd-abdf-db7009eed6cf"]}'
{"api_ver": "0.1", "timestamp": "2018-03-26T16:10:54.451912673Z", "statuscode": 200}
/me/chats/<detail>¶
Methods¶
GET : Get the given detail chat info.
PUT : Update the given detail chat info.
DELETE : Delete the given detail chat info.
Method: GET¶
Get the given detail chat info.
Example¶
$ curl -k https://localhost:8081/me/chats/15130428-6f27-456d-b744-6156e3a4b7a8\?authtoken=17cd592d-2706-44b6-b6e2-1c244b946cf0
{
"api_ver": "0.1",
"result": {
"detail": "test chat detail",
"name": "test chat name",
"room": {
"members": [
"59e3a7d5-b05f-43cd-abdf-db7009eed6cf",
"980404a2-f509-4140-9c92-96a018d1b61c"
],
"tm_create": "2018-03-27T06:53:37.432474880Z",
"tm_update": null,
"type": 1,
"uuid": "57b8706a-67e7-4c3a-a070-b164a08562ab",
"uuid_creator": "59e3a7d5-b05f-43cd-abdf-db7009eed6cf",
"uuid_owner": "59e3a7d5-b05f-43cd-abdf-db7009eed6cf"
},
"tm_create": "2018-03-27T06:53:37.496918935Z",
"tm_update": null,
"uuid": "15130428-6f27-456d-b744-6156e3a4b7a8"
},
"statuscode": 200,
"timestamp": "2018-03-27T10:39:34.496808298Z"
}
Method: PUT¶
Update the given detail chat info.
Example¶
$ curl -k -X PUT https://localhost:8081/me/chats/7c817566-3c4a-4d97-b4f0-e29b2d2e1564\?authtoken=d2718890-043f-43c8-9bf9-79c2602d2c81 -d '{"name": "update test chat name"}'
{
"api_ver": "0.1",
"statuscode": 200,
"timestamp": "2018-03-26T07:27:03.713679335Z"
}
Method: DELETE¶
Delete the given detail chat info.
Example¶
- ::
$ curl -k -X DELETE https://localhost:8081/me/chats/7c817566-3c4a-4d97-b4f0-e29b2d2e1564?authtoken=d2718890-043f-43c8-9bf9-79c2602d2c81
- {
- “api_ver”: “0.1”, “statuscode”: 200, “timestamp”: “2018-03-26T07:28:19.397554581Z”
}
/me/chats/<detail>/messages¶
Method: GET¶
Get chat message
Call¶
GET /me/chats/<detail>/messages?authtoken=<string>[×tamp=<string>&count=<number>]
Method parameters
detail
: chat uuid.timestamp
: Uri encoded UTC timestamp.count
: number of message
Example¶
$ curl -k https://localhost:8081/me/chats/15130428-6f27-456d-b744-6156e3a4b7a8/messages\?authtoken=17cd592d-2706-44b6-b6e2-1c244b946cf0\×tamp=2018-03-30T08%3A30%3A02.364443446Z\&count=2
{
"api_ver": "0.1",
"result": [
{
"message": {
"message": "test message"
},
"tm_create": "2018-03-27T10:26:14.452323600Z",
"uuid": "1800fcee-1077-47f0-9d7c-3c7cde768e93",
"uuid_owner": "59e3a7d5-b05f-43cd-abdf-db7009eed6cf"
},
{
"message": {
"message": "test message"
},
"tm_create": "2018-03-27T08:30:50.225964433Z",
"uuid": "eb251f63-8ed1-4a00-b757-20a88caa8a20",
"uuid_owner": "59e3a7d5-b05f-43cd-abdf-db7009eed6cf"
}
],
"statuscode": 200,
"timestamp": "2018-03-27T10:36:04.543077586Z"
}
/me/info¶
Methods¶
GET : Get me info.
Method: GET¶
Get me info.
Example¶
$ curl -k https://localhost:8081/me/info\?authtoken=88fa51b6-e980-4e57-93cb-7cdefd21b2a1
{
"api_ver": "0.1",
"result": {
"chats": [
{
"detail": "test chat detail",
"name": "test chat name",
"room": {
"members": [
"59e3a7d5-b05f-43cd-abdf-db7009eed6cf",
"980404a2-f509-4140-9c92-96a018d1b61c"
],
"tm_create": "2018-03-27T06:53:37.432474880Z",
"tm_update": null,
"type": 1,
"uuid": "57b8706a-67e7-4c3a-a070-b164a08562ab",
"uuid_creator": "59e3a7d5-b05f-43cd-abdf-db7009eed6cf",
"uuid_owner": "59e3a7d5-b05f-43cd-abdf-db7009eed6cf"
},
"tm_create": "2018-03-27T06:53:37.496918935Z",
"tm_update": null,
"uuid": "15130428-6f27-456d-b744-6156e3a4b7a8"
}
],
"contacts": [
{
"detail": "test target detail 4",
"info": {
"id": "199",
"password": "199",
"public_url": "sip:199@192.168.200.10",
"realm": "localhost"
},
"name": "test target",
"target": "199",
"tm_create": "2018-02-13T17:54:12.399972783Z",
"tm_update": "2018-03-27T20:24:51.355343689Z",
"type": "pjsip_endpoint",
"user_uuid": "59e3a7d5-b05f-43cd-abdf-db7009eed6cf",
"uuid": "62a78a12-34ba-4b4f-b9ea-e52e4bac6459"
}
],
"name": "teset admin",
"tm_create": "2018-02-13T17:42:16.453145450Z",
"tm_update": "2018-03-27T08:30:03.254978318Z",
"username": "admin",
"uuid": "59e3a7d5-b05f-43cd-abdf-db7009eed6cf"
},
"statuscode": 200,
"timestamp": "2018-03-27T20:25:32.526413444Z"
}
/me/search¶
Methods¶
GET : Get searched info.
Method: GET¶
Get searched info
Example¶
$ curl -k https://localhost:8081/v1/me/search\?filter=test\&type=username\&authtoken=8eaa8d32-b58d-494a-a323-c0535b6f66d5
{
"api_ver": "0.1",
"result": {
"list": [
{
"name": "test name",
"username": "test",
"uuid": "980404a2-f509-4140-9c92-96a018d1b61c"
}
]
},
"statuscode": 200,
"timestamp": "2018-04-12T06:42:15.741891135Z"
}