Create and Execute a campaign
curl --request POST \
--url https://api.sakari.io/v1/accounts/{accountId}/quickcampaigns \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"groupId": "<string>",
"listId": "<string>",
"message": {
"message": "<string>",
"media": [
{
"url": "<string>",
"type": "<string>",
"name": "<string>",
"filename": "<string>"
}
]
},
"sendAt": "2023-11-07T05:31:56Z"
}
'import requests
url = "https://api.sakari.io/v1/accounts/{accountId}/quickcampaigns"
payload = {
"name": "<string>",
"groupId": "<string>",
"listId": "<string>",
"message": {
"message": "<string>",
"media": [
{
"url": "<string>",
"type": "<string>",
"name": "<string>",
"filename": "<string>"
}
]
},
"sendAt": "2023-11-07T05:31:56Z"
}
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({
name: '<string>',
groupId: '<string>',
listId: '<string>',
message: {
message: '<string>',
media: [{url: '<string>', type: '<string>', name: '<string>', filename: '<string>'}]
},
sendAt: '2023-11-07T05:31:56Z'
})
};
fetch('https://api.sakari.io/v1/accounts/{accountId}/quickcampaigns', 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.sakari.io/v1/accounts/{accountId}/quickcampaigns",
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([
'name' => '<string>',
'groupId' => '<string>',
'listId' => '<string>',
'message' => [
'message' => '<string>',
'media' => [
[
'url' => '<string>',
'type' => '<string>',
'name' => '<string>',
'filename' => '<string>'
]
]
],
'sendAt' => '2023-11-07T05:31:56Z'
]),
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.sakari.io/v1/accounts/{accountId}/quickcampaigns"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"groupId\": \"<string>\",\n \"listId\": \"<string>\",\n \"message\": {\n \"message\": \"<string>\",\n \"media\": [\n {\n \"url\": \"<string>\",\n \"type\": \"<string>\",\n \"name\": \"<string>\",\n \"filename\": \"<string>\"\n }\n ]\n },\n \"sendAt\": \"2023-11-07T05:31:56Z\"\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.sakari.io/v1/accounts/{accountId}/quickcampaigns")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"groupId\": \"<string>\",\n \"listId\": \"<string>\",\n \"message\": {\n \"message\": \"<string>\",\n \"media\": [\n {\n \"url\": \"<string>\",\n \"type\": \"<string>\",\n \"name\": \"<string>\",\n \"filename\": \"<string>\"\n }\n ]\n },\n \"sendAt\": \"2023-11-07T05:31:56Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sakari.io/v1/accounts/{accountId}/quickcampaigns")
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 \"name\": \"<string>\",\n \"groupId\": \"<string>\",\n \"listId\": \"<string>\",\n \"message\": {\n \"message\": \"<string>\",\n \"media\": [\n {\n \"url\": \"<string>\",\n \"type\": \"<string>\",\n \"name\": \"<string>\",\n \"filename\": \"<string>\"\n }\n ]\n },\n \"sendAt\": \"2023-11-07T05:31:56Z\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"campaign": {
"id": "<string>",
"name": "<string>",
"description": "<string>",
"fieldMappings": [
{
"attribute": "<string>",
"column": "<string>",
"mandatory": true
}
],
"filters": {
"list": {
"id": "<string>",
"name": "<string>",
"source": {
"id": "<string>",
"integration": "<string>",
"lastSynced": "<string>"
},
"keyword": "<string>",
"doubleOptIn": {
"enabled": true,
"prompt": "<string>"
},
"filter": {
"q": "<string>",
"attributes": [
{
"attribute": "<string>",
"comparator": "<string>",
"value": [
"<string>"
]
}
],
"list": "<string>",
"valid": true,
"invalid": true,
"blocked": true,
"unblocked": true,
"optIn": true
},
"optInConfirmation": "<string>"
},
"q": "<string>",
"attributes": [
{
"attribute": "<string>",
"comparator": "<string>",
"value": [
"<string>"
]
}
],
"tags": [
{
"tag": "<string>",
"visible": true
}
]
},
"media": [
{
"url": "<string>",
"type": "<string>",
"name": "<string>",
"filename": "<string>"
}
],
"phoneNumberFilter": {
"group": {
"id": "<string>"
}
},
"schedule": {
"timezone": "<string>",
"cron": "<string>"
},
"nextExecution": "<string>",
"reporting": {
"destination": "<string>",
"when": "<string>",
"delay": "<string>",
"unit": "<string>"
},
"template": "<string>",
"trigger": {
"code": "<string>",
"name": "<string>"
},
"created": {
"at": "2023-11-07T05:31:56Z",
"by": {
"id": "<string>",
"name": "Joe Bloggs",
"firstName": "Joe",
"lastName": "Bloggs",
"email": "joe@bloggs.com",
"source": "<string>",
"subSource": "<string>"
}
},
"updated": {
"at": "2023-11-07T05:31:56Z",
"by": {
"id": "<string>",
"name": "Joe Bloggs",
"firstName": "Joe",
"lastName": "Bloggs",
"email": "joe@bloggs.com",
"source": "<string>",
"subSource": "<string>"
}
},
"paused": "<string>",
"lastJob": {
"id": "<string>",
"submitted": 123,
"status": "<string>",
"price": 123,
"failures": 123,
"invalid": [
{}
],
"created": {
"at": "2023-11-07T05:31:56Z",
"by": {
"id": "<string>",
"name": "Joe Bloggs",
"firstName": "Joe",
"lastName": "Bloggs",
"email": "joe@bloggs.com",
"source": "<string>",
"subSource": "<string>"
}
}
}
},
"job": {
"id": "<string>",
"submitted": 123,
"status": "<string>",
"price": 123,
"failures": 123,
"invalid": [
{}
],
"created": {
"at": "2023-11-07T05:31:56Z",
"by": {
"id": "<string>",
"name": "Joe Bloggs",
"firstName": "Joe",
"lastName": "Bloggs",
"email": "joe@bloggs.com",
"source": "<string>",
"subSource": "<string>"
}
}
}
}
}{
"success": true,
"error": {
"code": "CONT-010",
"description": "Contact has requested no further communication"
}
}{
"success": true,
"error": {
"code": "CONT-010",
"description": "Contact has requested no further communication"
}
}campaigns
Create and Execute a campaign
POST
/
v1
/
accounts
/
{accountId}
/
quickcampaigns
Create and Execute a campaign
curl --request POST \
--url https://api.sakari.io/v1/accounts/{accountId}/quickcampaigns \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"groupId": "<string>",
"listId": "<string>",
"message": {
"message": "<string>",
"media": [
{
"url": "<string>",
"type": "<string>",
"name": "<string>",
"filename": "<string>"
}
]
},
"sendAt": "2023-11-07T05:31:56Z"
}
'import requests
url = "https://api.sakari.io/v1/accounts/{accountId}/quickcampaigns"
payload = {
"name": "<string>",
"groupId": "<string>",
"listId": "<string>",
"message": {
"message": "<string>",
"media": [
{
"url": "<string>",
"type": "<string>",
"name": "<string>",
"filename": "<string>"
}
]
},
"sendAt": "2023-11-07T05:31:56Z"
}
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({
name: '<string>',
groupId: '<string>',
listId: '<string>',
message: {
message: '<string>',
media: [{url: '<string>', type: '<string>', name: '<string>', filename: '<string>'}]
},
sendAt: '2023-11-07T05:31:56Z'
})
};
fetch('https://api.sakari.io/v1/accounts/{accountId}/quickcampaigns', 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.sakari.io/v1/accounts/{accountId}/quickcampaigns",
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([
'name' => '<string>',
'groupId' => '<string>',
'listId' => '<string>',
'message' => [
'message' => '<string>',
'media' => [
[
'url' => '<string>',
'type' => '<string>',
'name' => '<string>',
'filename' => '<string>'
]
]
],
'sendAt' => '2023-11-07T05:31:56Z'
]),
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.sakari.io/v1/accounts/{accountId}/quickcampaigns"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"groupId\": \"<string>\",\n \"listId\": \"<string>\",\n \"message\": {\n \"message\": \"<string>\",\n \"media\": [\n {\n \"url\": \"<string>\",\n \"type\": \"<string>\",\n \"name\": \"<string>\",\n \"filename\": \"<string>\"\n }\n ]\n },\n \"sendAt\": \"2023-11-07T05:31:56Z\"\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.sakari.io/v1/accounts/{accountId}/quickcampaigns")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"groupId\": \"<string>\",\n \"listId\": \"<string>\",\n \"message\": {\n \"message\": \"<string>\",\n \"media\": [\n {\n \"url\": \"<string>\",\n \"type\": \"<string>\",\n \"name\": \"<string>\",\n \"filename\": \"<string>\"\n }\n ]\n },\n \"sendAt\": \"2023-11-07T05:31:56Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sakari.io/v1/accounts/{accountId}/quickcampaigns")
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 \"name\": \"<string>\",\n \"groupId\": \"<string>\",\n \"listId\": \"<string>\",\n \"message\": {\n \"message\": \"<string>\",\n \"media\": [\n {\n \"url\": \"<string>\",\n \"type\": \"<string>\",\n \"name\": \"<string>\",\n \"filename\": \"<string>\"\n }\n ]\n },\n \"sendAt\": \"2023-11-07T05:31:56Z\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"campaign": {
"id": "<string>",
"name": "<string>",
"description": "<string>",
"fieldMappings": [
{
"attribute": "<string>",
"column": "<string>",
"mandatory": true
}
],
"filters": {
"list": {
"id": "<string>",
"name": "<string>",
"source": {
"id": "<string>",
"integration": "<string>",
"lastSynced": "<string>"
},
"keyword": "<string>",
"doubleOptIn": {
"enabled": true,
"prompt": "<string>"
},
"filter": {
"q": "<string>",
"attributes": [
{
"attribute": "<string>",
"comparator": "<string>",
"value": [
"<string>"
]
}
],
"list": "<string>",
"valid": true,
"invalid": true,
"blocked": true,
"unblocked": true,
"optIn": true
},
"optInConfirmation": "<string>"
},
"q": "<string>",
"attributes": [
{
"attribute": "<string>",
"comparator": "<string>",
"value": [
"<string>"
]
}
],
"tags": [
{
"tag": "<string>",
"visible": true
}
]
},
"media": [
{
"url": "<string>",
"type": "<string>",
"name": "<string>",
"filename": "<string>"
}
],
"phoneNumberFilter": {
"group": {
"id": "<string>"
}
},
"schedule": {
"timezone": "<string>",
"cron": "<string>"
},
"nextExecution": "<string>",
"reporting": {
"destination": "<string>",
"when": "<string>",
"delay": "<string>",
"unit": "<string>"
},
"template": "<string>",
"trigger": {
"code": "<string>",
"name": "<string>"
},
"created": {
"at": "2023-11-07T05:31:56Z",
"by": {
"id": "<string>",
"name": "Joe Bloggs",
"firstName": "Joe",
"lastName": "Bloggs",
"email": "joe@bloggs.com",
"source": "<string>",
"subSource": "<string>"
}
},
"updated": {
"at": "2023-11-07T05:31:56Z",
"by": {
"id": "<string>",
"name": "Joe Bloggs",
"firstName": "Joe",
"lastName": "Bloggs",
"email": "joe@bloggs.com",
"source": "<string>",
"subSource": "<string>"
}
},
"paused": "<string>",
"lastJob": {
"id": "<string>",
"submitted": 123,
"status": "<string>",
"price": 123,
"failures": 123,
"invalid": [
{}
],
"created": {
"at": "2023-11-07T05:31:56Z",
"by": {
"id": "<string>",
"name": "Joe Bloggs",
"firstName": "Joe",
"lastName": "Bloggs",
"email": "joe@bloggs.com",
"source": "<string>",
"subSource": "<string>"
}
}
}
},
"job": {
"id": "<string>",
"submitted": 123,
"status": "<string>",
"price": 123,
"failures": 123,
"invalid": [
{}
],
"created": {
"at": "2023-11-07T05:31:56Z",
"by": {
"id": "<string>",
"name": "Joe Bloggs",
"firstName": "Joe",
"lastName": "Bloggs",
"email": "joe@bloggs.com",
"source": "<string>",
"subSource": "<string>"
}
}
}
}
}{
"success": true,
"error": {
"code": "CONT-010",
"description": "Contact has requested no further communication"
}
}{
"success": true,
"error": {
"code": "CONT-010",
"description": "Contact has requested no further communication"
}
}Authorizations
The access token received from the authorization server in the OAuth 2.0 flow.
Path Parameters
Account to apply operations to
Body
application/json
⌘I