API Docs

API Docs

Overview

Obtain API_KEY_TOKEN value

Obtain ACCOUNT_ID and CAMPAIGN_ID values

List campaigns

List campaign numbers

Add number to a dynamic campaign

Add number with variable values to a dynamic campaign

Upload CSV file with new numbers for a dynamic campaign

Delete campaign numbers

Overview

SIP Caller offers a REST API which allows SIP Caller customers to perform different operations on their SIP Caller account from external programs. In this way, many useful custom integrations can be developed between SIP Caller and other systems.

Obtain API_KEY_TOKEN value

In order to use the REST API, a SIP Caller customer must first create an API Key, as explained in this section, in order to obtain an API_KEY_TOKEN which will be used in the following examples for authenticating calls to the SIP Caller REST API from an external program.

Obtain ACCOUNT_ID and CAMPAIGN_ID values

The SIP Caller customer ACCOUNT_ID value, which will be used in the following examples, can be obtained from the Web Console, as shown below:

The SIP Caller CAMPAIGN_ID value, which will be used in the following examples, can also be obtained from the Web Console, as shown below:

List campaigns

The following example shows how to list campaigns:

curl -i \

--header 'Authorization: Bearer API_KEY_TOKEN' \

--request GET \

--data-urlencode 'filter={"status":"Active"}' \

--data-urlencode 'sort=["name","DESC"]' \

--data-urlencode 'range=[0,99]' \

'https://api.sipcaller.com/v1/accounts/ACCOUNT_ID/campaigns'

The request allows specifying filters, sorting and range:

  • The filter instruction can specify any of the following fields:
  • filter={"ids":["id1","id2"]}
  • filter={"name":"Campaign Name"}
  • filter={"phoneSystemId":"id1"}
  • filter={"extensionId":"id1"}
  • filter={"dialer":{"mode":"Power"}} – Modes: Power, Predictive
  • filter={"tagIds_ovl":["tag1","tag2"]}
  • filter={"status":"Active"} – Status: Draft, Active, Paused, Canceled, Finished
  • filter={"type":"Static"} – Type: Static, Dynamic
  • filter={"startDate_gte":"20241201T00:00:00"} – Suffixes gte, gt, lte, lt
  • filter={"endDate_gte":"20241201T00:00:00"} – Suffixes gte, gt, lte, lt
  • filter={"startedAt_gte":"20241201T00:00:00"} – Suffixes gte, gt, lte, lt
  • filter={"endedAt_gte":"20241201T00:00:00"} – Suffixes gte, gt, lte, lt
  • filter={"callflowIds_ctn":"id1"} – Filters by human answer or answering machine callflow
  • filter={"callBehavior":{"humanAnswerCallflowId":"id1"}}
  • filter={"callBehavior":{"answeringMachineCallflowId":"id1"}}
  • filter={"webhookEndpointId":"id1"}
  • filter={"isArchived":true}
  • The sort instruction can specify any of the following fields, both ascending (ASC) or descending (DESC):
  • name
  • status
  • type
  • startDate
  • endDate
  • numbersCount
  • startedAt
  • endedAt

List campaign numbers

The following example shows how to list campaign numbers:

curl -i \

--header 'Authorization: Bearer API_KEY_TOKEN' \

--request GET \

--data-urlencode 'filter={"number":"123456789"}' \

--data-urlencode 'sort=["number","DESC"]' \

--data-urlencode 'range=[0,19]' \

'https://api.sipcaller.com/v1/accounts/ACCOUNT_ID/campaigns/CAMPAIGN_ID/numbers'

The request allows specifying filters, sorting and range:

  • The filter instruction can specify any of the following fields:
  • filter={"number":"123456789"} – Partial number lookup is allowed
  • The sort instruction can specify any of the following fields, both ascending (ASC) or descending (DESC):
  • number

Add number to a dynamic campaign

The following example shows how to add a new number to a dynamic campaign which is already active:

curl \

--header 'Content-Type: application/json' \

--header 'Authorization: Bearer API_KEY_TOKEN' \

--request POST \

--data-raw '{"number": "+18005551234"}' \

'https://api.sipcaller.com/v1/accounts/ACCOUNT_ID/campaigns/CAMPAIGN_ID/numbers'

Add number with variable values to a dynamic campaign

The following example shows how to add a new number to a dynamic campaign which is already active, including variable values which can be used by the campaign call flow:

curl \

--header 'Content-Type: application/json' \

--header 'Authorization: Bearer API_KEY_TOKEN' \

--request POST \

--data-raw '{"number": "+18005551234", "varValues": ["John", "199"]}' \

'https://api.sipcaller.com/v1/accounts/ACCOUNT_ID/campaigns/CAMPAIGN_ID/numbers'

Upload CSV file with new numbers for a dynamic campaign

The following example shows how to upload a CSV (comma separated values) file with multiple numbers to a dynamic campaign that is already active.

Firstly, a CSV file must be prepared which contains the new numbers to be added to the campaign. Here is an example of a CSV file with 5 numbers and their corresponding variable values:

5550001,John,199

5550002,Mary,299

5550003,Susan,149

5550004,James,300

5550005,Walter,42

Secondly, the prepared CSV file can be uploaded to SIP Caller with the following command:

curl \

--header 'Authorization: Bearer API_KEY_TOKEN' \

--form "file=@campaign-numbers.csv" \

'https://api.sipcaller.com/v1/accounts/ACCOUNT_ID/campaigns/CAMPAIGN_ID/numbers/upload

?firstRowIsHeader=false

&varCount=2'

Delete campaign numbers

The following example shows how to delete campaign numbers, specifying the ID returned when getting the list:

curl -i \

--header 'Content-Type: application/json' \

--header 'Authorization: Bearer API_KEY_TOKEN' \

--request DELETE \

--data-raw '[NUMBER_ID_1,NUMBER_ID_2,NUMBER_ID_3]' \

'https://api.sipcaller.com/v1/accounts/ACCOUNT_ID/campaigns/CAMPAIGN_ID/numbers'

The data sent allows specifying multiple number IDs. These IDs are NOT the numbers. You will need to list the campaign numbers first, to get the ID for each record, and then delete them.



SIP Caller
© 2024 Easy Caller LLC All Rights Reserved
LinkedinYou Tube