Skip to main content

Practical Example

Example: Create a campaign that:

  1. Plays the "Hello_World" audio file for the recipients.
  2. Sends calls via the "autodialer" trunk.
  3. Starts sending bulk calls from 2021/07/10 to 2021/07/15.
  4. Dials the numbers 05131041570 and 0219109000.
  5. If the recipient doesn't answer, calls them again, with a 10-minute interval between calls.

1: To get the unique ID of the audio file, use the announcement search service. The sample HTTP request is as follows:

Show Full Source Code Curl


POST /api/v4/autodialer/announcements/search HTTP/1.1
Host: 192.168.51.20
X-APIKEY: 9UV0BWKRL83PYIH9Gv1fI85d41lO4S932EeX3wHC47sHjMJOMG
Authorization: Basic c2FkcjpTYWRyQDEyMw==
Content-Type: application/json
Content-Length: 66

{
"alike":"true",
"conditions":{"name":"Hello_World"}
}

2: To find the unique Trunk Manager ID, we use the trunk manager search service. The sample HTTP request is as follows:

Show Full Source Code Curl


POST /api/v4/autodialer/trunks HTTP/1.1
Host: 192.168.51.20
X-APIKEY: 9UV0BWKRL83PYIH9Gv1fI85d41lO4S932EeX3wHC47sHjMJOMG
Authorization: Basic c2FkcjpTYWRyQDEyMw==
Content-Type: application/json
Content-Length: 66

{
"alike":"true",
"conditions":{"title":"autodialer"}
}

3, 4, 5: Finally, a campaign is created with the specified conditions to send bulk calls at the defined time (campaign add). The sample HTTP request is as follows:

Show Full Source Code Curl


POST /api/v4/autodialer/campaigns/add HTTP/1.1
Host: 192.168.51.20
X-APIKEY: 9UV0BWKRL83PYIH9Gv1fI85d41lO4S932EeX3wHC47sHjMJOMG
Authorization: Basic c2FkcjpTYWRyQDEyMw==
Content-Type: application/json
Content-Length: 379

{
"name":"camptest",
"trunk_manager_id":"5ec63107ce4f6d12c43e250f",
"interface_context":"",
"interface_text":"",
"numbers":["05131041570","0219109000"],
"groups":[""],
"try_interval":"600",
"try":"2",
"start":"2021-07-10 00:00",
"end":"2021-07-14 00:00",
"announcement":"6045d7bd095d846433440144",
"description":""

}