Cria e enfileira uma campanha
curl --request POST \
--url https://kourio.app/v1/campaigns \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"listId": "<string>",
"segmentId": "<string>",
"from": "<string>",
"replyTo": "<string>",
"templateId": "<string>",
"blocks": [
{
"type": "heading",
"runs": [
{
"text": "<string>",
"bold": true,
"italic": true,
"color": "<string>",
"href": "<string>"
}
]
}
],
"previewText": "<string>",
"subject": "<string>",
"html": "<string>",
"text": "<string>"
}
'import requests
url = "https://kourio.app/v1/campaigns"
payload = {
"name": "<string>",
"listId": "<string>",
"segmentId": "<string>",
"from": "<string>",
"replyTo": "<string>",
"templateId": "<string>",
"blocks": [
{
"type": "heading",
"runs": [
{
"text": "<string>",
"bold": True,
"italic": True,
"color": "<string>",
"href": "<string>"
}
]
}
],
"previewText": "<string>",
"subject": "<string>",
"html": "<string>",
"text": "<string>"
}
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>',
listId: '<string>',
segmentId: '<string>',
from: '<string>',
replyTo: '<string>',
templateId: '<string>',
blocks: [
{
type: 'heading',
runs: [
{
text: '<string>',
bold: true,
italic: true,
color: '<string>',
href: '<string>'
}
]
}
],
previewText: '<string>',
subject: '<string>',
html: '<string>',
text: '<string>'
})
};
fetch('https://kourio.app/v1/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://kourio.app/v1/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([
'name' => '<string>',
'listId' => '<string>',
'segmentId' => '<string>',
'from' => '<string>',
'replyTo' => '<string>',
'templateId' => '<string>',
'blocks' => [
[
'type' => 'heading',
'runs' => [
[
'text' => '<string>',
'bold' => true,
'italic' => true,
'color' => '<string>',
'href' => '<string>'
]
]
]
],
'previewText' => '<string>',
'subject' => '<string>',
'html' => '<string>',
'text' => '<string>'
]),
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://kourio.app/v1/campaigns"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"listId\": \"<string>\",\n \"segmentId\": \"<string>\",\n \"from\": \"<string>\",\n \"replyTo\": \"<string>\",\n \"templateId\": \"<string>\",\n \"blocks\": [\n {\n \"type\": \"heading\",\n \"runs\": [\n {\n \"text\": \"<string>\",\n \"bold\": true,\n \"italic\": true,\n \"color\": \"<string>\",\n \"href\": \"<string>\"\n }\n ]\n }\n ],\n \"previewText\": \"<string>\",\n \"subject\": \"<string>\",\n \"html\": \"<string>\",\n \"text\": \"<string>\"\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://kourio.app/v1/campaigns")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"listId\": \"<string>\",\n \"segmentId\": \"<string>\",\n \"from\": \"<string>\",\n \"replyTo\": \"<string>\",\n \"templateId\": \"<string>\",\n \"blocks\": [\n {\n \"type\": \"heading\",\n \"runs\": [\n {\n \"text\": \"<string>\",\n \"bold\": true,\n \"italic\": true,\n \"color\": \"<string>\",\n \"href\": \"<string>\"\n }\n ]\n }\n ],\n \"previewText\": \"<string>\",\n \"subject\": \"<string>\",\n \"html\": \"<string>\",\n \"text\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://kourio.app/v1/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 \"name\": \"<string>\",\n \"listId\": \"<string>\",\n \"segmentId\": \"<string>\",\n \"from\": \"<string>\",\n \"replyTo\": \"<string>\",\n \"templateId\": \"<string>\",\n \"blocks\": [\n {\n \"type\": \"heading\",\n \"runs\": [\n {\n \"text\": \"<string>\",\n \"bold\": true,\n \"italic\": true,\n \"color\": \"<string>\",\n \"href\": \"<string>\"\n }\n ]\n }\n ],\n \"previewText\": \"<string>\",\n \"subject\": \"<string>\",\n \"html\": \"<string>\",\n \"text\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "<string>",
"status": "PENDING",
"recipientCount": 123,
"estimatedDays": 123
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"requestId": "<string>",
"details": [
{}
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"requestId": "<string>",
"details": [
{}
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"requestId": "<string>",
"details": [
{}
]
}
}Campanhas
Cria e enfileira uma campanha
Envie para uma lista ou para um segmento, nunca os dois. A resposta traz quantos destinatários ela encontrou e em quantos dias ela sai no teto de aquecimento de hoje — o teto é da plataforma inteira, não da sua conta.
Sai uma mensagem por pessoa, e não uma para todos: o link de descadastro é cabeçalho da mensagem, então uma cópia para cinquenta levaria o mesmo link e quarenta e nove botões descadastrariam um estranho.
POST
/
v1
/
campaigns
Cria e enfileira uma campanha
curl --request POST \
--url https://kourio.app/v1/campaigns \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"listId": "<string>",
"segmentId": "<string>",
"from": "<string>",
"replyTo": "<string>",
"templateId": "<string>",
"blocks": [
{
"type": "heading",
"runs": [
{
"text": "<string>",
"bold": true,
"italic": true,
"color": "<string>",
"href": "<string>"
}
]
}
],
"previewText": "<string>",
"subject": "<string>",
"html": "<string>",
"text": "<string>"
}
'import requests
url = "https://kourio.app/v1/campaigns"
payload = {
"name": "<string>",
"listId": "<string>",
"segmentId": "<string>",
"from": "<string>",
"replyTo": "<string>",
"templateId": "<string>",
"blocks": [
{
"type": "heading",
"runs": [
{
"text": "<string>",
"bold": True,
"italic": True,
"color": "<string>",
"href": "<string>"
}
]
}
],
"previewText": "<string>",
"subject": "<string>",
"html": "<string>",
"text": "<string>"
}
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>',
listId: '<string>',
segmentId: '<string>',
from: '<string>',
replyTo: '<string>',
templateId: '<string>',
blocks: [
{
type: 'heading',
runs: [
{
text: '<string>',
bold: true,
italic: true,
color: '<string>',
href: '<string>'
}
]
}
],
previewText: '<string>',
subject: '<string>',
html: '<string>',
text: '<string>'
})
};
fetch('https://kourio.app/v1/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://kourio.app/v1/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([
'name' => '<string>',
'listId' => '<string>',
'segmentId' => '<string>',
'from' => '<string>',
'replyTo' => '<string>',
'templateId' => '<string>',
'blocks' => [
[
'type' => 'heading',
'runs' => [
[
'text' => '<string>',
'bold' => true,
'italic' => true,
'color' => '<string>',
'href' => '<string>'
]
]
]
],
'previewText' => '<string>',
'subject' => '<string>',
'html' => '<string>',
'text' => '<string>'
]),
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://kourio.app/v1/campaigns"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"listId\": \"<string>\",\n \"segmentId\": \"<string>\",\n \"from\": \"<string>\",\n \"replyTo\": \"<string>\",\n \"templateId\": \"<string>\",\n \"blocks\": [\n {\n \"type\": \"heading\",\n \"runs\": [\n {\n \"text\": \"<string>\",\n \"bold\": true,\n \"italic\": true,\n \"color\": \"<string>\",\n \"href\": \"<string>\"\n }\n ]\n }\n ],\n \"previewText\": \"<string>\",\n \"subject\": \"<string>\",\n \"html\": \"<string>\",\n \"text\": \"<string>\"\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://kourio.app/v1/campaigns")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"listId\": \"<string>\",\n \"segmentId\": \"<string>\",\n \"from\": \"<string>\",\n \"replyTo\": \"<string>\",\n \"templateId\": \"<string>\",\n \"blocks\": [\n {\n \"type\": \"heading\",\n \"runs\": [\n {\n \"text\": \"<string>\",\n \"bold\": true,\n \"italic\": true,\n \"color\": \"<string>\",\n \"href\": \"<string>\"\n }\n ]\n }\n ],\n \"previewText\": \"<string>\",\n \"subject\": \"<string>\",\n \"html\": \"<string>\",\n \"text\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://kourio.app/v1/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 \"name\": \"<string>\",\n \"listId\": \"<string>\",\n \"segmentId\": \"<string>\",\n \"from\": \"<string>\",\n \"replyTo\": \"<string>\",\n \"templateId\": \"<string>\",\n \"blocks\": [\n {\n \"type\": \"heading\",\n \"runs\": [\n {\n \"text\": \"<string>\",\n \"bold\": true,\n \"italic\": true,\n \"color\": \"<string>\",\n \"href\": \"<string>\"\n }\n ]\n }\n ],\n \"previewText\": \"<string>\",\n \"subject\": \"<string>\",\n \"html\": \"<string>\",\n \"text\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "<string>",
"status": "PENDING",
"recipientCount": 123,
"estimatedDays": 123
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"requestId": "<string>",
"details": [
{}
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"requestId": "<string>",
"details": [
{}
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"requestId": "<string>",
"details": [
{}
]
}
}Autorizações
Sua chave de API.
Corpo
application/json
Required string length:
1 - 120Required string length:
1 - 64Required string length:
1 - 64Required string length:
3 - 384Required string length:
3 - 384Required string length:
1 - 64Maximum array length:
60- Option 1
- Option 2
- Option 3
- Option 4
- Option 5
- Option 6
- Option 7
- Option 8
- Option 9
Show child attributes
Show child attributes
Maximum string length:
200Required string length:
1 - 998Maximum string length:
1048576Maximum string length:
1048576Resposta
A requisição foi aceita, e o trabalho acontece depois dela.
Show child attributes
Show child attributes
⌘I