Crear Plantilla
curl --request POST \
--url https://api.plazbot.com/api/template \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-workspace-id: <x-workspace-id>' \
--data '
{
"workspaceId": "<string>",
"userId": "<string>",
"elementName": "<string>",
"languageCode": "<string>",
"category": "<string>",
"templateType": "<string>",
"components": [
{
"type": "<string>",
"format": "<string>",
"text": "<string>",
"buttons": [
{
"type": "<string>",
"text": "<string>",
"phone_number": "<string>",
"url": "<string>",
"tagIds": [
"<string>"
],
"segmentationIds": [
"<string>"
],
"phaseIds": [
"<string>"
],
"agentIds": [
"<string>"
]
}
],
"variables": [
{
"variable": "<string>",
"example": "<string>"
}
]
}
]
}
'import requests
url = "https://api.plazbot.com/api/template"
payload = {
"workspaceId": "<string>",
"userId": "<string>",
"elementName": "<string>",
"languageCode": "<string>",
"category": "<string>",
"templateType": "<string>",
"components": [
{
"type": "<string>",
"format": "<string>",
"text": "<string>",
"buttons": [
{
"type": "<string>",
"text": "<string>",
"phone_number": "<string>",
"url": "<string>",
"tagIds": ["<string>"],
"segmentationIds": ["<string>"],
"phaseIds": ["<string>"],
"agentIds": ["<string>"]
}
],
"variables": [
{
"variable": "<string>",
"example": "<string>"
}
]
}
]
}
headers = {
"x-workspace-id": "<x-workspace-id>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-workspace-id': '<x-workspace-id>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
workspaceId: '<string>',
userId: '<string>',
elementName: '<string>',
languageCode: '<string>',
category: '<string>',
templateType: '<string>',
components: [
{
type: '<string>',
format: '<string>',
text: '<string>',
buttons: [
{
type: '<string>',
text: '<string>',
phone_number: '<string>',
url: '<string>',
tagIds: ['<string>'],
segmentationIds: ['<string>'],
phaseIds: ['<string>'],
agentIds: ['<string>']
}
],
variables: [{variable: '<string>', example: '<string>'}]
}
]
})
};
fetch('https://api.plazbot.com/api/template', 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.plazbot.com/api/template",
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([
'workspaceId' => '<string>',
'userId' => '<string>',
'elementName' => '<string>',
'languageCode' => '<string>',
'category' => '<string>',
'templateType' => '<string>',
'components' => [
[
'type' => '<string>',
'format' => '<string>',
'text' => '<string>',
'buttons' => [
[
'type' => '<string>',
'text' => '<string>',
'phone_number' => '<string>',
'url' => '<string>',
'tagIds' => [
'<string>'
],
'segmentationIds' => [
'<string>'
],
'phaseIds' => [
'<string>'
],
'agentIds' => [
'<string>'
]
]
],
'variables' => [
[
'variable' => '<string>',
'example' => '<string>'
]
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"x-workspace-id: <x-workspace-id>"
],
]);
$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.plazbot.com/api/template"
payload := strings.NewReader("{\n \"workspaceId\": \"<string>\",\n \"userId\": \"<string>\",\n \"elementName\": \"<string>\",\n \"languageCode\": \"<string>\",\n \"category\": \"<string>\",\n \"templateType\": \"<string>\",\n \"components\": [\n {\n \"type\": \"<string>\",\n \"format\": \"<string>\",\n \"text\": \"<string>\",\n \"buttons\": [\n {\n \"type\": \"<string>\",\n \"text\": \"<string>\",\n \"phone_number\": \"<string>\",\n \"url\": \"<string>\",\n \"tagIds\": [\n \"<string>\"\n ],\n \"segmentationIds\": [\n \"<string>\"\n ],\n \"phaseIds\": [\n \"<string>\"\n ],\n \"agentIds\": [\n \"<string>\"\n ]\n }\n ],\n \"variables\": [\n {\n \"variable\": \"<string>\",\n \"example\": \"<string>\"\n }\n ]\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-workspace-id", "<x-workspace-id>")
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.plazbot.com/api/template")
.header("x-workspace-id", "<x-workspace-id>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"workspaceId\": \"<string>\",\n \"userId\": \"<string>\",\n \"elementName\": \"<string>\",\n \"languageCode\": \"<string>\",\n \"category\": \"<string>\",\n \"templateType\": \"<string>\",\n \"components\": [\n {\n \"type\": \"<string>\",\n \"format\": \"<string>\",\n \"text\": \"<string>\",\n \"buttons\": [\n {\n \"type\": \"<string>\",\n \"text\": \"<string>\",\n \"phone_number\": \"<string>\",\n \"url\": \"<string>\",\n \"tagIds\": [\n \"<string>\"\n ],\n \"segmentationIds\": [\n \"<string>\"\n ],\n \"phaseIds\": [\n \"<string>\"\n ],\n \"agentIds\": [\n \"<string>\"\n ]\n }\n ],\n \"variables\": [\n {\n \"variable\": \"<string>\",\n \"example\": \"<string>\"\n }\n ]\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.plazbot.com/api/template")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-workspace-id"] = '<x-workspace-id>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"workspaceId\": \"<string>\",\n \"userId\": \"<string>\",\n \"elementName\": \"<string>\",\n \"languageCode\": \"<string>\",\n \"category\": \"<string>\",\n \"templateType\": \"<string>\",\n \"components\": [\n {\n \"type\": \"<string>\",\n \"format\": \"<string>\",\n \"text\": \"<string>\",\n \"buttons\": [\n {\n \"type\": \"<string>\",\n \"text\": \"<string>\",\n \"phone_number\": \"<string>\",\n \"url\": \"<string>\",\n \"tagIds\": [\n \"<string>\"\n ],\n \"segmentationIds\": [\n \"<string>\"\n ],\n \"phaseIds\": [\n \"<string>\"\n ],\n \"agentIds\": [\n \"<string>\"\n ]\n }\n ],\n \"variables\": [\n {\n \"variable\": \"<string>\",\n \"example\": \"<string>\"\n }\n ]\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"code": 123,
"errorCode": "<string>",
"message": "<string>",
"data": {
"plantilla": {
"id": "<string>",
"elementName": "<string>",
"status": "<string>"
}
}
}{
"success": true,
"code": 123,
"message": "<string>",
"errorCode": "<string>"
}{
"success": true,
"code": 123,
"message": "<string>",
"errorCode": "<string>"
}{
"success": true,
"code": 123,
"message": "<string>",
"errorCode": "<string>"
}{
"success": true,
"code": 123,
"message": "<string>",
"errorCode": "<string>"
}Template
Crear Plantilla
Servicio para crear una nueva plantilla de WhatsApp. La plantilla sera enviada a Meta para aprobacion.
POST
/
api
/
template
Crear Plantilla
curl --request POST \
--url https://api.plazbot.com/api/template \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-workspace-id: <x-workspace-id>' \
--data '
{
"workspaceId": "<string>",
"userId": "<string>",
"elementName": "<string>",
"languageCode": "<string>",
"category": "<string>",
"templateType": "<string>",
"components": [
{
"type": "<string>",
"format": "<string>",
"text": "<string>",
"buttons": [
{
"type": "<string>",
"text": "<string>",
"phone_number": "<string>",
"url": "<string>",
"tagIds": [
"<string>"
],
"segmentationIds": [
"<string>"
],
"phaseIds": [
"<string>"
],
"agentIds": [
"<string>"
]
}
],
"variables": [
{
"variable": "<string>",
"example": "<string>"
}
]
}
]
}
'import requests
url = "https://api.plazbot.com/api/template"
payload = {
"workspaceId": "<string>",
"userId": "<string>",
"elementName": "<string>",
"languageCode": "<string>",
"category": "<string>",
"templateType": "<string>",
"components": [
{
"type": "<string>",
"format": "<string>",
"text": "<string>",
"buttons": [
{
"type": "<string>",
"text": "<string>",
"phone_number": "<string>",
"url": "<string>",
"tagIds": ["<string>"],
"segmentationIds": ["<string>"],
"phaseIds": ["<string>"],
"agentIds": ["<string>"]
}
],
"variables": [
{
"variable": "<string>",
"example": "<string>"
}
]
}
]
}
headers = {
"x-workspace-id": "<x-workspace-id>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-workspace-id': '<x-workspace-id>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
workspaceId: '<string>',
userId: '<string>',
elementName: '<string>',
languageCode: '<string>',
category: '<string>',
templateType: '<string>',
components: [
{
type: '<string>',
format: '<string>',
text: '<string>',
buttons: [
{
type: '<string>',
text: '<string>',
phone_number: '<string>',
url: '<string>',
tagIds: ['<string>'],
segmentationIds: ['<string>'],
phaseIds: ['<string>'],
agentIds: ['<string>']
}
],
variables: [{variable: '<string>', example: '<string>'}]
}
]
})
};
fetch('https://api.plazbot.com/api/template', 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.plazbot.com/api/template",
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([
'workspaceId' => '<string>',
'userId' => '<string>',
'elementName' => '<string>',
'languageCode' => '<string>',
'category' => '<string>',
'templateType' => '<string>',
'components' => [
[
'type' => '<string>',
'format' => '<string>',
'text' => '<string>',
'buttons' => [
[
'type' => '<string>',
'text' => '<string>',
'phone_number' => '<string>',
'url' => '<string>',
'tagIds' => [
'<string>'
],
'segmentationIds' => [
'<string>'
],
'phaseIds' => [
'<string>'
],
'agentIds' => [
'<string>'
]
]
],
'variables' => [
[
'variable' => '<string>',
'example' => '<string>'
]
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"x-workspace-id: <x-workspace-id>"
],
]);
$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.plazbot.com/api/template"
payload := strings.NewReader("{\n \"workspaceId\": \"<string>\",\n \"userId\": \"<string>\",\n \"elementName\": \"<string>\",\n \"languageCode\": \"<string>\",\n \"category\": \"<string>\",\n \"templateType\": \"<string>\",\n \"components\": [\n {\n \"type\": \"<string>\",\n \"format\": \"<string>\",\n \"text\": \"<string>\",\n \"buttons\": [\n {\n \"type\": \"<string>\",\n \"text\": \"<string>\",\n \"phone_number\": \"<string>\",\n \"url\": \"<string>\",\n \"tagIds\": [\n \"<string>\"\n ],\n \"segmentationIds\": [\n \"<string>\"\n ],\n \"phaseIds\": [\n \"<string>\"\n ],\n \"agentIds\": [\n \"<string>\"\n ]\n }\n ],\n \"variables\": [\n {\n \"variable\": \"<string>\",\n \"example\": \"<string>\"\n }\n ]\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-workspace-id", "<x-workspace-id>")
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.plazbot.com/api/template")
.header("x-workspace-id", "<x-workspace-id>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"workspaceId\": \"<string>\",\n \"userId\": \"<string>\",\n \"elementName\": \"<string>\",\n \"languageCode\": \"<string>\",\n \"category\": \"<string>\",\n \"templateType\": \"<string>\",\n \"components\": [\n {\n \"type\": \"<string>\",\n \"format\": \"<string>\",\n \"text\": \"<string>\",\n \"buttons\": [\n {\n \"type\": \"<string>\",\n \"text\": \"<string>\",\n \"phone_number\": \"<string>\",\n \"url\": \"<string>\",\n \"tagIds\": [\n \"<string>\"\n ],\n \"segmentationIds\": [\n \"<string>\"\n ],\n \"phaseIds\": [\n \"<string>\"\n ],\n \"agentIds\": [\n \"<string>\"\n ]\n }\n ],\n \"variables\": [\n {\n \"variable\": \"<string>\",\n \"example\": \"<string>\"\n }\n ]\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.plazbot.com/api/template")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-workspace-id"] = '<x-workspace-id>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"workspaceId\": \"<string>\",\n \"userId\": \"<string>\",\n \"elementName\": \"<string>\",\n \"languageCode\": \"<string>\",\n \"category\": \"<string>\",\n \"templateType\": \"<string>\",\n \"components\": [\n {\n \"type\": \"<string>\",\n \"format\": \"<string>\",\n \"text\": \"<string>\",\n \"buttons\": [\n {\n \"type\": \"<string>\",\n \"text\": \"<string>\",\n \"phone_number\": \"<string>\",\n \"url\": \"<string>\",\n \"tagIds\": [\n \"<string>\"\n ],\n \"segmentationIds\": [\n \"<string>\"\n ],\n \"phaseIds\": [\n \"<string>\"\n ],\n \"agentIds\": [\n \"<string>\"\n ]\n }\n ],\n \"variables\": [\n {\n \"variable\": \"<string>\",\n \"example\": \"<string>\"\n }\n ]\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"code": 123,
"errorCode": "<string>",
"message": "<string>",
"data": {
"plantilla": {
"id": "<string>",
"elementName": "<string>",
"status": "<string>"
}
}
}{
"success": true,
"code": 123,
"message": "<string>",
"errorCode": "<string>"
}{
"success": true,
"code": 123,
"message": "<string>",
"errorCode": "<string>"
}{
"success": true,
"code": 123,
"message": "<string>",
"errorCode": "<string>"
}{
"success": true,
"code": 123,
"message": "<string>",
"errorCode": "<string>"
}Authorizations
Token de autenticacion Bearer. Obtenga el token usando el endpoint /api/user/login
Headers
Identificador del workspace
Body
application/json
Identificador del workspace
ID del usuario que crea la plantilla
Nombre de la plantilla
Codigo de idioma (ej: es, en)
Categoria de la plantilla: MARKETING, UTILITY, AUTHENTICATION
Tipo de plantilla: TEXT, IMAGE, VIDEO, DOCUMENT
Componentes de la plantilla (HEADER, BODY, FOOTER, BUTTONS)
Show child attributes
Show child attributes
Response
Plantilla creada exitosamente
⌘I

