Obtener Plantillas
curl --request GET \
--url https://api.jelou.ai/v1/bots/{botId}/templates \
--header 'Authorization: Basic <encoded-value>'import requests
url = "https://api.jelou.ai/v1/bots/{botId}/templates"
headers = {"Authorization": "Basic <encoded-value>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Basic <encoded-value>'}};
fetch('https://api.jelou.ai/v1/bots/{botId}/templates', 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.jelou.ai/v1/bots/{botId}/templates",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.jelou.ai/v1/bots/{botId}/templates"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Basic <encoded-value>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.jelou.ai/v1/bots/{botId}/templates")
.header("Authorization", "Basic <encoded-value>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.jelou.ai/v1/bots/{botId}/templates")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Basic <encoded-value>'
response = http.request(request)
puts response.read_body{
"message": "<string>",
"statusMessage": "<string>",
"status": 123,
"error": {
"code": "<string>",
"key": "<string>",
"description": "<string>",
"developerMessages": {},
"clientMessages": {}
},
"validationError": {}
}{
"message": "<string>",
"statusMessage": "<string>",
"status": 123,
"error": {
"code": "<string>",
"key": "<string>",
"description": "<string>",
"developerMessages": {},
"clientMessages": {}
},
"validationError": {}
}Plantillas
Obtener Plantillas
Recupera todas las plantillas HSM configuradas en tu bot
GET
/
v1
/
bots
/
{botId}
/
templates
Obtener Plantillas
curl --request GET \
--url https://api.jelou.ai/v1/bots/{botId}/templates \
--header 'Authorization: Basic <encoded-value>'import requests
url = "https://api.jelou.ai/v1/bots/{botId}/templates"
headers = {"Authorization": "Basic <encoded-value>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Basic <encoded-value>'}};
fetch('https://api.jelou.ai/v1/bots/{botId}/templates', 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.jelou.ai/v1/bots/{botId}/templates",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.jelou.ai/v1/bots/{botId}/templates"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Basic <encoded-value>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.jelou.ai/v1/bots/{botId}/templates")
.header("Authorization", "Basic <encoded-value>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.jelou.ai/v1/bots/{botId}/templates")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Basic <encoded-value>'
response = http.request(request)
puts response.read_body{
"message": "<string>",
"statusMessage": "<string>",
"status": 123,
"error": {
"code": "<string>",
"key": "<string>",
"description": "<string>",
"developerMessages": {},
"clientMessages": {}
},
"validationError": {}
}{
"message": "<string>",
"statusMessage": "<string>",
"status": 123,
"error": {
"code": "<string>",
"key": "<string>",
"description": "<string>",
"developerMessages": {},
"clientMessages": {}
},
"validationError": {}
}Obtén la lista de todas las plantillas configuradas en tu bot. Puedes filtrar por nombre, estado o categoría.
GET /v1/bots/{botId}/templates
Revisa las plantillas existentes antes de crear una nueva para evitar duplicados.
Parámetros de ruta
| Propiedad | Tipo | Descripción |
|---|---|---|
| botId | string | ID único del bot. Ejemplo: 123456789 |
Parámetros de consulta
| Propiedad | Tipo | Descripción |
|---|---|---|
| query | string | Buscar plantillas por elementName |
| status | string | Buscar plantillas por estado. Valores posibles: PENDING, REJECTED, APPROVED |
| category | string | Buscar plantillas por categoría. Valores posibles: UTILITY, MARKETING, AUTHENTICATION |
Respuestas
200 - Respuesta exitosa
200 - Respuesta exitosa
{
"data": [
{
"template": "¡Hola! Somos *Jelou*. \nTe damos la bienvenida _{{1}}_.",
"displayName": "Bienvenida",
"elementName": "bienvenida_cliente",
"params": [
{"label": "Nombre del cliente", "param": "1"}
],
"paramsNumber": 1,
"isVisible": true,
"language": "ES",
"status": "APPROVED",
"category": "UTILITY",
"createdAt": "2021-01-28T15:08:38.492Z",
"updatedAt": "2021-01-28T15:08:38.492Z"
}
]
}
401 - Unauthorized
401 - Unauthorized
{
"message": "Authentication failed"
}
404 - Not Found
404 - Not Found
{
"message": ["The Bot could not be found at the moment."],
"statusMessage": "failed",
"error": {
"code": "E1019",
"key": "BOT_NOT_FOUND"
}
}
Autorizaciones
Basic authentication using Base64 encoded clientId:clientSecret
Parámetros de ruta
Parámetros de consulta
Buscar por elementName
Opciones disponibles:
PENDING, REJECTED, APPROVED Opciones disponibles:
UTILITY, MARKETING, AUTHENTICATION Respuesta
Plantillas recuperadas exitosamente
¿Esta página le ayudó?
⌘I