Query Extension List
Query basic information of PBX extension, such as extension number, extension status, extension type, extension name, etc.
Request URL
GET {base_url}/{api_path}/extension/list?access_token={access_token}
Request parameters
| Parameter | Required | Type | Description |
|---|---|---|---|
| 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:
|
| order_by | No | String | Define the display order. 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.
|
| total_number | Integer | The total number of extensions. |
| data | Array<Ext_Basicinfo> | The basic information of the extension. |
- Ext_Basicinfo
-
Parameter Type Description id Integer Extension ID. online_status Object<Online_Status> Extension Online Status on the following endpoints. sip_phone: SIP endpoint.linkus_desktop: Linkus Desktop Client.linkus_mobile: Linkus Mobile Client.linkus_web: Linkus Web Client.
presence_status String Default extension presence. available: Available.away: Away.business_trip: Business Trip.do_not_disturb: Do Not Disturb (DND).lunch: Lunch Break.off_work: Off Work.
custom_presence_status String Custom extension presence. number String Extension Number. caller_id_name String Caller ID Name. role_name String User Role. email_addr String Email Address. mobile_number String Mobile Number. - Online_Status
-
Parameter Type Description status Integer The extension online status on the endpoint (expect for SIP endpoint). Note: The extension online status on SIP endpoint is returned in thestatus_listparameter.0: Offline.1: Online.
ext_dev_type String The type of online devices. sip: SIP endpoint.linkusdesktop: Linkus Desktop Client.linkusmobile: Linkus Mobile Client.linkusweb: Linkus Web Client.
status_list Array<Status_List> The extension online status on SIP endpoint. Note: This parameter is only returned when the extension is registered on an SIP endpoint. - Status_List
-
Parameter Type Description status Integer The extension online status on the SIP endpoint. 0: Offline.1: Online.
ip String The IP address and SIP port of the SIP endpoint. For example,
192.168.28.190:5060.linkus_dev_type String The type of online Linkus Mobile Client and Linkus Pad Client (SDK). ios: Linkus Mobile Client for iOS.android: Linkus Mobile Client for Android.ipad: Linkus Pad Client (SDK) for iOS.pad: Linkus Pad Client (SDK) for Android.
Examples
Request example
GET /openapi/v1.0/extension/list?page=1&page_size=4&sort_by=number&order_by=asc&access_token=IqJch3aPGM68rpf3D3C10Mf2t7BiYeSo
Host: yeastardocs.example.yeastarcloud.com
Response example
HTTP/1.1 200 OK { "errcode": 0, "errmsg": "SUCCESS", "total_number": 12, "data": [ { "id": 238, "online_status": { "sip_phone": { "status": 0, "ext_dev_type": "sip", //Extension 2000 is registered on a SIP device. "status_list": [ { "status": 1, //Extension online status on the SIP device "ip": "192.168.28.190:5060" //IP address and SIP port of the SIP device } ] }, "linkus_desktop": { "status": 0 }, "linkus_mobile": { "status": 0 }, "linkus_web": { "status": 0 } }, "presence_status": "available", "number": "2000", "caller_id_name": "Leo Ball", "role_name": "Administrator", "email_addr": "leo@sample.com", "custom_presence_status": "lunch" }, { "id": 223, "online_status": { "sip_phone": { "status": 0 }, "linkus_desktop": { //Extension 2001 is logged in to Linkus Desktop Client. "status": 1, "ext_dev_type": "linkusdesktop" }, "linkus_mobile": { "status": 0 }, "linkus_web": { "status": 0 } }, "presence_status": "away", "number": "2001", "caller_id_name": "Phillip Huff", "role_name": "Administrator", "email_addr": "philip@sample.com", "custom_presence_status": "Available (Work)" }, { "id": 227, "online_status": { "sip_phone": { "status": 0, "ext_dev_type": "sip" }, "linkus_desktop": { "status": 0 }, "linkus_mobile": { //Extension 2002 is logged in to Linkus Mobile Client. "status": 1, "ext_dev_type": "linkusmobile", "status_list": [ { "status": 1, "ip": "112.48.22.71", "linkus_dev_type": "android" } ] }, "linkus_web": { "status": 0, "ext_dev_type": "linkusweb" } }, "presence_status": "business_trip", "number": "2002", "caller_id_name": "Terrell Smith", "role_name": "Administrator", "email_addr": "terrell@sample.com", "mobile_number": "15880123456", "custom_presence_status": "Business Trip" }, { "id": 229, "online_status": { "sip_phone": { "status": 0, "ext_dev_type": "sip" }, "linkus_desktop": { "status": 0 }, "linkus_mobile": { "status": 0 }, "linkus_web": { //Extension 2003 is logged in to Linkus Web Client. "status": 1, "ext_dev_type": "linkusweb" } }, "presence_status": "do_not_disturb", "number": "2003", "caller_id_name": "Dave Haris", "email_addr": "dave@sample.com", "mobile_number": "13600930000", "custom_presence_status": "Do Not Disturb" } ] }