Get campaigns

This method allows you to retrieve your campaigns history.

GET

/campaigns

GET Parameters

start You can define the start record for pagination. Default 0
length You can define the number of records to retrieve per request. Default 100. Maximum 1000
date_start Add a filter to retrieve campaigns of which send date is after this date. Date format must be as follow: Y-m-d H:i:s
date_end Add a filter to retrieve campaigns of which send date is before this date. Date format must be as follow: Y-m-d H:i:s
sms_min Add a filter to retrieve campaigns that have a minimum amount of SMS
sms_max Add a filter to retrieve campaigns that have a maximum amount of SMS
destination Add a filter to retrieve campaigns that have this phone number as destination
text Add a filter to retrieve campaigns that contains this text in the content
sort You can sort by id, date, text, cost, status. Add - to sort in descending order, for example -id

Examples


GET /campaigns?start=0&length=10 HTTP/1.1
Host: api.smsup.ch
Accept: application/json
Authorization: Bearer your.token
      
    

Result Format


{
    "status": 1,
    "message": "OK",
    "campaigns": [
        {
            "id": "18969398",
            "sender": "BESTSHOES",
            "text": "Special offer : Buy one shoe and get the second one for free",
            "creation_date": "2024-11-21 10:56:59",
            "date": "2024-11-21 10:56:59",   //Sending date
            "cost": "2128",                 //The cost of your campaign
            "lists": [                      //The ids of the lists you used to send
                {
                    "id": "5a0331bffc5886074551ce97"
                },
                {
                    "id": "5a0331bffc5886074551ce98"
                }
            ],
            "status": "Sent",
            "delivery_rate": "100",
            "delivered": "1958",
            "error": "0",                   //Number of SMS in error (from operators)
            "expired": "0",                 //Number of SMS expired (from operators)
            "network_error": "0",           //Number of SMS in error (from operators)
            "stop": "0",                    //Number of stop replies
            "npai": "0"                     //Number of npai numbers
            "total": "1958"                 //Number of message before filtering
        },
        {
            "id": "18969399",
            "sender": "BESTICECREAM",
            "text": "Special offer : Buy one ice cream and get the second one for free",
            "creation_date": "2024-12-11 10:56:59",
            "date": "2024-12-11 10:56:59",
            "cost": "54",
            "lists": [],
            "status": "Sent",
            "delivery_rate": "100",
            "delivered": "54",
            "error": "0",
            "expired": "0",
            "network_error": "0",
            "stop": "0",
            "npai": "0"
            "total": "54"
        }
    ],
    "totalRecords": 2,
    "totalDisplayRecords": 2
}
          
        

<?xml version="1.0" encoding="UTF-8" ?>
<response>
    <status>1</status>
    <message>OK</message>
    <campaign>
        <id>18969398</id>
        <sender>BESTSHOES</sender>
        <text>Special offer : Buy one shoe and get the second one for free</text>
        <creation_date>2024-11-21 10:56:59</creation_date>
        <date>2024-11-21 10:56:59</date>
        <cost>2128</cost>
        <lists>
            <id>12345</id>
        </lists>
        <lists>
            <id>45742</id>
        </lists>
        <delivery_rate>100</delivery_rate>
        <delivered>1958</delivered>
        <error>0</error>
        <expired>0</expired>
        <network_error>0</network_error>
        <stop>0</stop>
        <npai>0</npai>
        <total>1958</total>
    </campaign>
    <campaign>
        <id>18969399</id>
        <sender>BESTICECREAM</sender>
        <text>Special offer : Buy one ice cream and get the second one for free</text>
        <creation_date>2024-12-11 10:56:59</creation_date>
        <date>2024-12-11 10:56:59</date>
        <cost>54</cost>
        <lists></lists>
        <delivery_rate>100</delivery_rate>
        <delivered>54</delivered>
        <error>0</error>
        <expired>0</expired>
        <network_error>0</network_error>
        <stop>0</stop>
        <npai>0</npai>
        <total>54</total>
    </campaign>
</response>
        
      

Statuses

status Description
Sent The message has been sent.
Waiting The message is waiting to be sent (campaign scheduled in the future).
In progress The message is being sent.
In moderation The message is being moderated. A human action is required to validate or reject (in the case of fraud) the message.
Denied The message was rejected.