Get all phone campaigns


Return information about your all phone campaigns.

GET

/phone-campaign/

curl -X GET -H "Authorization: Token <your_64_char_api_key>" "https://app.userengage.com/api/public/phone-campaign/"
var settings = {
  "async": true,
  "crossDomain": true,
  "url": "https://app.userengage.com/api/public/phone-campaign/",
  "method": "GET",
  "headers": {
    "authorization": "Token <your_64_char_api_key>"
  }
}

$.ajax(settings).done(function (response) {
  console.log(response);
});
var data = null;

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === 4) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://app.userengage.com/api/public/phone-campaign/");
xhr.setRequestHeader("authorization", "Token <your_64_char_api_key>");

xhr.send(data);
var request = require("request");

var options = { method: 'GET',
  url: 'https://app.userengage.com/api/public/phone-campaign/',
  headers: { authorization: 'Token <your_64_char_api_key>' } };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://app.userengage.com/api/public/phone-campaign/",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_POSTFIELDS => "",
  CURLOPT_HTTPHEADER => array(
    "authorization: Token <your_64_char_api_key>"
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
import requests

url = "https://app.userengage.com/api/public/phone-campaign/"

payload = ""
headers = {'authorization': 'Token <your_64_char_api_key>'}

response = requests.request("GET", url, data=payload, headers=headers)

print(response.text)
import http.client

conn = http.client.HTTPSConnection("app.userengage.com")

payload = ""

headers = { 'authorization': "Token <your_64_char_api_key>" }

conn.request("GET", "/api/public/phone-campaign/", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))

Response


  {
    "count": 2,
    "next": null,
    "previous": null,
    "results": [
        {
            "id": 12,
            "name": "My first phone campaign",
            "description": "",
            "app": 1,
            "phone_number": {
                "id": 2,
                "app": 1,
                "provider": "Your phone number provider",
                "country": "",
                "phone_number": "123456789",
                "name": "Representative phone number",
                "description": "",
                "sms": false,
                "voice": false,
                "price": "0.00",
                "last_used_at": null,
                "created_at": "2018-02-19T11:37:04.727409Z",
                "updated_at": "2018-02-19T11:37:04.727432Z",
                "record_incoming_calls": false
            },
            "status": 1,
            "priority": 1,
            "last_call_at": null,
            "start": null,
            "end": null,
            "created_at": "2018-02-19T11:37:04.733858Z",
            "updated_at": "2018-02-19T11:37:04.733884Z"
        },
        {
            "id": 13,
            "name": "Another phone campaign",
            "description": "We want to call to improve something",
            "app": 1,
            "phone_number": {
                "id": 2,
                "app": 1,
                "provider": "Your phone number provider",
                "country": "",
                "phone_number": "123456789",
                "name": "Representative phone number",
                "description": "",
                "sms": false,
                "voice": false,
                "price": "0.00",
                "last_used_at": null,
                "created_at": "2018-02-19T11:37:04.727409Z",
                "updated_at": "2018-02-19T11:37:04.727432Z",
                "record_incoming_calls": false
            },
            "status": 1,
            "priority": 1,
            "last_call_at": null,
            "start": null,
            "end": null,
            "created_at": "2018-02-12T11:37:04.733858Z",
            "updated_at": "2018-02-12T11:37:04.733884Z"
        }
    ]
}