Submit A2P campaign registration
curl --request POST \
--url https://api.cleartalk.ai/agency/twilio/a2p-campaign-registration \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"brandRegistrationSid": "<string>",
"messagingServiceSid": "<string>",
"campaignId": "<string>",
"optInMessage": "<string>",
"optOutMessage": "<string>",
"helpMessage": "<string>",
"optInKeywords": [
"<string>"
],
"optOutKeywords": [
"<string>"
],
"helpKeywords": [
"<string>"
]
}
'import requests
url = "https://api.cleartalk.ai/agency/twilio/a2p-campaign-registration"
payload = {
"brandRegistrationSid": "<string>",
"messagingServiceSid": "<string>",
"campaignId": "<string>",
"optInMessage": "<string>",
"optOutMessage": "<string>",
"helpMessage": "<string>",
"optInKeywords": ["<string>"],
"optOutKeywords": ["<string>"],
"helpKeywords": ["<string>"]
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
brandRegistrationSid: '<string>',
messagingServiceSid: '<string>',
campaignId: '<string>',
optInMessage: '<string>',
optOutMessage: '<string>',
helpMessage: '<string>',
optInKeywords: ['<string>'],
optOutKeywords: ['<string>'],
helpKeywords: ['<string>']
})
};
fetch('https://api.cleartalk.ai/agency/twilio/a2p-campaign-registration', 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.cleartalk.ai/agency/twilio/a2p-campaign-registration",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'brandRegistrationSid' => '<string>',
'messagingServiceSid' => '<string>',
'campaignId' => '<string>',
'optInMessage' => '<string>',
'optOutMessage' => '<string>',
'helpMessage' => '<string>',
'optInKeywords' => [
'<string>'
],
'optOutKeywords' => [
'<string>'
],
'helpKeywords' => [
'<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.cleartalk.ai/agency/twilio/a2p-campaign-registration"
payload := strings.NewReader("{\n \"brandRegistrationSid\": \"<string>\",\n \"messagingServiceSid\": \"<string>\",\n \"campaignId\": \"<string>\",\n \"optInMessage\": \"<string>\",\n \"optOutMessage\": \"<string>\",\n \"helpMessage\": \"<string>\",\n \"optInKeywords\": [\n \"<string>\"\n ],\n \"optOutKeywords\": [\n \"<string>\"\n ],\n \"helpKeywords\": [\n \"<string>\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.cleartalk.ai/agency/twilio/a2p-campaign-registration")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"brandRegistrationSid\": \"<string>\",\n \"messagingServiceSid\": \"<string>\",\n \"campaignId\": \"<string>\",\n \"optInMessage\": \"<string>\",\n \"optOutMessage\": \"<string>\",\n \"helpMessage\": \"<string>\",\n \"optInKeywords\": [\n \"<string>\"\n ],\n \"optOutKeywords\": [\n \"<string>\"\n ],\n \"helpKeywords\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cleartalk.ai/agency/twilio/a2p-campaign-registration")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"brandRegistrationSid\": \"<string>\",\n \"messagingServiceSid\": \"<string>\",\n \"campaignId\": \"<string>\",\n \"optInMessage\": \"<string>\",\n \"optOutMessage\": \"<string>\",\n \"helpMessage\": \"<string>\",\n \"optInKeywords\": [\n \"<string>\"\n ],\n \"optOutKeywords\": [\n \"<string>\"\n ],\n \"helpKeywords\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"sid": "<string>",
"account_sid": "<string>",
"messaging_service_sid": "<string>",
"brand_registration_sid": "<string>",
"campaign_id": "<string>",
"campaign_status": "<string>",
"opt_in_message": "<string>",
"opt_out_message": "<string>",
"help_message": "<string>",
"opt_in_keywords": [
"<string>"
],
"opt_out_keywords": [
"<string>"
],
"help_keywords": [
"<string>"
],
"date_created": "<string>",
"date_updated": "<string>",
"url": "<string>"
}Twilio
Submit A2P campaign registration
POST
/
agency
/
twilio
/
a2p-campaign-registration
Submit A2P campaign registration
curl --request POST \
--url https://api.cleartalk.ai/agency/twilio/a2p-campaign-registration \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"brandRegistrationSid": "<string>",
"messagingServiceSid": "<string>",
"campaignId": "<string>",
"optInMessage": "<string>",
"optOutMessage": "<string>",
"helpMessage": "<string>",
"optInKeywords": [
"<string>"
],
"optOutKeywords": [
"<string>"
],
"helpKeywords": [
"<string>"
]
}
'import requests
url = "https://api.cleartalk.ai/agency/twilio/a2p-campaign-registration"
payload = {
"brandRegistrationSid": "<string>",
"messagingServiceSid": "<string>",
"campaignId": "<string>",
"optInMessage": "<string>",
"optOutMessage": "<string>",
"helpMessage": "<string>",
"optInKeywords": ["<string>"],
"optOutKeywords": ["<string>"],
"helpKeywords": ["<string>"]
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
brandRegistrationSid: '<string>',
messagingServiceSid: '<string>',
campaignId: '<string>',
optInMessage: '<string>',
optOutMessage: '<string>',
helpMessage: '<string>',
optInKeywords: ['<string>'],
optOutKeywords: ['<string>'],
helpKeywords: ['<string>']
})
};
fetch('https://api.cleartalk.ai/agency/twilio/a2p-campaign-registration', 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.cleartalk.ai/agency/twilio/a2p-campaign-registration",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'brandRegistrationSid' => '<string>',
'messagingServiceSid' => '<string>',
'campaignId' => '<string>',
'optInMessage' => '<string>',
'optOutMessage' => '<string>',
'helpMessage' => '<string>',
'optInKeywords' => [
'<string>'
],
'optOutKeywords' => [
'<string>'
],
'helpKeywords' => [
'<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.cleartalk.ai/agency/twilio/a2p-campaign-registration"
payload := strings.NewReader("{\n \"brandRegistrationSid\": \"<string>\",\n \"messagingServiceSid\": \"<string>\",\n \"campaignId\": \"<string>\",\n \"optInMessage\": \"<string>\",\n \"optOutMessage\": \"<string>\",\n \"helpMessage\": \"<string>\",\n \"optInKeywords\": [\n \"<string>\"\n ],\n \"optOutKeywords\": [\n \"<string>\"\n ],\n \"helpKeywords\": [\n \"<string>\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.cleartalk.ai/agency/twilio/a2p-campaign-registration")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"brandRegistrationSid\": \"<string>\",\n \"messagingServiceSid\": \"<string>\",\n \"campaignId\": \"<string>\",\n \"optInMessage\": \"<string>\",\n \"optOutMessage\": \"<string>\",\n \"helpMessage\": \"<string>\",\n \"optInKeywords\": [\n \"<string>\"\n ],\n \"optOutKeywords\": [\n \"<string>\"\n ],\n \"helpKeywords\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cleartalk.ai/agency/twilio/a2p-campaign-registration")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"brandRegistrationSid\": \"<string>\",\n \"messagingServiceSid\": \"<string>\",\n \"campaignId\": \"<string>\",\n \"optInMessage\": \"<string>\",\n \"optOutMessage\": \"<string>\",\n \"helpMessage\": \"<string>\",\n \"optInKeywords\": [\n \"<string>\"\n ],\n \"optOutKeywords\": [\n \"<string>\"\n ],\n \"helpKeywords\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"sid": "<string>",
"account_sid": "<string>",
"messaging_service_sid": "<string>",
"brand_registration_sid": "<string>",
"campaign_id": "<string>",
"campaign_status": "<string>",
"opt_in_message": "<string>",
"opt_out_message": "<string>",
"help_message": "<string>",
"opt_in_keywords": [
"<string>"
],
"opt_out_keywords": [
"<string>"
],
"help_keywords": [
"<string>"
],
"date_created": "<string>",
"date_updated": "<string>",
"url": "<string>"
}Authorizations
API Key for authentication
Body
application/json
Brand registration SID
Messaging service SID
Campaign ID
Opt-in message
Opt-out message
Help message
Opt-in keywords
Opt-out keywords
Help keywords
Response
A2P campaign registration submitted successfully
Campaign SID
Account SID
Messaging service SID
Brand registration SID
Campaign ID
Campaign status
Opt-in message
Opt-out message
Help message
Opt-in keywords
Opt-out keywords
Help keywords
Creation date
Last update date
Resource URL
⌘I
