Get all SMS campaigns


Return information about your all SMS campaigns.

GET

/sms-campaign/

curl -X GET -H "Authorization: Token <your_64_char_api_key>" "https://app.userengage.com/api/public/sms-campaign/"

Response


  {
    "count": 2,
    "next": null,
    "previous": null,
    "results": [
        {
            "id": 8,
            "name": "Sample SMS campaign",
            "description": "",
            "app": 1,
            "phone_number": {
                "id": 3,
                "app": 1,
                "provider": "Phone number provider",
                "country": "",
                "phone_number": "123123123",
                "name": "Custom name of your phone number",
                "description": "",
                "sms": false,
                "voice": false,
                "price": "0.00",
                "last_used_at": null,
                "created_at": "2018-02-19T13:01:41.083625Z",
                "updated_at": "2018-02-19T13:01:41.083655Z",
                "record_incoming_calls": false
            },
            "type": 1,
            "eta": null,
            "status": 1,
            "recipients": [
                1,
                2,
                3,
                4
            ],
            "recipients_ids": "[4,2]",
            "recipients_count": 2,
            "started_at": null,
            "last_message_sent_at": null,
            "finished_at": null,
            "author": 1,
            "created_at": "2018-02-19T13:01:41.097096Z",
            "updated_at": "2018-02-19T13:01:41.097126Z"
        },
        {
            "id": 7,
            "name": "Sample SMS campaign",
            "description": "",
            "app": 1,
            "phone_number": {
                "id": 1,
                "app": 1,
                "provider": "Tm",
                "country": "",
                "phone_number": "123123123",
                "name": "name",
                "description": "q",
                "sms": false,
                "voice": false,
                "price": "0.00",
                "last_used_at": null,
                "created_at": "2018-02-19T10:16:26.860720Z",
                "updated_at": "2018-02-19T10:16:26.860747Z",
                "record_incoming_calls": false
            },
            "type": 1,
            "eta": null,
            "status": 1,
            "recipients": [
                1,
                2,
                3,
                4
            ],
            "recipients_ids": "[4,2]",
            "recipients_count": 2,
            "started_at": null,
            "last_message_sent_at": null,
            "finished_at": null,
            "author": 1,
            "created_at": "2018-02-19T13:01:17.568394Z",
            "updated_at": "2018-02-19T13:01:17.568435Z"
        },
      ]
    }  
var settings = {
  "async": true,
  "crossDomain": true,
  "url": "https://app.userengage.com/api/public/sms-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/sms-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/sms-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/sms-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/sms-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/sms-campaign/", payload, headers)

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

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