Query Emergency Number List
Retrieve a list of emergency numbers.
Request URL
GET {base_url}/{api_path}/emergency_number/list?access_token={access_token}
Request parameters
| Parameter | Required | Type | Description |
|---|---|---|---|
| order_by | No | String | Define the display order. Valid value:
|
| page | No | Integer | Define which page is displayed. |
| page_size | No | Integer | Define how many records per page. |
| sort_by | No | String | Define the sorting field. Valid value:
|
Response parameters
| Parameter | Type | Description |
|---|---|---|
| errcode | Integer | Returned error code.
Note: You can check the error code and
error message in Error Code and Error Message.
|
| errmsg | String | Returned message.
|
| data | Array<Emergency> | The list of emergency numbers on the current page. |
| total_number | Integer | The total number of emergency numbers. |
- Emergency
-
Parameter Type Description id Integer The unique ID of the emergency number. name String The name of the emergency number. Maximum length: 63 characters. number String The emergency number. Maximum length: 31 characters. The number must be unique globally. outb_cid_option String The priority of the outbound caller ID. emergency_first: The caller ID of the emergency number takes precedence.ext_first: The caller ID of the extension takes precedence.
trunks Array<Emergency_Trunk> The trunk configurations of the emergency number, with at least one entry. member_select String The extension scope of the emergency number. sel_all_ext: All extensions.sel_specific: Specified extensions.
- Emergency_Trunk
-
Parameter Type Description trunk_id Integer The unique ID of a trunk. Note: You can query trunk's ID using the Query Trunk List interface.outb_cid String The caller ID displayed for calls routed through this trunk. Maximum length: 31 characters. prepend String The digits prepended to the dialed number. strip Integer The number of digits to strip from the dialed number. The value 0 means no stripping. Valid values: 0 to 16. exts Array<Emergency_Ext> The scope entries where this trunk takes effect. Note: This field is required when member_select is sel_specific.
- Emergency_Ext
-
Parameter Type Description type String The type of the scope entry. extension: The entry applies to an extension (value is the extension number).ext_group: The entry applies to an extension group (value is the extension group ID).all: The entry applies to all extensions (value is ignored).
value String The identifier of the scope entry: the extension number when type is extension, the extension group ID when type is ext_group, and ignored when type is all.
Example
Request example
GET /openapi/v1.0/emergency_number/list?page=1&page_size=2&access_token=lweYFZuwsgSrhFOKC3Z0XmDRXfbPohi6 HTTP/1.1
Host: yeastardocs.example.yeastarcloud.com
Response example
HTTP/1.1 200 OK
{
"errcode": 0,
"errmsg": "SUCCESS",
"total_number": 2,
"data": [
{
"id": 1,
"name": "111",
"number": "111",
"outb_cid_option": "emergency_first",
"trunks": [
{
"trunk_id": 14,
"outb_cid": "",
"prepend": "",
"strip": 0,
"exts": [
{
"value": "1001",
"type": "extension"
}
]
}
],
"member_select": "sel_specific"
},
{
"id": 2,
"name": "API Test Emergency Edited",
"number": "9110",
"outb_cid_option": "ext_first",
"trunks": [
{
"trunk_id": 14,
"outb_cid": "5500123",
"prepend": "9",
"strip": 0,
"exts": [
{
"value": "",
"type": "all"
}
]
}
],
"member_select": "sel_specific"
}
]
}