Altera um template
curl --request PATCH \
--url https://kourio.app/v1/templates/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"fromName": "",
"fromAddress": "<string>",
"replyTo": "",
"subject": "<string>",
"previewText": "",
"blocks": [
{
"type": "heading",
"runs": [
{
"text": "<string>",
"bold": true,
"italic": true,
"color": "<string>",
"href": "<string>"
}
]
}
],
"style": {
"pageBackground": "#F4F4F5",
"pagePadding": 32,
"bodyBackground": "#FFFFFF",
"bodyText": "#18181B",
"bodyBorderColor": "#E4E4E7",
"accent": "#2F5CD8",
"width": 600,
"padding": 34,
"radius": 12,
"border": 1
}
}
'import requests
url = "https://kourio.app/v1/templates/{id}"
payload = {
"name": "<string>",
"fromName": "",
"fromAddress": "<string>",
"replyTo": "",
"subject": "<string>",
"previewText": "",
"blocks": [
{
"type": "heading",
"runs": [
{
"text": "<string>",
"bold": True,
"italic": True,
"color": "<string>",
"href": "<string>"
}
]
}
],
"style": {
"pageBackground": "#F4F4F5",
"pagePadding": 32,
"bodyBackground": "#FFFFFF",
"bodyText": "#18181B",
"bodyBorderColor": "#E4E4E7",
"accent": "#2F5CD8",
"width": 600,
"padding": 34,
"radius": 12,
"border": 1
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
fromName: '',
fromAddress: '<string>',
replyTo: '',
subject: '<string>',
previewText: '',
blocks: [
{
type: 'heading',
runs: [
{
text: '<string>',
bold: true,
italic: true,
color: '<string>',
href: '<string>'
}
]
}
],
style: {
pageBackground: '#F4F4F5',
pagePadding: 32,
bodyBackground: '#FFFFFF',
bodyText: '#18181B',
bodyBorderColor: '#E4E4E7',
accent: '#2F5CD8',
width: 600,
padding: 34,
radius: 12,
border: 1
}
})
};
fetch('https://kourio.app/v1/templates/{id}', 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/templates/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'fromName' => '',
'fromAddress' => '<string>',
'replyTo' => '',
'subject' => '<string>',
'previewText' => '',
'blocks' => [
[
'type' => 'heading',
'runs' => [
[
'text' => '<string>',
'bold' => true,
'italic' => true,
'color' => '<string>',
'href' => '<string>'
]
]
]
],
'style' => [
'pageBackground' => '#F4F4F5',
'pagePadding' => 32,
'bodyBackground' => '#FFFFFF',
'bodyText' => '#18181B',
'bodyBorderColor' => '#E4E4E7',
'accent' => '#2F5CD8',
'width' => 600,
'padding' => 34,
'radius' => 12,
'border' => 1
]
]),
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/templates/{id}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"fromName\": \"\",\n \"fromAddress\": \"<string>\",\n \"replyTo\": \"\",\n \"subject\": \"<string>\",\n \"previewText\": \"\",\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 \"style\": {\n \"pageBackground\": \"#F4F4F5\",\n \"pagePadding\": 32,\n \"bodyBackground\": \"#FFFFFF\",\n \"bodyText\": \"#18181B\",\n \"bodyBorderColor\": \"#E4E4E7\",\n \"accent\": \"#2F5CD8\",\n \"width\": 600,\n \"padding\": 34,\n \"radius\": 12,\n \"border\": 1\n }\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://kourio.app/v1/templates/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"fromName\": \"\",\n \"fromAddress\": \"<string>\",\n \"replyTo\": \"\",\n \"subject\": \"<string>\",\n \"previewText\": \"\",\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 \"style\": {\n \"pageBackground\": \"#F4F4F5\",\n \"pagePadding\": 32,\n \"bodyBackground\": \"#FFFFFF\",\n \"bodyText\": \"#18181B\",\n \"bodyBorderColor\": \"#E4E4E7\",\n \"accent\": \"#2F5CD8\",\n \"width\": 600,\n \"padding\": 34,\n \"radius\": 12,\n \"border\": 1\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://kourio.app/v1/templates/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"fromName\": \"\",\n \"fromAddress\": \"<string>\",\n \"replyTo\": \"\",\n \"subject\": \"<string>\",\n \"previewText\": \"\",\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 \"style\": {\n \"pageBackground\": \"#F4F4F5\",\n \"pagePadding\": 32,\n \"bodyBackground\": \"#FFFFFF\",\n \"bodyText\": \"#18181B\",\n \"bodyBorderColor\": \"#E4E4E7\",\n \"accent\": \"#2F5CD8\",\n \"width\": 600,\n \"padding\": 34,\n \"radius\": 12,\n \"border\": 1\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "<string>",
"name": "<string>",
"slug": "<string>",
"fromName": "<string>",
"fromAddress": "<string>",
"replyTo": "<string>",
"subject": "<string>",
"previewText": "<string>",
"blocks": [
{
"type": "heading",
"runs": [
{
"text": "<string>",
"bold": true,
"italic": true,
"color": "<string>",
"href": "<string>"
}
],
"align": "left"
}
],
"style": {
"pageBackground": "#F4F4F5",
"pagePadding": 32,
"bodyBackground": "#FFFFFF",
"bodyText": "#18181B",
"bodyBorderColor": "#E4E4E7",
"accent": "#2F5CD8",
"width": 600,
"padding": 34,
"radius": 12,
"border": 1
},
"variables": [
"<string>"
],
"createdAt": "<string>",
"updatedAt": "<string>",
"senderDomain": "<string>",
"senderDomainStatus": "PENDING"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"requestId": "<string>",
"details": [
{}
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"requestId": "<string>",
"details": [
{}
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"requestId": "<string>",
"details": [
{}
]
}
}Templates
Altera um template
Vale para o próximo envio. Mensagem já enfileirada leva a versão de quando entrou.
PATCH
/
v1
/
templates
/
{id}
Altera um template
curl --request PATCH \
--url https://kourio.app/v1/templates/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"fromName": "",
"fromAddress": "<string>",
"replyTo": "",
"subject": "<string>",
"previewText": "",
"blocks": [
{
"type": "heading",
"runs": [
{
"text": "<string>",
"bold": true,
"italic": true,
"color": "<string>",
"href": "<string>"
}
]
}
],
"style": {
"pageBackground": "#F4F4F5",
"pagePadding": 32,
"bodyBackground": "#FFFFFF",
"bodyText": "#18181B",
"bodyBorderColor": "#E4E4E7",
"accent": "#2F5CD8",
"width": 600,
"padding": 34,
"radius": 12,
"border": 1
}
}
'import requests
url = "https://kourio.app/v1/templates/{id}"
payload = {
"name": "<string>",
"fromName": "",
"fromAddress": "<string>",
"replyTo": "",
"subject": "<string>",
"previewText": "",
"blocks": [
{
"type": "heading",
"runs": [
{
"text": "<string>",
"bold": True,
"italic": True,
"color": "<string>",
"href": "<string>"
}
]
}
],
"style": {
"pageBackground": "#F4F4F5",
"pagePadding": 32,
"bodyBackground": "#FFFFFF",
"bodyText": "#18181B",
"bodyBorderColor": "#E4E4E7",
"accent": "#2F5CD8",
"width": 600,
"padding": 34,
"radius": 12,
"border": 1
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
fromName: '',
fromAddress: '<string>',
replyTo: '',
subject: '<string>',
previewText: '',
blocks: [
{
type: 'heading',
runs: [
{
text: '<string>',
bold: true,
italic: true,
color: '<string>',
href: '<string>'
}
]
}
],
style: {
pageBackground: '#F4F4F5',
pagePadding: 32,
bodyBackground: '#FFFFFF',
bodyText: '#18181B',
bodyBorderColor: '#E4E4E7',
accent: '#2F5CD8',
width: 600,
padding: 34,
radius: 12,
border: 1
}
})
};
fetch('https://kourio.app/v1/templates/{id}', 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/templates/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'fromName' => '',
'fromAddress' => '<string>',
'replyTo' => '',
'subject' => '<string>',
'previewText' => '',
'blocks' => [
[
'type' => 'heading',
'runs' => [
[
'text' => '<string>',
'bold' => true,
'italic' => true,
'color' => '<string>',
'href' => '<string>'
]
]
]
],
'style' => [
'pageBackground' => '#F4F4F5',
'pagePadding' => 32,
'bodyBackground' => '#FFFFFF',
'bodyText' => '#18181B',
'bodyBorderColor' => '#E4E4E7',
'accent' => '#2F5CD8',
'width' => 600,
'padding' => 34,
'radius' => 12,
'border' => 1
]
]),
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/templates/{id}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"fromName\": \"\",\n \"fromAddress\": \"<string>\",\n \"replyTo\": \"\",\n \"subject\": \"<string>\",\n \"previewText\": \"\",\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 \"style\": {\n \"pageBackground\": \"#F4F4F5\",\n \"pagePadding\": 32,\n \"bodyBackground\": \"#FFFFFF\",\n \"bodyText\": \"#18181B\",\n \"bodyBorderColor\": \"#E4E4E7\",\n \"accent\": \"#2F5CD8\",\n \"width\": 600,\n \"padding\": 34,\n \"radius\": 12,\n \"border\": 1\n }\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://kourio.app/v1/templates/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"fromName\": \"\",\n \"fromAddress\": \"<string>\",\n \"replyTo\": \"\",\n \"subject\": \"<string>\",\n \"previewText\": \"\",\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 \"style\": {\n \"pageBackground\": \"#F4F4F5\",\n \"pagePadding\": 32,\n \"bodyBackground\": \"#FFFFFF\",\n \"bodyText\": \"#18181B\",\n \"bodyBorderColor\": \"#E4E4E7\",\n \"accent\": \"#2F5CD8\",\n \"width\": 600,\n \"padding\": 34,\n \"radius\": 12,\n \"border\": 1\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://kourio.app/v1/templates/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"fromName\": \"\",\n \"fromAddress\": \"<string>\",\n \"replyTo\": \"\",\n \"subject\": \"<string>\",\n \"previewText\": \"\",\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 \"style\": {\n \"pageBackground\": \"#F4F4F5\",\n \"pagePadding\": 32,\n \"bodyBackground\": \"#FFFFFF\",\n \"bodyText\": \"#18181B\",\n \"bodyBorderColor\": \"#E4E4E7\",\n \"accent\": \"#2F5CD8\",\n \"width\": 600,\n \"padding\": 34,\n \"radius\": 12,\n \"border\": 1\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "<string>",
"name": "<string>",
"slug": "<string>",
"fromName": "<string>",
"fromAddress": "<string>",
"replyTo": "<string>",
"subject": "<string>",
"previewText": "<string>",
"blocks": [
{
"type": "heading",
"runs": [
{
"text": "<string>",
"bold": true,
"italic": true,
"color": "<string>",
"href": "<string>"
}
],
"align": "left"
}
],
"style": {
"pageBackground": "#F4F4F5",
"pagePadding": 32,
"bodyBackground": "#FFFFFF",
"bodyText": "#18181B",
"bodyBorderColor": "#E4E4E7",
"accent": "#2F5CD8",
"width": 600,
"padding": 34,
"radius": 12,
"border": 1
},
"variables": [
"<string>"
],
"createdAt": "<string>",
"updatedAt": "<string>",
"senderDomain": "<string>",
"senderDomainStatus": "PENDING"
}
}{
"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.
Parâmetros de caminho
Corpo
application/json
Required string length:
1 - 120Maximum string length:
120Required string length:
3 - 320Required string length:
3 - 320Required string length:
1 - 998Maximum string length:
200Maximum 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
Show child attributes
Show child attributes
Resposta
A requisição foi bem-sucedida.
Show child attributes
Show child attributes
⌘I