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 campaigns 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",
"date": "2018-07-04 11:37:16",
"cost": "2128",
"delivery_rate": "92",
"status": 1
},
{
"id": "18852069",
"sender": "",
"text": "Hey this is my first campaign !",
"date": "2018-05-30 14:03:19",
"cost": "1",
"delivery_rate": "100",
"status": 1
}
],
"totalRecords": 2,
"totalDisplayRecords": 2
}
<?xml version="1.0" encoding="UTF-8" ?>
<response>
<status>1</status>
<message>OK</message>
<campaigns>
<id>18969398</id>
<sender>BESTSHOES</sender>
<text>Special offer : Buy one shoe and get the second one for free</text>
<date>2018-07-04 11:37:16</date>
<cost>2128</cost>
<delivery_rate>92</delivery_rate>
<status>1</status>
</campaigns>
<campaigns>
<id>18852069</id>
<sender></sender>
<text>Hey this is my first campaign !</text>
<date>2018-05-30 14:03:19</date>
<cost>1</cost>
<delivery_rate>100</delivery_rate>
</campaigns>
<totalRecords>2</totalRecords>
<totalDisplayRecords>2</totalDisplayRecords>
<status>1</status>
</response>