10DLC
Create 10DLC campaign
Create a 10DLC campaign under an existing brand. The campaign starts in draft status. Submit it for carrier review using the submit endpoint.
POST
/
v1
/
10dlc
/
campaigns
Create 10DLC campaign
curl --request POST \
--url https://api.zavu.dev/v1/10dlc/campaigns \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"brandId": "brand_abc123",
"name": "Order Notifications",
"useCase": "ACCOUNT_NOTIFICATION",
"description": "Send order status updates and shipping notifications to customers who opted in.",
"sampleMessages": [
"Hi {{name}}, your order #{{order_id}} has shipped! Track it at {{url}}",
"Your order #{{order_id}} has been delivered. Thank you for your purchase!"
],
"subscriberOptIn": true,
"subscriberOptOut": true,
"subscriberHelp": true,
"numberPooling": false,
"directLending": false,
"embeddedLink": true,
"embeddedPhone": false,
"affiliateMarketing": false,
"ageGated": false
}
'import requests
url = "https://api.zavu.dev/v1/10dlc/campaigns"
payload = {
"brandId": "brand_abc123",
"name": "Order Notifications",
"useCase": "ACCOUNT_NOTIFICATION",
"description": "Send order status updates and shipping notifications to customers who opted in.",
"sampleMessages": ["Hi {{name}}, your order #{{order_id}} has shipped! Track it at {{url}}", "Your order #{{order_id}} has been delivered. Thank you for your purchase!"],
"subscriberOptIn": True,
"subscriberOptOut": True,
"subscriberHelp": True,
"numberPooling": False,
"directLending": False,
"embeddedLink": True,
"embeddedPhone": False,
"affiliateMarketing": False,
"ageGated": False
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
brandId: 'brand_abc123',
name: 'Order Notifications',
useCase: 'ACCOUNT_NOTIFICATION',
description: 'Send order status updates and shipping notifications to customers who opted in.',
sampleMessages: [
'Hi {{name}}, your order #{{order_id}} has shipped! Track it at {{url}}',
'Your order #{{order_id}} has been delivered. Thank you for your purchase!'
],
subscriberOptIn: true,
subscriberOptOut: true,
subscriberHelp: true,
numberPooling: false,
directLending: false,
embeddedLink: true,
embeddedPhone: false,
affiliateMarketing: false,
ageGated: false
})
};
fetch('https://api.zavu.dev/v1/10dlc/campaigns', 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.zavu.dev/v1/10dlc/campaigns",
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([
'brandId' => 'brand_abc123',
'name' => 'Order Notifications',
'useCase' => 'ACCOUNT_NOTIFICATION',
'description' => 'Send order status updates and shipping notifications to customers who opted in.',
'sampleMessages' => [
'Hi {{name}}, your order #{{order_id}} has shipped! Track it at {{url}}',
'Your order #{{order_id}} has been delivered. Thank you for your purchase!'
],
'subscriberOptIn' => true,
'subscriberOptOut' => true,
'subscriberHelp' => true,
'numberPooling' => false,
'directLending' => false,
'embeddedLink' => true,
'embeddedPhone' => false,
'affiliateMarketing' => false,
'ageGated' => false
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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.zavu.dev/v1/10dlc/campaigns"
payload := strings.NewReader("{\n \"brandId\": \"brand_abc123\",\n \"name\": \"Order Notifications\",\n \"useCase\": \"ACCOUNT_NOTIFICATION\",\n \"description\": \"Send order status updates and shipping notifications to customers who opted in.\",\n \"sampleMessages\": [\n \"Hi {{name}}, your order #{{order_id}} has shipped! Track it at {{url}}\",\n \"Your order #{{order_id}} has been delivered. Thank you for your purchase!\"\n ],\n \"subscriberOptIn\": true,\n \"subscriberOptOut\": true,\n \"subscriberHelp\": true,\n \"numberPooling\": false,\n \"directLending\": false,\n \"embeddedLink\": true,\n \"embeddedPhone\": false,\n \"affiliateMarketing\": false,\n \"ageGated\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.zavu.dev/v1/10dlc/campaigns")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"brandId\": \"brand_abc123\",\n \"name\": \"Order Notifications\",\n \"useCase\": \"ACCOUNT_NOTIFICATION\",\n \"description\": \"Send order status updates and shipping notifications to customers who opted in.\",\n \"sampleMessages\": [\n \"Hi {{name}}, your order #{{order_id}} has shipped! Track it at {{url}}\",\n \"Your order #{{order_id}} has been delivered. Thank you for your purchase!\"\n ],\n \"subscriberOptIn\": true,\n \"subscriberOptOut\": true,\n \"subscriberHelp\": true,\n \"numberPooling\": false,\n \"directLending\": false,\n \"embeddedLink\": true,\n \"embeddedPhone\": false,\n \"affiliateMarketing\": false,\n \"ageGated\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.zavu.dev/v1/10dlc/campaigns")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"brandId\": \"brand_abc123\",\n \"name\": \"Order Notifications\",\n \"useCase\": \"ACCOUNT_NOTIFICATION\",\n \"description\": \"Send order status updates and shipping notifications to customers who opted in.\",\n \"sampleMessages\": [\n \"Hi {{name}}, your order #{{order_id}} has shipped! Track it at {{url}}\",\n \"Your order #{{order_id}} has been delivered. Thank you for your purchase!\"\n ],\n \"subscriberOptIn\": true,\n \"subscriberOptOut\": true,\n \"subscriberHelp\": true,\n \"numberPooling\": false,\n \"directLending\": false,\n \"embeddedLink\": true,\n \"embeddedPhone\": false,\n \"affiliateMarketing\": false,\n \"ageGated\": false\n}"
response = http.request(request)
puts response.read_body{
"campaign": {
"id": "<string>",
"brandId": "<string>",
"name": "Order Notifications",
"useCase": "ACCOUNT_NOTIFICATION",
"description": "<string>",
"sampleMessages": [
"<string>"
],
"subscriberOptIn": true,
"subscriberOptOut": true,
"subscriberHelp": true,
"numberPooling": true,
"directLending": true,
"embeddedLink": true,
"embeddedPhone": true,
"affiliateMarketing": true,
"ageGated": true,
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"subUseCases": [
"<string>"
],
"messageFlow": "<string>",
"helpMessage": "<string>",
"optInKeywords": [
"<string>"
],
"optOutKeywords": [
"<string>"
],
"dailyLimit": 123,
"failureReason": "<string>",
"registrationCostCents": 123,
"monthlyFeeCents": 123,
"submittedAt": "2023-11-07T05:31:56Z",
"approvedAt": "2023-11-07T05:31:56Z"
}
}{
"code": "invalid_request",
"message": "Phone number is invalid",
"details": {}
}{
"code": "invalid_request",
"message": "Phone number is invalid",
"details": {}
}{
"code": "invalid_request",
"message": "Phone number is invalid",
"details": {}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
ID of the brand to create this campaign under.
Maximum string length:
100Campaign use case (e.g., ACCOUNT_NOTIFICATION, MARKETING, 2FA).
Maximum string length:
50Maximum string length:
4096Required array length:
1 - 5 elementsMaximum string length:
1024Maximum string length:
2048Maximum string length:
500Maximum string length:
50Maximum string length:
50Response
Campaign created in draft status.
Show child attributes
Show child attributes
⌘I
Create 10DLC campaign
curl --request POST \
--url https://api.zavu.dev/v1/10dlc/campaigns \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"brandId": "brand_abc123",
"name": "Order Notifications",
"useCase": "ACCOUNT_NOTIFICATION",
"description": "Send order status updates and shipping notifications to customers who opted in.",
"sampleMessages": [
"Hi {{name}}, your order #{{order_id}} has shipped! Track it at {{url}}",
"Your order #{{order_id}} has been delivered. Thank you for your purchase!"
],
"subscriberOptIn": true,
"subscriberOptOut": true,
"subscriberHelp": true,
"numberPooling": false,
"directLending": false,
"embeddedLink": true,
"embeddedPhone": false,
"affiliateMarketing": false,
"ageGated": false
}
'import requests
url = "https://api.zavu.dev/v1/10dlc/campaigns"
payload = {
"brandId": "brand_abc123",
"name": "Order Notifications",
"useCase": "ACCOUNT_NOTIFICATION",
"description": "Send order status updates and shipping notifications to customers who opted in.",
"sampleMessages": ["Hi {{name}}, your order #{{order_id}} has shipped! Track it at {{url}}", "Your order #{{order_id}} has been delivered. Thank you for your purchase!"],
"subscriberOptIn": True,
"subscriberOptOut": True,
"subscriberHelp": True,
"numberPooling": False,
"directLending": False,
"embeddedLink": True,
"embeddedPhone": False,
"affiliateMarketing": False,
"ageGated": False
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
brandId: 'brand_abc123',
name: 'Order Notifications',
useCase: 'ACCOUNT_NOTIFICATION',
description: 'Send order status updates and shipping notifications to customers who opted in.',
sampleMessages: [
'Hi {{name}}, your order #{{order_id}} has shipped! Track it at {{url}}',
'Your order #{{order_id}} has been delivered. Thank you for your purchase!'
],
subscriberOptIn: true,
subscriberOptOut: true,
subscriberHelp: true,
numberPooling: false,
directLending: false,
embeddedLink: true,
embeddedPhone: false,
affiliateMarketing: false,
ageGated: false
})
};
fetch('https://api.zavu.dev/v1/10dlc/campaigns', 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.zavu.dev/v1/10dlc/campaigns",
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([
'brandId' => 'brand_abc123',
'name' => 'Order Notifications',
'useCase' => 'ACCOUNT_NOTIFICATION',
'description' => 'Send order status updates and shipping notifications to customers who opted in.',
'sampleMessages' => [
'Hi {{name}}, your order #{{order_id}} has shipped! Track it at {{url}}',
'Your order #{{order_id}} has been delivered. Thank you for your purchase!'
],
'subscriberOptIn' => true,
'subscriberOptOut' => true,
'subscriberHelp' => true,
'numberPooling' => false,
'directLending' => false,
'embeddedLink' => true,
'embeddedPhone' => false,
'affiliateMarketing' => false,
'ageGated' => false
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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.zavu.dev/v1/10dlc/campaigns"
payload := strings.NewReader("{\n \"brandId\": \"brand_abc123\",\n \"name\": \"Order Notifications\",\n \"useCase\": \"ACCOUNT_NOTIFICATION\",\n \"description\": \"Send order status updates and shipping notifications to customers who opted in.\",\n \"sampleMessages\": [\n \"Hi {{name}}, your order #{{order_id}} has shipped! Track it at {{url}}\",\n \"Your order #{{order_id}} has been delivered. Thank you for your purchase!\"\n ],\n \"subscriberOptIn\": true,\n \"subscriberOptOut\": true,\n \"subscriberHelp\": true,\n \"numberPooling\": false,\n \"directLending\": false,\n \"embeddedLink\": true,\n \"embeddedPhone\": false,\n \"affiliateMarketing\": false,\n \"ageGated\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.zavu.dev/v1/10dlc/campaigns")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"brandId\": \"brand_abc123\",\n \"name\": \"Order Notifications\",\n \"useCase\": \"ACCOUNT_NOTIFICATION\",\n \"description\": \"Send order status updates and shipping notifications to customers who opted in.\",\n \"sampleMessages\": [\n \"Hi {{name}}, your order #{{order_id}} has shipped! Track it at {{url}}\",\n \"Your order #{{order_id}} has been delivered. Thank you for your purchase!\"\n ],\n \"subscriberOptIn\": true,\n \"subscriberOptOut\": true,\n \"subscriberHelp\": true,\n \"numberPooling\": false,\n \"directLending\": false,\n \"embeddedLink\": true,\n \"embeddedPhone\": false,\n \"affiliateMarketing\": false,\n \"ageGated\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.zavu.dev/v1/10dlc/campaigns")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"brandId\": \"brand_abc123\",\n \"name\": \"Order Notifications\",\n \"useCase\": \"ACCOUNT_NOTIFICATION\",\n \"description\": \"Send order status updates and shipping notifications to customers who opted in.\",\n \"sampleMessages\": [\n \"Hi {{name}}, your order #{{order_id}} has shipped! Track it at {{url}}\",\n \"Your order #{{order_id}} has been delivered. Thank you for your purchase!\"\n ],\n \"subscriberOptIn\": true,\n \"subscriberOptOut\": true,\n \"subscriberHelp\": true,\n \"numberPooling\": false,\n \"directLending\": false,\n \"embeddedLink\": true,\n \"embeddedPhone\": false,\n \"affiliateMarketing\": false,\n \"ageGated\": false\n}"
response = http.request(request)
puts response.read_body{
"campaign": {
"id": "<string>",
"brandId": "<string>",
"name": "Order Notifications",
"useCase": "ACCOUNT_NOTIFICATION",
"description": "<string>",
"sampleMessages": [
"<string>"
],
"subscriberOptIn": true,
"subscriberOptOut": true,
"subscriberHelp": true,
"numberPooling": true,
"directLending": true,
"embeddedLink": true,
"embeddedPhone": true,
"affiliateMarketing": true,
"ageGated": true,
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"subUseCases": [
"<string>"
],
"messageFlow": "<string>",
"helpMessage": "<string>",
"optInKeywords": [
"<string>"
],
"optOutKeywords": [
"<string>"
],
"dailyLimit": 123,
"failureReason": "<string>",
"registrationCostCents": 123,
"monthlyFeeCents": 123,
"submittedAt": "2023-11-07T05:31:56Z",
"approvedAt": "2023-11-07T05:31:56Z"
}
}{
"code": "invalid_request",
"message": "Phone number is invalid",
"details": {}
}{
"code": "invalid_request",
"message": "Phone number is invalid",
"details": {}
}{
"code": "invalid_request",
"message": "Phone number is invalid",
"details": {}
}