Get campaign
This method allows you to retrieve a specific campaign.
GET
/campaign/:id
Query Parameters
id
required
|
The campaign id |
Examples
GET /campaign/18969398 HTTP/1.1
Host: api.smsfactor.com
Accept: application/json
Authorization: Bearer your.token
Result Format
Can I retrieve my campaigns created on the platform ?
Our platform uses another API (not available to users). You cannot use the API to retrieve campaigns created on the platform.
{
"status": 1,
"message": "OK",
"campaign": [
{
"id": "18969398",
"sender": "BESTSHOES",
"text": "Special offer : Buy one shoe and get the second one for free",
"creation_date": "2024-09-11 10:21:37",
"date": "2024-09-11 10:21:37", //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
}
]
}
<?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-09-11 10:21:37</creation_date>
<date>2024-09-11 10:21:37</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>
</response>
Quelle est la différence entre cost, total et sent ?
The cost
field is the number of credits your campaign cost. As a reminder, an SMS of more than 160 characters costs at least 2 credits. Know more
The total
field is the number of telephone numbers you provided to create your campaign.
The sent
field is the number of telephone numbers to which we have actually sent an SMS (after removing invalid numbers, blacklisting, etc.).
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. |