/campaigns/{id}Patches a Campaign for a given Campaign id.
Privileges: campaign-detector.manage
Auditlog Event: campaign.detector.campaign.patch
Errors:
- CAMPAIGN_DETECTOR_API_CAMPAIGN_NOT_FOUND - campaign not found
- BAD_REQUEST_BODY_FORMAT - Unable to decode request body
- INT_APP_ERROR - unexpected internal error / missing instance context
Validation Errors:
- CAMPAIGN_DETECTOR_API_CAMPAIGN_STATUS_NOT_SUPPORTED - The given status is not supported
- CAMPAIGN_DETECTOR_API_CAMPAIGN_ARCHIVED_STATUS_CANNOT_BE_CHANGED - The status of the archived campaign cannot be changed
- CAMPAIGN_DETECTOR_API_CAMPAIGN_ACTIVE_DURATION_NOT_SUPPORTED - The given active duration value is not supported
- CAMPAIGN_DETECTOR_API_CAMPAIGN_ACTIVE_DURATION_CANNOT_BE_UPDATED - The action duration can be changed only for active or inactive campaigns
- CAMPAIGN_DETECTOR_API_CAMPAIGN_NAME_IS_REQUIRED - The name is a required field and cannot be empty
- CAMPAIGN_DETECTOR_API_CAMPAIGN_NAME_IS_TOO_LONG - The name cannot be longer than 255 characters
- CAMPAIGN_DETECTOR_API_CAMPAIGN_PRIORITY_NOT_SUPPORTED - The given priority value is not supported
- CAMPAIGN_DETECTOR_API_CAMPAIGN_LANG_LEN_NOT_EQ_2 - The lang field must have 2 characters
- CAMPAIGN_DETECTOR_API_CAMPAIGN_LANG_NOT_FOUND - Language not found
- CAMPAIGN_DETECTOR_API_CAMPAIGN_ACTION_NOT_SUPPORTED - The given action value is not supported
- CAMPAIGN_DETECTOR_API_CAMPAIGN_ACTION_METHOD_REQUIRED - The action method id required and cannot be empty
- CAMPAIGN_DETECTOR_API_CAMPAIGN_GROUP_NOT_FOUND - campaign group not found
- CAMPAIGN_DETECTOR_API_CAMPAIGN_CANNOT_BE_IGNORED - Only new campaigns can be ignored
- CAMPAIGN_DETECTOR_API_CAMPAIGN_ACTIVE_UNTIL_DT_IS_REQUIRED - The value for the active until dt field is required and cannot be empty
- CAMPAIGN_DETECTOR_API_CAMPAIGN_ACTIVE_UNTIL_DT_NOT_VALID_FORMAT - The value for the active until dt field is not in the valid date-time format
- CAMPAIGN_DETECTOR_API_CAMPAIGN_ACTIVE_UNTIL_DT_IS_FAR_IN_FUTURE - The given value for the active until dt field is in far in the future
- CAMPAIGN_DETECTOR_API_CAMPAIGN_ACTIVE_UNTIL_DT_IS_IN_PAST - The given value for the active until dt field cannot be in the past
- CAMPAIGN_DETECTOR_API_CAMPAIGN_TAG_IS_INACTIVE - Campaign tag tagname is inactive
- CAMPAIGN_DETECTOR_API_CAMPAIGN_LANGUAGE_IS_TOO_LONG - The language cannot be longer than 50 characters
Request
Path parameters
Campaign ID
Body required
none, silently-drop, reject-standard, reject-customShow child attributes
Show child attributes
Use a activeUntilDt field if this value is equal to 'limited'. Use this only if the status is equal to active or inactive.
unlimited, limitedThis value cannot be in the past and cannot be in the far future
2 · max length: 2255low, normal, high, criticalThe status of the archived campaign cannot be changed.
active, ignored, inactive, archivedShow child attributes
Request example
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Patch, "https://api-cpaas.sms.es/bulk/campaign-detector/v1/campaigns/{id}");
request.Headers.Add("Accept", "application/json");
request.Headers.Add("Authorization", "Bearer <access_token>");
var content = new StringContent("{\"action\":\"none\",\"actionMethod\":{\"method\":\"string\",\"object\":\"string\",\"parameters\":{\"charge\":\"string\",\"dlrError\":\"string\",\"dlrStatus\":\"string\"}},\"activeDuration\":\"unlimited\",\"activeUntilDt\":\"2026-01-01T12:00:00Z\",\"conf\":{},\"groupId\":0,\"lang\":\"string\",\"language\":\"string\",\"name\":\"string\",\"priority\":\"low\",\"status\":\"active\",\"tags\":[{\"id\":0}]}", null, "application/json");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());var options = new RestClientOptions("")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("https://api-cpaas.sms.es/bulk/campaign-detector/v1/campaigns/{id}", Method.Patch);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Accept", "application/json");
request.AddHeader("Authorization", "Bearer <access_token>");
var body = "{\"action\":\"none\",\"actionMethod\":{\"method\":\"string\",\"object\":\"string\",\"parameters\":{\"charge\":\"string\",\"dlrError\":\"string\",\"dlrStatus\":\"string\"}},\"activeDuration\":\"unlimited\",\"activeUntilDt\":\"2026-01-01T12:00:00Z\",\"conf\":{},\"groupId\":0,\"lang\":\"string\",\"language\":\"string\",\"name\":\"string\",\"priority\":\"low\",\"status\":\"active\",\"tags\":[{\"id\":0}]}";
request.AddStringBody(body, DataFormat.Json);
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);curl -L -X PATCH "https://api-cpaas.sms.es/bulk/campaign-detector/v1/campaigns/{id}" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Authorization: Bearer <access_token>" \
--data-raw '{
"action": "none",
"actionMethod": {
"method": "string",
"object": "string",
"parameters": {
"charge": "string",
"dlrError": "string",
"dlrStatus": "string"
}
},
"activeDuration": "unlimited",
"activeUntilDt": "2026-01-01T12:00:00Z",
"conf": {},
"groupId": 0,
"lang": "string",
"language": "string",
"name": "string",
"priority": "low",
"status": "active",
"tags": [
{
"id": 0
}
]
}'var headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'Bearer <access_token>'
};
var data = json.encode({
"action": "none",
"actionMethod": {
"method": "string",
"object": "string",
"parameters": {
"charge": "string",
"dlrError": "string",
"dlrStatus": "string"
}
},
"activeDuration": "unlimited",
"activeUntilDt": "2026-01-01T12:00:00Z",
"conf": {},
"groupId": 0,
"lang": "string",
"language": "string",
"name": "string",
"priority": "low",
"status": "active",
"tags": [
{
"id": 0
}
]
});
var dio = Dio();
var response = await dio.request(
'https://api-cpaas.sms.es/bulk/campaign-detector/v1/campaigns/{id}',
options: Options(
method: 'PATCH',
headers: headers,
),
data: data,
);
if (response.statusCode == 200) {
print(json.encode(response.data));
}
else {
print(response.statusMessage);
}var headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'Bearer <access_token>'
};
var request = http.Request('PATCH', Uri.parse('https://api-cpaas.sms.es/bulk/campaign-detector/v1/campaigns/{id}'));
request.body = json.encode({
"action": "none",
"actionMethod": {
"method": "string",
"object": "string",
"parameters": {
"charge": "string",
"dlrError": "string",
"dlrStatus": "string"
}
},
"activeDuration": "unlimited",
"activeUntilDt": "2026-01-01T12:00:00Z",
"conf": {},
"groupId": 0,
"lang": "string",
"language": "string",
"name": "string",
"priority": "low",
"status": "active",
"tags": [
{
"id": 0
}
]
});
request.headers.addAll(headers);
http.StreamedResponse response = await request.send();
if (response.statusCode == 200) {
print(await response.stream.bytesToString());
}
else {
print(response.reasonPhrase);
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api-cpaas.sms.es/bulk/campaign-detector/v1/campaigns/{id}"
method := "PATCH"
payload := strings.NewReader(`{
"action": "none",
"actionMethod": {
"method": "string",
"object": "string",
"parameters": {
"charge": "string",
"dlrError": "string",
"dlrStatus": "string"
}
},
"activeDuration": "unlimited",
"activeUntilDt": "2026-01-01T12:00:00Z",
"conf": {},
"groupId": 0,
"lang": "string",
"language": "string",
"name": "string",
"priority": "low",
"status": "active",
"tags": [
{
"id": 0
}
]
}`)
client := &http.Client{}
req, err := http.NewRequest(method, url, payload)
if err != nil {
fmt.Println(err)
return
}
req.Header.Add("Content-Type", "application/json")
req.Header.Add("Accept", "application/json")
req.Header.Add("Authorization", "Bearer <access_token>")
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()
body, err := io.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}PATCH /bulk/campaign-detector/v1/campaigns/{id} HTTP/1.1
Host: api-cpaas.sms.es
Content-Type: application/json
Accept: application/json
Authorization: Bearer <access_token>
Content-Length: 339
{
"action": "none",
"actionMethod": {
"method": "string",
"object": "string",
"parameters": {
"charge": "string",
"dlrError": "string",
"dlrStatus": "string"
}
},
"activeDuration": "unlimited",
"activeUntilDt": "2026-01-01T12:00:00Z",
"conf": {},
"groupId": 0,
"lang": "string",
"language": "string",
"name": "string",
"priority": "low",
"status": "active",
"tags": [
{
"id": 0
}
]
}OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\"action\":\"none\",\"actionMethod\":{\"method\":\"string\",\"object\":\"string\",\"parameters\":{\"charge\":\"string\",\"dlrError\":\"string\",\"dlrStatus\":\"string\"}},\"activeDuration\":\"unlimited\",\"activeUntilDt\":\"2026-01-01T12:00:00Z\",\"conf\":{},\"groupId\":0,\"lang\":\"string\",\"language\":\"string\",\"name\":\"string\",\"priority\":\"low\",\"status\":\"active\",\"tags\":[{\"id\":0}]}");
Request request = new Request.Builder()
.url("https://api-cpaas.sms.es/bulk/campaign-detector/v1/campaigns/{id}")
.method("PATCH", body)
.addHeader("Content-Type", "application/json")
.addHeader("Accept", "application/json")
.addHeader("Authorization", "Bearer <access_token>")
.build();
Response response = client.newCall(request).execute();Unirest.setTimeouts(0, 0);
HttpResponse<String> response = Unirest.patch("https://api-cpaas.sms.es/bulk/campaign-detector/v1/campaigns/{id}")
.header("Content-Type", "application/json")
.header("Accept", "application/json")
.header("Authorization", "Bearer <access_token>")
.body("{\"action\":\"none\",\"actionMethod\":{\"method\":\"string\",\"object\":\"string\",\"parameters\":{\"charge\":\"string\",\"dlrError\":\"string\",\"dlrStatus\":\"string\"}},\"activeDuration\":\"unlimited\",\"activeUntilDt\":\"2026-01-01T12:00:00Z\",\"conf\":{},\"groupId\":0,\"lang\":\"string\",\"language\":\"string\",\"name\":\"string\",\"priority\":\"low\",\"status\":\"active\",\"tags\":[{\"id\":0}]}")
.asString();const myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");
myHeaders.append("Accept", "application/json");
myHeaders.append("Authorization", "Bearer <access_token>");
const raw = JSON.stringify({
"action": "none",
"actionMethod": {
"method": "string",
"object": "string",
"parameters": {
"charge": "string",
"dlrError": "string",
"dlrStatus": "string"
}
},
"activeDuration": "unlimited",
"activeUntilDt": "2026-01-01T12:00:00Z",
"conf": {},
"groupId": 0,
"lang": "string",
"language": "string",
"name": "string",
"priority": "low",
"status": "active",
"tags": [
{
"id": 0
}
]
});
const requestOptions = {
method: "PATCH",
headers: myHeaders,
body: raw,
redirect: "follow"
};
fetch("https://api-cpaas.sms.es/bulk/campaign-detector/v1/campaigns/{id}", requestOptions)
.then((response) => response.text())
.then((result) => console.log(result))
.catch((error) => console.error(error));var settings = {
"url": "https://api-cpaas.sms.es/bulk/campaign-detector/v1/campaigns/{id}",
"method": "PATCH",
"timeout": 0,
"headers": {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "Bearer <access_token>"
},
"data": JSON.stringify({
"action": "none",
"actionMethod": {
"method": "string",
"object": "string",
"parameters": {
"charge": "string",
"dlrError": "string",
"dlrStatus": "string"
}
},
"activeDuration": "unlimited",
"activeUntilDt": "2026-01-01T12:00:00Z",
"conf": {},
"groupId": 0,
"lang": "string",
"language": "string",
"name": "string",
"priority": "low",
"status": "active",
"tags": [
{
"id": 0
}
]
})
};
$.ajax(settings).done(function (response) {
console.log(response);
});var data = JSON.stringify({
"action": "none",
"actionMethod": {
"method": "string",
"object": "string",
"parameters": {
"charge": "string",
"dlrError": "string",
"dlrStatus": "string"
}
},
"activeDuration": "unlimited",
"activeUntilDt": "2026-01-01T12:00:00Z",
"conf": {},
"groupId": 0,
"lang": "string",
"language": "string",
"name": "string",
"priority": "low",
"status": "active",
"tags": [
{
"id": 0
}
]
});
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function() {
if(this.readyState === 4) {
console.log(this.responseText);
}
});
xhr.open("PATCH", "https://api-cpaas.sms.es/bulk/campaign-detector/v1/campaigns/{id}");
xhr.setRequestHeader("Content-Type", "application/json");
xhr.setRequestHeader("Accept", "application/json");
xhr.setRequestHeader("Authorization", "Bearer <access_token>");
xhr.send(data);val client = OkHttpClient()
val mediaType = "application/json".toMediaType()
val body = """
{
"action": "none",
"actionMethod": {
"method": "string",
"object": "string",
"parameters": {
"charge": "string",
"dlrError": "string",
"dlrStatus": "string"
}
},
"activeDuration": "unlimited",
"activeUntilDt": "2026-01-01T12:00:00Z",
"conf": {},
"groupId": 0,
"lang": "string",
"language": "string",
"name": "string",
"priority": "low",
"status": "active",
"tags": [
{
"id": 0
}
]
}
""".trimIndent().toRequestBody(mediaType)
val request = Request.Builder()
.url("https://api-cpaas.sms.es/bulk/campaign-detector/v1/campaigns/{id}")
.patch(body)
.addHeader("Content-Type", "application/json")
.addHeader("Accept", "application/json")
.addHeader("Authorization", "Bearer <access_token>")
.build()
val response = client.newCall(request).execute()#include <stdio.h>
#include <curl/curl.h>
int main(void) {
CURL *curl = curl_easy_init();
if (curl) {
curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "PATCH");
curl_easy_setopt(curl, CURLOPT_URL, "https://api-cpaas.sms.es/bulk/campaign-detector/v1/campaigns/{id}");
curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "Content-Type: application/json");
headers = curl_slist_append(headers, "Accept: application/json");
headers = curl_slist_append(headers, "Authorization: Bearer <access_token>");
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
const char *data = "{\"action\":\"none\",\"actionMethod\":{\"method\":\"string\",\"object\":\"string\",\"parameters\":{\"charge\":\"string\",\"dlrError\":\"string\",\"dlrStatus\":\"string\"}},\"activeDuration\":\"unlimited\",\"activeUntilDt\":\"2026-01-01T12:00:00Z\",\"conf\":{},\"groupId\":0,\"lang\":\"string\",\"language\":\"string\",\"name\":\"string\",\"priority\":\"low\",\"status\":\"active\",\"tags\":[{\"id\":0}]}";
curl_easy_setopt(curl, CURLOPT_POSTFIELDS, data);
CURLcode res = curl_easy_perform(curl);
curl_slist_free_all(headers);
curl_easy_cleanup(curl);
}
return 0;
}const axios = require('axios');
let data = JSON.stringify({
"action": "none",
"actionMethod": {
"method": "string",
"object": "string",
"parameters": {
"charge": "string",
"dlrError": "string",
"dlrStatus": "string"
}
},
"activeDuration": "unlimited",
"activeUntilDt": "2026-01-01T12:00:00Z",
"conf": {},
"groupId": 0,
"lang": "string",
"language": "string",
"name": "string",
"priority": "low",
"status": "active",
"tags": [
{
"id": 0
}
]
});
let config = {
method: 'patch',
maxBodyLength: Infinity,
url: 'https://api-cpaas.sms.es/bulk/campaign-detector/v1/campaigns/{id}',
headers: {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'Bearer <access_token>'
},
data : data
};
axios.request(config)
.then((response) => {
console.log(JSON.stringify(response.data));
})
.catch((error) => {
console.log(error);
});const https = require('follow-redirects').https;
const fs = require('fs');
let options = {
'method': 'PATCH',
'hostname': 'api-cpaas.sms.es',
'path': '/bulk/campaign-detector/v1/campaigns/{id}',
'headers': {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'Bearer <access_token>'
},
'maxRedirects': 20
};
const req = https.request(options, function (res) {
let chunks = [];
res.on("data", function (chunk) {
chunks.push(chunk);
});
res.on("end", function (chunk) {
let body = Buffer.concat(chunks);
console.log(body.toString());
});
res.on("error", function (error) {
console.error(error);
});
});
let postData = JSON.stringify({
"action": "none",
"actionMethod": {
"method": "string",
"object": "string",
"parameters": {
"charge": "string",
"dlrError": "string",
"dlrStatus": "string"
}
},
"activeDuration": "unlimited",
"activeUntilDt": "2026-01-01T12:00:00Z",
"conf": {},
"groupId": 0,
"lang": "string",
"language": "string",
"name": "string",
"priority": "low",
"status": "active",
"tags": [
{
"id": 0
}
]
});
req.write(postData);
req.end();#import <Foundation/Foundation.h>
dispatch_semaphore_t sema = dispatch_semaphore_create(0);
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"https://api-cpaas.sms.es/bulk/campaign-detector/v1/campaigns/{id}"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
NSDictionary *headers = @{
@"Content-Type": @"application/json",
@"Accept": @"application/json",
@"Authorization": @"Bearer <access_token>"
};
[request setAllHTTPHeaderFields:headers];
NSData *postData = [[NSData alloc] initWithData:[@"{\"action\":\"none\",\"actionMethod\":{\"method\":\"string\",\"object\":\"string\",\"parameters\":{\"charge\":\"string\",\"dlrError\":\"string\",\"dlrStatus\":\"string\"}},\"activeDuration\":\"unlimited\",\"activeUntilDt\":\"2026-01-01T12:00:00Z\",\"conf\":{},\"groupId\":0,\"lang\":\"string\",\"language\":\"string\",\"name\":\"string\",\"priority\":\"low\",\"status\":\"active\",\"tags\":[{\"id\":0}]}" dataUsingEncoding:NSUTF8StringEncoding]];
[request setHTTPBody:postData];
[request setHTTPMethod:@"PATCH"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
dispatch_semaphore_signal(sema);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSError *parseError = nil;
NSDictionary *responseDictionary = [NSJSONSerialization JSONObjectWithData:data options:0 error:&parseError];
NSLog(@"%@",responseDictionary);
dispatch_semaphore_signal(sema);
}
}];
[dataTask resume];
dispatch_semaphore_wait(sema, DISPATCH_TIME_FOREVER);open Lwt
open Cohttp
open Cohttp_lwt_unix
let postData = ref {|{
"action": "none",
"actionMethod": {
"method": "string",
"object": "string",
"parameters": {
"charge": "string",
"dlrError": "string",
"dlrStatus": "string"
}
},
"activeDuration": "unlimited",
"activeUntilDt": "2026-01-01T12:00:00Z",
"conf": {},
"groupId": 0,
"lang": "string",
"language": "string",
"name": "string",
"priority": "low",
"status": "active",
"tags": [
{
"id": 0
}
]
}|};;
let reqBody =
let uri = Uri.of_string "https://api-cpaas.sms.es/bulk/campaign-detector/v1/campaigns/{id}" in
let headers = Header.init ()
|> fun h -> Header.add h "Content-Type" "application/json"
|> fun h -> Header.add h "Accept" "application/json"
|> fun h -> Header.add h "Authorization" "Bearer <access_token>"
in
let body = Cohttp_lwt.Body.of_string !postData in
Client.call ~headers ~body `PATCH uri >>= fun (_resp, body) ->
body |> Cohttp_lwt.Body.to_string >|= fun body -> body
let () =
let respBody = Lwt_main.run reqBody in
print_endline (respBody)<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api-cpaas.sms.es/bulk/campaign-detector/v1/campaigns/{id}',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'PATCH',
CURLOPT_POSTFIELDS => '{
"action": "none",
"actionMethod": {
"method": "string",
"object": "string",
"parameters": {
"charge": "string",
"dlrError": "string",
"dlrStatus": "string"
}
},
"activeDuration": "unlimited",
"activeUntilDt": "2026-01-01T12:00:00Z",
"conf": {},
"groupId": 0,
"lang": "string",
"language": "string",
"name": "string",
"priority": "low",
"status": "active",
"tags": [
{
"id": 0
}
]
}',
CURLOPT_HTTPHEADER => array(
'Content-Type: application/json',
'Accept: application/json',
'Authorization: Bearer <access_token>'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
<?php
$client = new Client();
$headers = [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer <access_token>'
];
$body = '{
"action": "none",
"actionMethod": {
"method": "string",
"object": "string",
"parameters": {
"charge": "string",
"dlrError": "string",
"dlrStatus": "string"
}
},
"activeDuration": "unlimited",
"activeUntilDt": "2026-01-01T12:00:00Z",
"conf": {},
"groupId": 0,
"lang": "string",
"language": "string",
"name": "string",
"priority": "low",
"status": "active",
"tags": [
{
"id": 0
}
]
}';
$request = new Request('PATCH', 'https://api-cpaas.sms.es/bulk/campaign-detector/v1/campaigns/{id}', $headers, $body);
$res = $client->sendAsync($request)->wait();
echo $res->getBody();
$headers = New-Object "System.Collections.Generic.Dictionary[[String],[String]]"
$headers.Add("Content-Type", "application/json")
$headers.Add("Accept", "application/json")
$headers.Add("Authorization", "Bearer <access_token>")
$body = @"
{
"action": "none",
"actionMethod": {
"method": "string",
"object": "string",
"parameters": {
"charge": "string",
"dlrError": "string",
"dlrStatus": "string"
}
},
"activeDuration": "unlimited",
"activeUntilDt": "2026-01-01T12:00:00Z",
"conf": {},
"groupId": 0,
"lang": "string",
"language": "string",
"name": "string",
"priority": "low",
"status": "active",
"tags": [
{
"id": 0
}
]
}
"@
$response = Invoke-RestMethod "https://api-cpaas.sms.es/bulk/campaign-detector/v1/campaigns/{id}" -Method 'PATCH' -Headers $headers -Body $body
$response | ConvertTo-Jsonimport requests
import json
url = "https://api-cpaas.sms.es/bulk/campaign-detector/v1/campaigns/{id}"
payload = json.dumps({
"action": "none",
"actionMethod": {
"method": "string",
"object": "string",
"parameters": {
"charge": "string",
"dlrError": "string",
"dlrStatus": "string"
}
},
"activeDuration": "unlimited",
"activeUntilDt": "2026-01-01T12:00:00Z",
"conf": {},
"groupId": 0,
"lang": "string",
"language": "string",
"name": "string",
"priority": "low",
"status": "active",
"tags": [
{
"id": 0
}
]
})
headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "Bearer <access_token>"
}
response = requests.request("PATCH", url, headers=headers, data=payload)
print(response.text)import http.client
import json
conn = http.client.HTTPSConnection("api-cpaas.sms.es")
payload = json.dumps({
"action": "none",
"actionMethod": {
"method": "string",
"object": "string",
"parameters": {
"charge": "string",
"dlrError": "string",
"dlrStatus": "string"
}
},
"activeDuration": "unlimited",
"activeUntilDt": "2026-01-01T12:00:00Z",
"conf": {},
"groupId": 0,
"lang": "string",
"language": "string",
"name": "string",
"priority": "low",
"status": "active",
"tags": [
{
"id": 0
}
]
})
headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "Bearer <access_token>"
}
conn.request("PATCH", "/bulk/campaign-detector/v1/campaigns/{id}", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))library(httr)
headers = c(
'Content-Type' = 'application/json',
'Accept' = 'application/json',
'Authorization' = 'Bearer <access_token>'
)
body = '{
"action": "none",
"actionMethod": {
"method": "string",
"object": "string",
"parameters": {
"charge": "string",
"dlrError": "string",
"dlrStatus": "string"
}
},
"activeDuration": "unlimited",
"activeUntilDt": "2026-01-01T12:00:00Z",
"conf": {},
"groupId": 0,
"lang": "string",
"language": "string",
"name": "string",
"priority": "low",
"status": "active",
"tags": [
{
"id": 0
}
]
}';
res <- VERB("PATCH", url = "https://api-cpaas.sms.es/bulk/campaign-detector/v1/campaigns/{id}", body = body, add_headers(headers))
cat(content(res, 'text'))require "uri"
require "json"
require "net/http"
url = URI("https://api-cpaas.sms.es/bulk/campaign-detector/v1/campaigns/{id}")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Content-Type"] = "application/json"
request["Accept"] = "application/json"
request["Authorization"] = "Bearer <access_token>"
request.body = JSON.dump({
"action": "none",
"actionMethod": {
"method": "string",
"object": "string",
"parameters": {
"charge": "string",
"dlrError": "string",
"dlrStatus": "string"
}
},
"activeDuration": "unlimited",
"activeUntilDt": "2026-01-01T12:00:00Z",
"conf": {},
"groupId": 0,
"lang": "string",
"language": "string",
"name": "string",
"priority": "low",
"status": "active",
"tags": [
{
"id": 0
}
]
})
response = https.request(request)
puts response.read_body
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = reqwest::Client::builder()
.build()?;
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("Content-Type", "application/json".parse()?);
headers.insert("Accept", "application/json".parse()?);
headers.insert("Authorization", "Bearer <access_token>".parse()?);
let data = r#"{
"action": "none",
"actionMethod": {
"method": "string",
"object": "string",
"parameters": {
"charge": "string",
"dlrError": "string",
"dlrStatus": "string"
}
},
"activeDuration": "unlimited",
"activeUntilDt": "2026-01-01T12:00:00Z",
"conf": {},
"groupId": 0,
"lang": "string",
"language": "string",
"name": "string",
"priority": "low",
"status": "active",
"tags": [
{
"id": 0
}
]
}"#;
let json: serde_json::Value = serde_json::from_str(&data)?;
let request = client.request(reqwest::Method::from_bytes(b"PATCH")?, "https://api-cpaas.sms.es/bulk/campaign-detector/v1/campaigns/{id}")
.headers(headers)
.json(&json);
let response = request.send().await?;
let body = response.text().await?;
println!("{}", body);
Ok(())
}printf '{"action":"none","actionMethod":{"method":"string","object":"string","parameters":{"charge":"string","dlrError":"string","dlrStatus":"string"}},"activeDuration":"unlimited","activeUntilDt":"2026-01-01T12:00:00Z","conf":{},"groupId":0,"lang":"string","language":"string","name":"string","priority":"low","status":"active","tags":[{"id":0}]}' | http --follow --timeout 3600 PATCH "https://api-cpaas.sms.es/bulk/campaign-detector/v1/campaigns/{id}" \
'Content-Type':'application/json' \
'Accept':'application/json' \
'Authorization':'Bearer <access_token>'wget --no-check-certificate --quiet \
--method PATCH \
--timeout=0 \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer <access_token>' \
--body-data '{"action":"none","actionMethod":{"method":"string","object":"string","parameters":{"charge":"string","dlrError":"string","dlrStatus":"string"}},"activeDuration":"unlimited","activeUntilDt":"2026-01-01T12:00:00Z","conf":{},"groupId":0,"lang":"string","language":"string","name":"string","priority":"low","status":"active","tags":[{"id":0}]}' \
'https://api-cpaas.sms.es/bulk/campaign-detector/v1/campaigns/{id}'let parameters = """
{
"action": "none",
"actionMethod": {
"method": "string",
"object": "string",
"parameters": {
"charge": "string",
"dlrError": "string",
"dlrStatus": "string"
}
},
"activeDuration": "unlimited",
"activeUntilDt": "2026-01-01T12:00:00Z",
"conf": {},
"groupId": 0,
"lang": "string",
"language": "string",
"name": "string",
"priority": "low",
"status": "active",
"tags": [
{
"id": 0
}
]
}
"""
let postData = parameters.data(using: .utf8)
var request = URLRequest(url: URL(string: "https://api-cpaas.sms.es/bulk/campaign-detector/v1/campaigns/{id}")!,timeoutInterval: Double.infinity)
request.addValue("application/json", forHTTPHeaderField: "Content-Type")
request.addValue("application/json", forHTTPHeaderField: "Accept")
request.addValue("Bearer <access_token>", forHTTPHeaderField: "Authorization")
request.httpMethod = "PATCH"
request.httpBody = postData
let task = URLSession.shared.dataTask(with: request) { data, response, error in
guard let data = data else {
print(String(describing: error))
return
}
print(String(data: data, encoding: .utf8)!)
}
task.resume()Responses
- 200
- 404
- default
Campaign data
none, silently-drop, reject-standard, reject-customShow child attributes
Show child attributes
unknown, unlimited, limitedShow child attributes
Show child attributes
gsm, unicode, binary, unknownmt, molow, normal, high, criticalit makes sense only if smsTotalParts > 0, i.e. 0 <= smsPart <= smsTotalParts
indicates does template represents concatenated message or not, when value is > 0 then this is concatenated message
new, active, ignored, inactive, archivedShow child attributes
system, custom{
"action": "none",
"actionMethod": {
"method": "string",
"object": "string",
"parameters": {
"charge": "string",
"dlrError": "string",
"dlrStatus": "string"
}
},
"activeDuration": "unknown",
"activeUntilDt": "2026-01-01T12:00:00Z",
"conf": {},
"flags": "string",
"group": {
"id": 0,
"name": "string"
},
"groupId": 0,
"id": 0,
"insertDt": "2026-01-01T12:00:00Z",
"instanceId": 0,
"lang": "string",
"langData": {
"id": "string",
"name": "string"
},
"language": "string",
"msgCoding": "gsm",
"msgDt": "2026-01-01T12:00:00Z",
"msgHash": "string",
"msgSender": "string",
"msgText": "string",
"msgType": "mt",
"name": "string",
"priority": "low",
"smsPart": 0,
"smsTotalParts": 0,
"status": "new",
"statusDt": "2026-01-01T12:00:00Z",
"tags": [
{
"id": 0,
"name": "string",
"type": "system"
}
],
"totalHits": 0,
"updateDt": "2026-01-01T12:00:00Z"
}Campaign not found
Show child attributes
Machine-readable error code
Optional structured error details (e.g. validation errors)
Show child attributes
Human-readable item error description
Machine-readable item error code
Field or parameter name that caused the error
Value that failed validation (if applicable)
Human-readable error message
{
"error": {
"code": "string",
"items": [
{
"description": "string",
"message": "string",
"name": "string",
"object": null
}
],
"message": "string"
}
}Unexpected error
Show child attributes
Machine-readable error code
Optional structured error details (e.g. validation errors)
Show child attributes
Human-readable item error description
Machine-readable item error code
Field or parameter name that caused the error
Value that failed validation (if applicable)
Human-readable error message
{
"error": {
"code": "string",
"items": [
{
"description": "string",
"message": "string",
"name": "string",
"object": null
}
],
"message": "string"
}
}