Campaigns
Pause a campaign
The messages not sent yet wait; a start not reached yet is cancelled.
POST
/
campaigns
/
{id}
/
pause
Pause a campaign
curl --request POST \
--url https://shortext.ny-corp.io/api/v2.0/campaigns/{id}/pause \
--header 'Authorization: Bearer <token>'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://shortext.ny-corp.io/api/v2.0/campaigns/{id}/pause",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://shortext.ny-corp.io/api/v2.0/campaigns/{id}/pause', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://shortext.ny-corp.io/api/v2.0/campaigns/{id}/pause"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text){
"success": true,
"code": 1000,
"message": "Request success.",
"body": {
"id": "CMP-XXXXX",
"name": "<string>",
"category": "marketing",
"objective": "<string>",
"trigger": "scheduled",
"status": "draft",
"failure_reason": "<string>",
"once_per_contact": true,
"channels": [
{
"channel": "whatsapp",
"channel_id": "<string>"
}
],
"messages": {
"whatsapp": {
"type": "template",
"template": {
"id": "TPL-XXXXX",
"name": "promo",
"language": "fr"
},
"variables": {
"name": {
"source": "field:firstname",
"fallback": "client"
}
},
"buttons": [
"promo-@firstname"
]
},
"mail": {
"type": "email",
"subject": "Our offer, @{firstname|dear customer}"
}
},
"audience": {
"source": "segment",
"segment_id": "<string>",
"import_id": "<string>",
"recipients": 123
},
"start_at": "2023-11-07T05:31:56Z",
"end_at": "2023-11-07T05:31:56Z",
"send_window": {
"start": "08:00",
"end": "20:00"
},
"follow_up_intention_ids": [
"<string>"
],
"paused_at": "2023-11-07T05:31:56Z",
"duplicated_from": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
},
"token": "<string>",
"trace_id": "<string>"
}Autorisations
Company API key, sent as Authorization: Bearer <key>. Create it in the dashboard (Developer > API Keys) with the permissions the integration needs.
Paramètres de chemin
Réponse
200 - application/json
Always HTTP 200: the outcome is in success and code (absolute value of the response code).
⌘I
Pause a campaign
curl --request POST \
--url https://shortext.ny-corp.io/api/v2.0/campaigns/{id}/pause \
--header 'Authorization: Bearer <token>'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://shortext.ny-corp.io/api/v2.0/campaigns/{id}/pause",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://shortext.ny-corp.io/api/v2.0/campaigns/{id}/pause', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://shortext.ny-corp.io/api/v2.0/campaigns/{id}/pause"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text){
"success": true,
"code": 1000,
"message": "Request success.",
"body": {
"id": "CMP-XXXXX",
"name": "<string>",
"category": "marketing",
"objective": "<string>",
"trigger": "scheduled",
"status": "draft",
"failure_reason": "<string>",
"once_per_contact": true,
"channels": [
{
"channel": "whatsapp",
"channel_id": "<string>"
}
],
"messages": {
"whatsapp": {
"type": "template",
"template": {
"id": "TPL-XXXXX",
"name": "promo",
"language": "fr"
},
"variables": {
"name": {
"source": "field:firstname",
"fallback": "client"
}
},
"buttons": [
"promo-@firstname"
]
},
"mail": {
"type": "email",
"subject": "Our offer, @{firstname|dear customer}"
}
},
"audience": {
"source": "segment",
"segment_id": "<string>",
"import_id": "<string>",
"recipients": 123
},
"start_at": "2023-11-07T05:31:56Z",
"end_at": "2023-11-07T05:31:56Z",
"send_window": {
"start": "08:00",
"end": "20:00"
},
"follow_up_intention_ids": [
"<string>"
],
"paused_at": "2023-11-07T05:31:56Z",
"duplicated_from": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
},
"token": "<string>",
"trace_id": "<string>"
}