To access the User API documentation, navigate to Support -> API (User) section.
dls communications offers a comprehensive Admin API, enabling programmatic access to a wide array of resources within the PBX system. This API facilitates the development of customized solutions for the DLS Hosted PBX, offering deep integration and substantial benefits. It supports operations such as querying, adding, updating, and deleting various PBX resources, including users, groups, call routing configurations, contacts, and more.
For authentication, every Admin API request must include two POST parameters: api_user and api_key. The api_user parameter identifies the user by their extension, auth ID, or the format ‘extension@tenant-name’, while the api_key parameter is obtained from Users – Preferences within the PBX system. To enhance security, all specific action parameters must be sent via POST, except for the api_action parameter and the optional api_format parameter, which can be specified using GET.
We continuously work on expanding the Admin API’s capabilities, planning to introduce more functionalities in future updates. If you require an API method that is not currently documented, we encourage you to reach out to dls communications. This way, you can request further information or suggest new features to be added.
The API supports responses in various formats, including JSON (the default format), XML, YAML, CSV, and plain text. You can specify your preferred response format in two ways:
https://demo.pbx.dls.net/api/v1/example.php?api_action=test&api_format=jsonhttps://demo.pbx.dls.net/api/v1/example.php?api_action=test&api_format=xmlhttps://demo.pbx.dls.net/api/v1/example.php?api_action=test&api_format=yamlhttps://demo.pbx.dls.net/api/v1/example.php?api_action=test&api_format=csvhttps://demo.pbx.dls.net/api/v1/example.php?api_action=test&api_format=plainAccept: application/jsonAccept: application/xmlAccept: application/x-yamlAccept: text/csvAccept: text/plainResponses will be formatted according to the specified response format:
JSON Response Example
{ "result": "success", "example_data": "" }{ "result": "error", "error": "Error details here" }XML Response Example
<response><result>success</result><example_data>...</example_data></response><response><result>error</result><error>Error details here</error></response>YAML Response Example
---
result: "success"
example_data: ""
---
result: "error"
error: "Error details here"
CSV Response Example
result,success
error,
example,result,1
example,result,2
Plain Text Response Example
42
-1
Access to managing the predictive dialer campaigns, scripts, contact lists and contacts is made available by the DLS Hosted PBX API. The following methods are currently available to manage the predictive dialer module:
The Reporting API offers access to Call Detail Record (CDR) data, enabling users to generate customized reports by selecting specific informational columns and applying various filters.
The reporting API provides access to Call Detail Record (CDR) data. Individual informational columns can be chosen and inclusive and exclusive filter groups can be specified. URL: https://demo.pbx.dls.net/api/v1/reports.php?api_action=report
api_action: Must be “report”.
report_type: The type of report to generate. Currently only a detailed report table is supported, so “detail_table” must be specified.
columns[]: One or more columns to display. Can be specified multiple times in array notation or can be provided as a single comma-delimited list.
Filters: Filters provide the ability to restrict the result set based on certain specified criteria. The flexibility of filters allows the format in which they are defined to vary based on the type of filter. As a result, understanding filtering can allow you to retrieve results more tailored to your needs.
Filter group: Zero or more filter groups can be defined that perform logical AND, OR, inclusive, and exclusive operations based on the filter rules within them.
Types of filters:
JSON Example:
“filter_groups”: [
{
“exclusivity”: “include”, //This could also be ‘exclude’
“logical_operator”: “and”, //This could also be ‘or’
“rules”: [
{
“type”: “duration”, //Require that the call was a certain duration
“operator”: “between”, //Specify that we’re providing a range for the duration
“lower_value”: 30, //Require a duration of at least 30 seconds
“upper_value”: 60, //Require a duration of at most 60 seconds
},
{
“type”: “bridged”, //Make sure the call connected to another peer
},
],
},
],options[]: One or more options that manipulate how the report executes and the format of data it returns. It can be specified multiple times in array notation or can be provided as a single comma-delimited list. Each option should be specified in the format: key=value
Success format:
JSON:
{
“result”: “success”,
“error”: “”,
“total_results”: 3,
“title”: “Restrict inclusive by date range ‘Mon, Oct 1, 2016 12:39 pm’ to ‘Mon, Oct 28, 2016 12:39 pm’ - America/Chicago UTC-5:00 (DST)”,
“columns”: [
“unique_id”,
“date”,
“callerid”,
“billable_duration”,
“src_label”,
“dst_label”,
],
“results”: [
[
“1476370446.2”,
“2016-10-13 09:54:06”,
“\“Example User 1\” <123>”,
“85”,
“123@default - Example User 1”,
“321@default - Example User 2”
],
[
“1476370384.0”,
“2016-10-13 09:53:04”,
“\“dls communications\” <8478544799>”,
“41”,
“(847) 854-4799”,
“123@default - Example User 1”
],
[
“1476370358.2”,
“2016-10-13 09:52:38”,
“\“John\” <8881234567>”,
“26”,
“(888) 123-4567”,
“321@default - Example User 2”
],
],
}Access to provide real-time statistics for calls, users, queues, faxes, conferences, device provisioning, and predictive dialer within the system. It offers a snapshot of the current activity, allowing users to monitor and analyze key metrics for effective management and optimization of communication resources.
Get Users: URL: https://demo.pbx.dls.net/api/v1/status.php?api_action=users&api_format=json
Request formats:
JSON:
{
“api_user”:“100@default”,
“api_key”:“XXXXXXXXX-XXXXXXXXXXXXXX-XXXXXXXXX”
}XML:
<?xml version=“1.0” standalone=“yes”?>
<request>
<api_user>100@default</api_user>
<api_key>XXXXXXXXX-XXXXXXXXXXXXXX-XXXXXXXXX</api_key>
</request>Success formats:
JSON:
{
"result": "success",
"users": [
{
"ext": "630",
"user": "Tom",
"tenant": "default",
"authid": "beaucrn6",
"vmail": "6/6",
"status": "OK (3 ms)",
"host": "209.242.9.134",
"port": “12447”
},
{
"ext": "69",
"user": "Jerry",
"tenant": "default",
"authid": "cpirg16m",
"vmail": "0/0",
"status": "Unmonitored",
"host": "N/A",
"port": “0”
}
]
}
XML:
<response>
<result>success</result>
<users>
<array>
<ext>630</ext>
<user>Tom</user>
<tenant>default</tenant>
<authid>beaucrn6</authid>
<vmail>6/6</vmail>
<status>OK (3 ms)</status>
<host>209.242.9.134</host>
<port>12447</port>
</array>
<array>
<ext>69</ext>
<user>Jerry</user>
<tenant>default</tenant>
<authid>cpirg16m</authid>
<vmail>0/0</vmail>
<status>Unmonitored</status>
<host>N/A</host>
<port>0</port>
</array>
</users>
</response>Get Queues URL: https://demo.pbx.dls.net/api/v1/status.php?api_action=queues&api_format=json
Request formats:
JSON:
{
“api_user”:“100@default”,
“api_key”:“XXXXXXXXX-XXXXXXXXXXXXXX-XXXXXXXXX”,
}XML:
<?xml version=“1.0” standalone=“yes” ?>
<request>
<api_user>100@default</api_user>
<api_key>XXXXXXXXX-XXXXXXXXXXXXXX-XXXXXXXXX</api_key>
</request>Success formats:
JSON:
{
“result”: “success”,
“queues”: {
“support_queue”: {
“queue”: “support_queue”,
“holdtime”: “4s”,
“waiting”: “0”,
“complete”: “6”,
“lost”: “1”,
“hunt”: “ringall”,
“agents”: {
“beaucrn6”: {
“name”: “Tom”,
“tenant”: “default”,
“tid”: “0”,
“avail”: “1”,
“callcount”: “6”,
“lastcall”: “30 secs ago”,
“status”: “Not in use”,
“otherdata”: " (ringinuse disabled) (dynamic)",
“penalty”: “0”,
“paused”: “0”
“connected_to”: “XXXXXXXXXX”
}
}
“calls_waiting”:
[
{
“number”: “XXXXXXXXXX”,
“priority”: “1”,
“wait_time”: “0:04”
}
]
},
“testqueue”: {
“queue”: “testqueue”,
“holdtime”: “0s”,
“waiting”: “0”,
“complete”: “0”,
“lost”: “0”,
“hunt”: “ringall”,
“agents”: []
},
}
}XML
<response>
<result>success</result>
<queues>
<support_queue>
<queue>support_queue</queue>
<holdtime>4s</holdtime>
<waiting>0</waiting>
<complete>6</complete>
<lost>1</lost>
<hunt>ringall</hunt>
<agents>
<beaucrn6>
<name>Tom</name>
<tenant>default</tenant>
<tid>0</tid>
<avail>1</avail>
<callcount>6</callcount>
<lastcall>94351 secs ago</lastcall>
<status>Not in use</status>
<otherdata> (ringinuse disabled) (dynamic)</otherdata>
<penalty>0</penalty>
<paused>0</paused>
<connected_to>XXXXXXXXXX</connected_to>
</beaucrn6>
</agents>
<calls_waiting>
<array>
<number>8153556261</number>
<priority>1</priority>
<wait_time>1:17</wait_time>
</array>
</calls_waiting>
</support_queue>
<testqueue>
<queue>testqueue</queue>
<holdtime>0s</holdtime>
<waiting>0</waiting>
<complete>0</complete>
<lost>0</lost>
<hunt>ringall</hunt>
<agents></agents>
</testqueue>
</queues>
</response>Get Calls
URL: https://demo.pbx.dls.net/api/v1/status.php?api_action=calls&api_format=json
Request formats:
JSON:
{
“api_user”:“100@default”,
“api_key”:“XXXXXXXXX-XXXXXXXXXXXXXX-XXXXXXXXX”,
}XML:
<?xml version=“1.0” standalone=“yes” ?>
<request>
<api_user>100@default</api_user>
<api_key>XXXXXXXXX-XXXXXXXXXXXXXX-XXXXXXXXX</api_key>
</request>Success formats:
JSON:
{
“result”: “success”,
“calls”: {
“inbound”: [
{
“callerid”: “1234567890”,
“connected_to”: “Queue:support_queue”,
“status”: “Connected”,
“elapsed”: “0h4m3s”
}
],
“outbound”: [
{
“ext”: “985@default-Jerma”,
“callerid”: “+1234567890”,
“connected_to”: “1023456789”,
“status”: “Connected”,
“elapsed”: “0h1m20s”
}
],
“internal”: [
{
“ext”: “985@default-Jerry”,
“connected_to”: “630@default-Tom”,
“status”: “Ringing”,
“elapsed”: “0h0m4s”
}
]
}
}XML
<response>
<result>success</result>
<calls>
<inbound>
<callerid>1234567890</callerid>
<connected_to>Queue:support_queue</connected_to>
<status>Connected</status>
<elapsed>0h4m3s</elapsed>
</inbound>
<outbound>
<ext>985@default-Jerma</ext>
<callerid>+1234567890</callerid>
<connected_to>1023456789</connected_to>
<status>Connected</status>
<elapsed>0h1m20s</elapsed>
</outbound>
<internal>
<ext>985@default-Jerry</ext>
<connected_to>630@default-Tom</connected_to>
<status>Ringing</status>
<elapsed>0h0m4s</elapsed>
</internal>
</calls>
</response>
Get Faxes
URL: https://demo.pbx.dls.net/api/v1/status.php?api_action=faxes&api_format=json
Request formats:
JSON:
{
“api_user”:“100@default”,
“api_key”:“XXXXXXXXX-XXXXXXXXXXXXXX-XXXXXXXXX”,
}XML:
<?xml version=“1.0” standalone=“yes” ?>
<request>
<api_user>100@default</api_user>
<api_key>XXXXXXXXX-XXXXXXXXXXXXXX-XXXXXXXXX</api_key>
</request>Success formats:
JSON:
{
“result”: “success”,
“faxes”: {
“queued_faxes”: [
{
“to”: “7735966400”,
“from”: “beaucrn6”,
“page”: “N/A”,
“status”: “Queued”,
“attempt”: “2/5”,
“next_retry”: “1 minute(s)”
},
{
“to”: “8474743126”,
“from”: “beaucrn6”,
“page”: “1/0”,
“status”: “Processing”,
“attempt”: “1/5”,
“next_retry”: “Now”
}
],
“fax_stats”: {
“current_sessions”: “1”,
“reserved_sessions”: “0”,
“transmit_attempts”: “11”,
“receive_attempts”: “6”,
“completed_faxes”: “15”,
“failed_faxes”: “7”,
“success”: “8”,
“switched_to_t.38”: “0”,
“call_dropped”: “2”,
“no_fax”: “0”,
“negotiation_failed”: “0”,
“train_failure”: “0”,
“retries_exceeded”: “0”,
“protocol_error”: “0”,
“tx_protocol_error”: “0”,
“rx_protocol_error”: “0”,
“file_error”: “0”,
“memory_error”: “0”,
“unknown_error”: “0”
}
}
}XML
<response>
<result>success</result>
<faxes>
<queued_faxes>
<array>
<to>8474743126</to>
<from>beaucrn6</from>
<page>N/A</page>
<status>Queued</status>
<attempt>5/5</attempt>
<next_retry>1 minute(s)</next_retry>
</array>
</queued_faxes>
<fax_stats>
<current_sessions>0</current_sessions>
<reserved_sessions>0</reserved_sessions>
<transmit_attempts>18</transmit_attempts>
<receive_attempts>6</receive_attempts>
<completed_faxes>19</completed_faxes>
<failed_faxes>11</failed_faxes>
<success>8</success>
<switched_to_t.38>0</switched_to_t.38>
<call_dropped>2</call_dropped>
<no_fax>0</no_fax>
<negotiation_failed>0</negotiation_failed>
<train_failure>0</train_failure>
<retries_exceeded>0</retries_exceeded>
<protocol_error>0</protocol_error>
<tx_protocol_error>0</tx_protocol_error>
<rx_protocol_error>0</rx_protocol_error>
<file_error>0</file_error>
<memory_error>0</memory_error>
<unknown_error>0</unknown_error>
</fax_stats>
</faxes>
</response>
Get Conferences
URL: https://demo.pbx.dls.net/api/v1/status.php?api_action=conferences&api_format=json
Request formats:
JSON:
{
“api_user”:“100@default”,
“api_key”:“XXXXXXXXX-XXXXXXXXXXXXXX-XXXXXXXXX”,
}XML:
<?xml version=“1.0” standalone=“yes” ?>
<request>
<api_user>100@default</api_user>
<api_key>XXXXXXXXX-XXXXXXXXXXXXXX-XXXXXXXXX</api_key>
</request>Success formats:
JSON:
{
“result”: “success”,
“conferences”: [
{
“conference_number”: “2000”,
“users”: “1”,
“admins”: “0”,
“locked”: “Unlocked”
}
]
}XML:
<response>
<result>success</result>
<conferences>
<array>
<conference_number>2000</conference_number>
<users>1</users>
<admins>0</admins>
<locked>Unlocked</locked>
</array>
</conferences>
</response>Get Provisioning
URL: https://demo.pbx.dls.net/api/v1/status.php?api_action=provisioning&api_format=json
Request formats:
JSON:
{
“api_user”:“100@default”,
“api_key”:“XXXXXXXXX-XXXXXXXXXXXXXX-XXXXXXXXX”,
}XML:
<?xml version=“1.0” standalone=“yes” ?>
<request>
<api_user>100@default</api_user>
<api_key>XXXXXXXXX-XXXXXXXXXXXXXX-XXXXXXXXX</api_key>
</request>Success formats:
JSON:
{
“result”: “success”,
“provisioning”: [
{
“ext”: “630@default”,
“mac_address”: “24:9a:d8:02:f4:4e”,
“device”: “Yealink W70P”,
“last_provisioned”: “2024-01-30 13:42:56”,
“provisioned”: “Yes”,
“last_provision_delta”: “00:59:07”,
“calls_in”: “0”,
“calls_out”: “0”,
“file_name”: “249ad802f44e.cfg”
},
{
“ext”: “635@default”,
“mac_address”: “00:04:f2:cc:2c:46”,
“device”: “Polycom VVX400”,
“last_provisioned”: “2024-01-24 11:59:55”,
“provisioned”: “Yes”,
“last_provision_delta”: “146:42:08”,
“calls_in”: “0”,
“calls_out”: “0”,
“file_name”: “0004f2cc2c46-provision.cfg”
},
{
“ext”: “985@default”,
“mac_address”: “00:15:65:4d:f1:b7”,
“device”: “Yealink SIP-T32G”,
“last_provisioned”: “2024-01-12 12:00:26”,
“provisioned”: “No”,
“last_provision_delta”: “Over a week ago”,
“calls_in”: “0”,
“calls_out”: “0”,
“file_name”: “0015654df1b7.cfg”
}
]
}XML:
<response>
<result>success</result>
<provisioning>
<array>
<ext>630@default</ext>
<mac_address>24:9a:d8:02:f4:4e</mac_address>
<device>Yealink W70P</device>
<last_provisioned>2024-02-01 13:45:38</last_provisioned>
<provisioned>Yes</provisioned>
<last_provision_delta>00:46:28</last_provision_delta>
<calls_in>0</calls_in>
<calls_out>0</calls_out>
<file_name>249ad802f44e.cfg</file_name>
</array>
<array>
<ext>635@default</ext>
<mac_address>00:04:f2:cc:2c:46</mac_address>
<device>Polycom VVX400</device>
<last_provisioned>2024-01-24 11:59:55</last_provisioned>
<provisioned>Yes</provisioned>
<last_provision_delta>Over a week ago</last_provision_delta>
<calls_in>0</calls_in>
<calls_out>0</calls_out>
<file_name>0004f2cc2c46-provision.cfg</file_name>
</array>
<array>
<ext>985@default</ext>
<mac_address>00:15:65:4d:f1:b7</mac_address>
<device>Yealink SIP-T32G</device>
<last_provisioned>2024-01-12 12:00:26</last_provisioned>
<provisioned>No</provisioned>
<last_provision_delta>Over a week ago</last_provision_delta>
<calls_in>0</calls_in>
<calls_out>0</calls_out>
<file_name>0015654df1b7.cfg</file_name>
</array>
</provisioning>
</response>
Get Predictive Dialer Stats
URL: https://demo.pbx.dls.net/api/v1/status.php?api_action=dialer&api_format=json
Request formats:
JSON:
{
“api_user”:“100@default”,
“api_key”:“XXXXXXXXX-XXXXXXXXXXXXXX-XXXXXXXXX”,
}XML:
<?xml version=“1.0” standalone=“yes” ?>
<request>
<api_user>100@default</api_user>
<api_key>XXXXXXXXX-XXXXXXXXXXXXXX-XXXXXXXXX</api_key>
</request>Success formats:
JSON:
{
“result”: “success”,
“dialer”: [
{
“id”: “1”,
“name”: “My Campaign”,
“type”: “blaster”,
“max_attempts”: “1”,
“caller_id”: “3”,
“call_ratio”: “1.00”,
“agent_queue_id”: “”,
“script_id”: “”,
“context_id”: “1”,
“rule_id”: “27”,
“step_id”: “39”,
“min_callback_time”: “2”,
“machine_context_id”: “44”,
“machine_rule_id”: “20”,
“machine_step_id”: “28”,
“display_contacts_form”: “1”,
“hangup_on_disposition”: “1”,
“hide_number_in_caller_id”: “0”,
“status”: “Stopped”
},
]
}XML:
<response>
<result>success</result>
<dialer>
<array>
<id>1</id>
<name>new camp</name>
<type>blaster</type>
<max_attempts>1</max_attempts>
<caller_id>3</caller_id>
<call_ratio>1.00</call_ratio>
<agent_queue_id></agent_queue_id>
<script_id></script_id>
<context_id>1</context_id>
<rule_id>27</rule_id>
<step_id>39</step_id>
<min_callback_time>2</min_callback_time>
<machine_context_id>44</machine_context_id>
<machine_rule_id>20</machine_rule_id>
<machine_step_id>28</machine_step_id>
<display_contacts_form>1</display_contacts_form>
<hangup_on_disposition>1</hangup_on_disposition>
<hide_number_in_caller_id>0</hide_number_in_caller_id>
<status>Stopped</status>
</array>
</calls>
</response>Get Predictive Dialer Logs URL: https://demo.pbx.dls.net/api/v1/status.php?api_action=dialerlogs&api_format=json
Request formats:
JSON:
{
“api_user”:“100@default”,
“api_key”:“XXXXXXXXX-XXXXXXXXXXXXXX-XXXXXXXXX”,
}XML:
<?xml version=“1.0” standalone=“yes” ?>
<request>
<api_user>100@default</api_user>
<api_key>XXXXXXXXX-XXXXXXXXXXXXXX-XXXXXXXXX</api_key>
</request>Success formats:
JSON:
{
“result”: “success”,
“logs”: [
{
“campaign”: “My Campaign”,
“output”: [
“[Dec 29 17:32:12] STATUS: Ready for dialing”,
“[Dec 29 17:32:12] DEBUG: Reset dispositions for contact list 8”,
“[Dec 29 17:32:12] DEBUG: Pulling a contact to dial”,
“[Dec 29 17:32:12] DEBUG: Created call file /var/spool/asterisk/outgoing/pdialer_pd-12-8-3”,
“[Dec 29 17:32:12] INFO: Placing call to pd-12-8-3 at 8153556261”,
“[Dec 29 17:32:14] DEBUG: Checking failed calls”,
“[Dec 29 17:32:16] DEBUG: Checking failed calls”,
“[Dec 29 17:32:17] DEBUG: Checking completed calls”
]
},
]
}XML:
<response>
<result>success</result>
<logs>
<array>
<campaign>My Campaign</campaign>
<output>
<value>[Dec 29 17:32:12] STATUS: Ready for dialing</value>
<value>[Dec 29 17:32:12] DEBUG: Reset dispositions for contact list 8</value>
<value>[Dec 29 17:32:12] DEBUG: Pulling a contact to dial</value>
<value>[Dec 29 17:32:12] DEBUG: Created call file /var/spool/asterisk/outgoing/pdialer_pd-12-8-3</value>
<value>[Dec 29 17:32:12] INFO: Placing call to pd-12-8-3 at 8153556261</value>
<value>[Dec 29 17:32:14] DEBUG: Checking failed calls</value>
<value>[Dec 29 17:32:16] DEBUG: Checking failed calls</value>
<value>[Dec 29 17:32:17] DEBUG: Checking completed calls</value>
</output>
</array>
</calls>
</response>Access to SMS is provided by sending a specified phone number(s) or extension(s) or querying SMS from the SMS record table. SMS is limited to 200 characters. The following methods are currently available to send and query SMS via the API:
Send SMS:
URL: https://demo.pbx.dls.net/api/v1/sms.php?api_action=send_sms&api_format=json
Request formats:
JSON:
{
“api_user”:“100@default”,
“api_key”:“XXXXXXXXX-XXXXXXXXXXXXXX-XXXXXXXXX”,
“dst”:“100,2223334444”,
“account_code”:“505”,
“body”:“This is a successful message.”
}
{
“api_user”:“100@default”,
“api_key”:“XXXXXXXXX-XXXXXXXXXXXXXX-XXXXXXXXX”,
“dst”:[
“100”,
“200”
],
“account_code”:“505”,
“body”:“This is a successful message.”
}XML:
<?xml version=“1.0” standalone=“yes”?>
<request>
<api_user>100@default</api_user>
<api_key>XXXXXXXXX-XXXXXXXXXXXXXX-XXXXXXXXX</api_key>
<dst>100</dst>
<dst>200</dst>
<account_code>505</account_code>
<body>This is a successful message.</body>
</request>
<?xml version=“1.0” standalone=“yes”?>
<request>
<api_user>100@default</api_user>
<api_key>XXXXXXXXX-XXXXXXXXXXXXXX-XXXXXXXXX</api_key>
<dst>100,100</dst>
<account_code>505</account_code>
<body>This is a successful message.</body>
</request>Success formats:
JSON:
{
“result”:“success”,
“src”:“100”,
“dst”:[
“100”,"+2223334444"
],
“body”:“This is a successful message.”,
“account_code”:“505”,
“message_id”: “1525443917.5aec6d4dd217b”
}XML:
<response>
<result>success</result>
<src>N</src>
<dst>
<value>X</value>
<value>X</value>
</dst>
<body>Y</body>
<account_code>Z</account_code>
<message_id>1525443917.5aec6d4dd217b</message_id>
</response>POST fields that must be provided (in addition to ‘api_user’ and ‘api_key’):
Query SMS: URL: https://demo.pbx.dls.net/api/v1/sms.php?api_action=query_sms&api_format=json
Request formats:
JSON:
{
“api_user”:“100@default”,
“api_key”:“XXXXXXXXX-XXXXXXXXXXXXXX-XXXXXXXXX”,
“filters[]”:{
“from”:“05/01/2017 10:58 am”,
“to”:“07/30/2017 10:58 am”,
“src”:[
“100”,
“z64xxx2n”,
“+12223334456”
],
“dst_original”:[
“+12223334456”,
“+12223334459”
],
“dst”:“100”,
“start_cdr_id”: 5256,
“end_cdr_id”: 5356,
“status”:“success”,
“direction”:“inbound”,
“message_id”:"XXX.XXX",
“account_code”:“XXX”
},
“results_limit”:10,
“results_offset”:0,
“order_by”:“desc”
}XML:
<?xml version=“1.0” standalone=“yes” ?>
<request>
<api_user>100@default</api_user>
<api_key>XXXXXXXXX-XXXXXXXXXXXXXX-XXXXXXXXX</api_key>
<filters[]>
<from>05/01/2017 10:58 am</from>
<to>07/30/2017 10:58am</to>
<src>100</src>
<src>z64xxx2n</src>
<src>+12223334456</src>
<dst_original>+12223334456</dst_original>
<start_cdr_id>5256</start_cdr_id>
<end_cdr_id>5356</end_cdr_id>
<dst>100</dst>
<status>success</status>
<direction>inbound</direction>
<message_id>XXX.XXX</message_id>
<account_code>XXX</account_code>
</filters[]>
<results_limit>10</results_limit>
<results_offset>0</results_offset>
<order_by>desc</order_by>
</request>Success formats:
JSON:
{
“result”:“success”,
“total_results”:“171”,
“results_limit”:“10”,
“results_offset”:“0”,
“results”:[
{
“id”:“3131”,
“timestamp”:“2017-06-22 15:36:41”,
“src_label”:“100@default - Phone Name”,
“dst_original_label”:"",
“dst_label”:“2224445555”,
“status”:“success”,
“direction”:“outbound”,
“message”:“Test Message”,
“account_code”:“213985”,
“message_id”:“1498157871.594c132f4c2fa”
},
{
“id”:“3121”,
“timestamp”:“2017-06-22 13:57:51”,
“src_label”:“100@default - Phone Name”,
“dst_original_label”:"",
“dst_label”:“2224445555”,
“status”:“success”,
“direction”:“outbound”,
“message”:“Test Message”,
“account_code”:"",
“message_id”:“1498157871.594c132f4c2fa”
}
]
}XML:
<?xml version=“1.0” encoding=“UTF-8” ?>
<result>success</result>
<total_results>171</total_results>
<results_limit>10</results_limit>
<results_offset>0</results_offset>
<results>
<id>3131</id>
<timestamp>2017-06-22 15:36:41</timestamp>
<src_label>100@default - Phone Name</src_label>
<dst_original_label></dst_original_label>
<dst_label>2224445555</dst_label>
<status>success</status>
<direction>outbound</direction>
<message>Test Message</message>
<account_code>213985</account_code>
<message_id>1498157871.594c132f4c2fa</message_id>
</results>
<results>
<id>3121</id>
<timestamp>2017-06-22 13:57:51</timestamp>
<src_label>100@default - Phone Name</src_label>
<dst_original_label></dst_original_label>
<dst_label>2224445555</dst_label>
<status>success</status>
<direction>outbound</direction>
<message>Test Message</message>
<account_code></account_code>
<message_id>1498157871.594c132f4c2fa</message_id>
</results>POST fields that can be provided (in addition to ‘api_user’ and ‘api_key’):
filters[]:
The following filters can be applied. Filters must be passed as an array.
Access to query campaign opt-in lists and tenant opt-out lists related to the Campaign Registry. This endpoint also allows users to add numbers to opt-in and opt-out lists and remove them. NOTE: You are legally required to obtain permission (consent) to exchange messages from each consumer or business you will be interacting with via SMS. There are severe penalties for disregarding customer consent. Please refer to the Telephone Consumer Protection Act (TCPA) for more information. The following methods are currently available for this endpoint:
Query Lists:
URL: https://demo.pbx.dls.net/api/v1/subscribers.php?api_action=query_lists&api_format=json
Request formats:
JSON:
{
“api_user”:“100@default”,
“api_key”:“XXXXXXXXX-XXXXXXXXXXXXXX-XXXXXXXXX”,
}XML:
<?xml version=“1.0” standalone=“yes”?>
<request>
<api_user>100@default</api_user>
<api_key>XXXXXXXXX-XXXXXXXXXXXXXX-XXXXXXXXX</api_key>
</request>Success formats:
JSON:
{
“result”:“success”,
“optin”: [
{
“campaign_id”: “XXXXXXX”,
“campaign_name”: “Name of the campaign”,
“total_subscribers”: “190”,
“subscribed_at”: [
{
“number”: “5555555555”,
“reason”: “MANUAL”,
“subscribe_text”: “N\A”,
“subscribed_at”: “2023-06-22 10:16:25”
},
{…}
]
},
{…}
],
“optout”: [
{
“tenant_id”: “0”,
“campaign_name”: “name of the tenant”,
“total_unsubscribers”: “24”,
“unsubscribed_at”: [
{
“number”: “5555555555”,
“reason”: “MANUAL”,
“unsubscribe_text”: “N\A”,
“unsubscribed_at”: “2023-06-22 10:16:25”
},
{…}
]
},
{…}
]
}XML:
<?xml version=“1.0” standalone=“yes”?>
<response>
<result>success</result>
<optin>
<array>
<campaign_id>XXXXX</campaign_id>
<campaign_name>Name of the campaign</campaign_name>
<total_subscribers>222</total_subscribers>
<subscribers>
<array>
<number>5555555555</number>
<reason>MANUAL</reason>
<subscribe_text>N\A</subscribe_text>
<subscribed_at>2023-06-22 10:16:25</subscribed_at>
</array>
…
</subscribers>
</array>
…
</optin>
<optout>
<array>
<tenant_id>0</tenant_id>
<tenant_name>default</tenant_name>
<total_unsubscribers>1</total_unsubscribers>
<unsubscribers>
<array>
<number>1122334444</number>
<reason>MANUAL</reason>
<unsubscribe_text>N\A</unsubscribe_text>
<unsubscribed_at>2023-07-03 13:08:43</unsubscribed_at>
</array>
…
</unsubscribers>
</array>
…
</optout>
</response>No POST fields are required in the request body (besides ‘api_user’ and ‘api_key’):
Add Subscriber Opt-In: URL: https://demo.pbx.dls.net/api/v1/subscribers.php?api_action=add_subscriber&api_format=json
Request formats:
JSON:
{
“api_user”:“100@default”,
“api_key”:“XXXXXXXXX-XXXXXXXXXXXXXX-XXXXXXXXX”,
“phone_number”: 1112224444,
“campaign_id”: “XXXXXXX”
}XML:
<?xml version=“1.0” standalone=“yes” ?>
<request>
<api_user>100@default</api_user>
<api_key>XXXXXXXXX-XXXXXXXXXXXXXX-XXXXXXXXX</api_key>
<phone_number>1112224444</phone_number>
<campaign_id>XXXXXXX</campaign_id>
</request>Success formats:
JSON:
{
“result”: “success”,
“success”: “Successfully added a new subscriber”
}XML:
<?xml version=“1.0” encoding=“UTF-8” ?>
<result>success</result>
<success>Sucessfully added a new subscriber</success>POST fields that must be provided (in addition to ‘api_user’ and ‘api_key’):
Remove Subscriber Opt-In:
URL: https://demo.pbx.dls.net/api/v1/subscribers.php?api_action=remove_subscriber&api_format=json
Request formats:
JSON:
{
“api_user”:“100@default”,
“api_key”:“XXXXXXXXX-XXXXXXXXXXXXXX-XXXXXXXXX”,
“phone_number”: 1112224444,
“campaign_id”: “XXXXXXX”
}XML:
<?xml version=“1.0” standalone=“yes” ?>
<request>
<api_user>100@default</api_user>
<api_key>XXXXXXXXX-XXXXXXXXXXXXXX-XXXXXXXXX</api_key>
<phone_number>1112224444</phone_number>
<campaign_id>XXXXXXX</campaign_id>
</request>Success formats: JSON:
{
“result”: “success”,
“success”: “Successfully removed the subscriber”
}XML:
<?xml version=“1.0” encoding=“UTF-8” ?>
<result>success</result>
<success>Sucessfully removed the subscriber</success>POST fields that must be provided (in addition to ‘api_user’ and ‘api_key’):
Add Subscriber Opt-Out: URL: https://demo.pbx.dls.net/api/v1/subscribers.php?api_action=add_unsubscriber&api_format=json
Request formats:
JSON:
{
“api_user”:“100@default”,
“api_key”:“XXXXXXXXX-XXXXXXXXXXXXXX-XXXXXXXXX”,
“phone_number”: 1112224444,
“tenant_id”: “0”
}XML:
<?xml version=“1.0” standalone=“yes” ?>
<request>
<api_user>100@default</api_user>
<api_key>XXXXXXXXX-XXXXXXXXXXXXXX-XXXXXXXXX</api_key>
<phone_number>1112224444</phone_number>
<tenant_id>0</tenant_id>
</request>Success formats:
JSON:
{
“result”: “success”,
“success”: “Successfully added unsubscriber to the provided tenants opt-out list”.
}XML
<?xml version=“1.0” encoding=“UTF-8” ?>
<result>success</result>
<success>Successfully added unsubscriber to the provided tenants opt-out list.</success>POST fields that must be provided (in addition to ‘api_user’ and ‘api_key’):
Remove Subscriber Opt-Out:
URL: https://demo.pbx.dls.net/api/v1/subscribers.php?api_action=remove_unsubscriber&api_format=json
Request formats:
JSON:
{
“api_user”:“100@default”,
“api_key”:“XXXXXXXXX-XXXXXXXXXXXXXX-XXXXXXXXX”,
“phone_number”: 1112224444,
“tenant_id”: “0”
}XML:
<?xml version=“1.0” standalone=“yes” ?>
<request>
<api_user>100@default</api_user>
<api_key>XXXXXXXXX-XXXXXXXXXXXXXX-XXXXXXXXX</api_key>
<phone_number>1112224444</phone_number>
<tenant_id>0</tenant_id>
</request>Success formats:
JSON:
{
“result”: “success”,
“success”: “Successfully removed the unsubscriber from the provided tenants opt-out list”.
}XML:
<?xml version=“1.0” encoding=“UTF-8” ?>
<result>success</result>
<success>Successfully removed the unsubscriber from the provided tenants opt-out list.</success>POST fields that must be provided (in addition to ‘api_user’ and ‘api_key’):
