Delete campaign
Deletes one or more campaigns.
Endpoint
Section titled “Endpoint”HTTP method: DELETE
https://api.sender.net/v2/campaigns?ids=[eE0x14]
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
ids | array required | You can provide an array of multiple campaign IDs to be deleted. Specifying the string “all” will delete all campaigns in your account. |
status | string | Status should be among - ‘DRAFT’, ‘SENT’, ‘PENDING’, ‘PREPARING’ |
title | string | Provide the Campaign’s title |
Request Examples
Section titled “Request Examples”const url = new URL("https://api.sender.net/v2/campaigns?ids=[eE0x14]");
let headers = { "Authorization": "Bearer [your-token]", "Content-Type": "application/json", "Accept": "application/json",};
let bodyContent = { "status": "DRAFT", "title": "Campaign's title"};
fetch(url, { method: "DELETE", headers, body: JSON.stringify(bodyContent)}).then(response => response.json()).then(data => console.log(data)).catch(error => console.error('Error:', error));$client = new \GuzzleHttp\Client();
$json = [ "status" => "DRAFT", "title" => "Campaign's title"];
$response = $client->delete( 'https://api.sender.net/v2/campaigns?ids=[eE0x14]', [ 'headers' => [ 'Authorization' => 'Bearer [your-token]', 'Content-Type' => 'application/json', 'Accept' => 'application/json', ], 'json' => $json ]);
$body = $response->getBody()->getContents();$data = json_decode($body, true);print_r($data);import requestsimport json
url = "https://api.sender.net/v2/campaigns?ids=[eE0x14]"
headers = { "Authorization": "Bearer [your-token]", "Content-Type": "application/json", "Accept": "application/json",}
payload = { "status": "DRAFT", "title": "Campaign's title"}
response = requests.request('DELETE', url, headers=headers, json=payload)
print(response.json())curl -X DELETE \"https://api.sender.net/v2/campaigns?ids=[eE0x14]" \-H "Authorization: Bearer [your-token]" \-H "Content-Type: application/json" \-H "Accept: application/json" \-d '{"status":"DRAFT","title":"Campaign's title"}'Response
Section titled “Response”{ "success": true, "message": "Deleted"}