Delete SMS campaign
curl --request DELETE \
--url https://api.nixflex.com/v1/sms/campaigns/{campaign_id}import requests
url = "https://api.nixflex.com/v1/sms/campaigns/{campaign_id}"
response = requests.delete(url)
print(response.text)const options = {method: 'DELETE'};
fetch('https://api.nixflex.com/v1/sms/campaigns/{campaign_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.nixflex.com/v1/sms/campaigns/{campaign_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.nixflex.com/v1/sms/campaigns/{campaign_id}"
req, _ := http.NewRequest("DELETE", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://api.nixflex.com/v1/sms/campaigns/{campaign_id}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.nixflex.com/v1/sms/campaigns/{campaign_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
response = http.request(request)
puts response.read_bodySMS
Delete SMS campaign
DELETE /v1/sms/campaigns/:id
DELETE
/
v1
/
sms
/
campaigns
/
{campaign_id}
Delete SMS campaign
curl --request DELETE \
--url https://api.nixflex.com/v1/sms/campaigns/{campaign_id}import requests
url = "https://api.nixflex.com/v1/sms/campaigns/{campaign_id}"
response = requests.delete(url)
print(response.text)const options = {method: 'DELETE'};
fetch('https://api.nixflex.com/v1/sms/campaigns/{campaign_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.nixflex.com/v1/sms/campaigns/{campaign_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.nixflex.com/v1/sms/campaigns/{campaign_id}"
req, _ := http.NewRequest("DELETE", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://api.nixflex.com/v1/sms/campaigns/{campaign_id}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.nixflex.com/v1/sms/campaigns/{campaign_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
response = http.request(request)
puts response.read_bodyCancels a
scheduled or running campaign. Already-sent messages cannot be recalled.
Request
curl -X DELETE https://api.nixflex.com/v1/sms/campaigns/smsc_a1b2c3d4 \
-H "Authorization: Bearer KEY_ID:KEY_SECRET"
Response
200 OK:
{
"campaign_id": "smsc_a1b2c3d4",
"deleted": true,
"cancelled_count": 47
}
cancelled_count is the number of pending recipients that will not be messaged. Already-sent messages remain delivered.
Behaviour
- Scheduled campaign: cancels before launch. Nothing is sent.
- Running campaign: stops further sends. Already-queued messages may still go through (Twilio is faster than our cancel signal).
- Done campaign: returns 400 — nothing to cancel.
Errors
| Code | Cause |
|---|---|
campaign_not_found | ID does not exist or is not yours |
campaign_already_done | Already finished |
⌘I