Crear cuestionario
curl --request POST \
--url https://{your-prod-endpoint}/api/v1/questionnaires \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <api-key>' \
--data '
{
"title": {
"es": "Seguimiento postconsulta"
},
"defaultLanguage": "es",
"externalId": "postconsulta-2026",
"questions": [
{
"questionText": {
"es": "¿Cómo se encuentra hoy?"
},
"questionType": "text",
"isRequired": true,
"displayOrder": 1,
"metadata": {}
}
]
}
'import requests
url = "https://{your-prod-endpoint}/api/v1/questionnaires"
payload = {
"title": { "es": "Seguimiento postconsulta" },
"defaultLanguage": "es",
"externalId": "postconsulta-2026",
"questions": [
{
"questionText": { "es": "¿Cómo se encuentra hoy?" },
"questionType": "text",
"isRequired": True,
"displayOrder": 1,
"metadata": {}
}
]
}
headers = {
"X-Api-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
title: {es: 'Seguimiento postconsulta'},
defaultLanguage: 'es',
externalId: 'postconsulta-2026',
questions: [
{
questionText: {es: '¿Cómo se encuentra hoy?'},
questionType: 'text',
isRequired: true,
displayOrder: 1,
metadata: {}
}
]
})
};
fetch('https://{your-prod-endpoint}/api/v1/questionnaires', 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://{your-prod-endpoint}/api/v1/questionnaires",
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([
'title' => [
'es' => 'Seguimiento postconsulta'
],
'defaultLanguage' => 'es',
'externalId' => 'postconsulta-2026',
'questions' => [
[
'questionText' => [
'es' => '¿Cómo se encuentra hoy?'
],
'questionType' => 'text',
'isRequired' => true,
'displayOrder' => 1,
'metadata' => [
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Api-Key: <api-key>"
],
]);
$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://{your-prod-endpoint}/api/v1/questionnaires"
payload := strings.NewReader("{\n \"title\": {\n \"es\": \"Seguimiento postconsulta\"\n },\n \"defaultLanguage\": \"es\",\n \"externalId\": \"postconsulta-2026\",\n \"questions\": [\n {\n \"questionText\": {\n \"es\": \"¿Cómo se encuentra hoy?\"\n },\n \"questionType\": \"text\",\n \"isRequired\": true,\n \"displayOrder\": 1,\n \"metadata\": {}\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Api-Key", "<api-key>")
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://{your-prod-endpoint}/api/v1/questionnaires")
.header("X-Api-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"title\": {\n \"es\": \"Seguimiento postconsulta\"\n },\n \"defaultLanguage\": \"es\",\n \"externalId\": \"postconsulta-2026\",\n \"questions\": [\n {\n \"questionText\": {\n \"es\": \"¿Cómo se encuentra hoy?\"\n },\n \"questionType\": \"text\",\n \"isRequired\": true,\n \"displayOrder\": 1,\n \"metadata\": {}\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{your-prod-endpoint}/api/v1/questionnaires")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Api-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"title\": {\n \"es\": \"Seguimiento postconsulta\"\n },\n \"defaultLanguage\": \"es\",\n \"externalId\": \"postconsulta-2026\",\n \"questions\": [\n {\n \"questionText\": {\n \"es\": \"¿Cómo se encuentra hoy?\"\n },\n \"questionType\": \"text\",\n \"isRequired\": true,\n \"displayOrder\": 1,\n \"metadata\": {}\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"title": {
"es": "Seguimiento postconsulta",
"en": "Post-visit follow up"
},
"questions": [
{
"questionText": {
"es": "Seguimiento postconsulta",
"en": "Post-visit follow up"
},
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"clarificationText": {
"es": "Seguimiento postconsulta",
"en": "Post-visit follow up"
},
"externalId": "<string>",
"options": [
{
"value": "<string>",
"label": {
"es": "Seguimiento postconsulta",
"en": "Post-visit follow up"
},
"score": 123
}
],
"isRequired": true,
"displayOrder": 123,
"metadata": {},
"questionnaireId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
],
"description": {
"es": "Seguimiento postconsulta",
"en": "Post-visit follow up"
},
"defaultLanguage": "es",
"version": 123,
"externalId": "<string>",
"metadata": {},
"templateVariables": [
{
"key": "<string>",
"label": "<string>",
"required": true
}
],
"edges": [
{
"id": "<string>",
"questionnaireId": "<string>",
"sourceQuestionId": "<string>",
"targetQuestionId": "<string>",
"conditionValue": "<string>",
"edgeOrder": 123,
"label": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
],
"scoreClasses": [
{
"min": 123,
"max": 123,
"level": 123,
"label": "<string>"
}
],
"webhooks": {},
"scheduling": {
"startDate": "<string>",
"endDate": "<string>",
"frequency": {
"every": 2
},
"timeSlots": [
{
"key": "<string>",
"label": "<string>",
"startTime": "<string>",
"endTime": "<string>"
}
],
"allowedDaysOfWeek": [
3
],
"maxInstances": 2,
"maxRetries": 1,
"retryWindow": {
"every": 2
},
"frequencyOverrides": [
{
"every": 2,
"scoreLevel": 123
}
]
},
"protocolActions": [
{
"title": "<string>",
"displayOrder": 123,
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"options": [
{
"label": "<string>",
"value": "<string>"
}
],
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
],
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
}{
"status": "error",
"code": 123,
"error_code": "<string>",
"message": "<string>"
}Content - Questionnaires
Crear cuestionario
Crea un cuestionario con preguntas, metadata, webhooks y configuración de scheduling opcional.
POST
/
api
/
v1
/
questionnaires
Crear cuestionario
curl --request POST \
--url https://{your-prod-endpoint}/api/v1/questionnaires \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <api-key>' \
--data '
{
"title": {
"es": "Seguimiento postconsulta"
},
"defaultLanguage": "es",
"externalId": "postconsulta-2026",
"questions": [
{
"questionText": {
"es": "¿Cómo se encuentra hoy?"
},
"questionType": "text",
"isRequired": true,
"displayOrder": 1,
"metadata": {}
}
]
}
'import requests
url = "https://{your-prod-endpoint}/api/v1/questionnaires"
payload = {
"title": { "es": "Seguimiento postconsulta" },
"defaultLanguage": "es",
"externalId": "postconsulta-2026",
"questions": [
{
"questionText": { "es": "¿Cómo se encuentra hoy?" },
"questionType": "text",
"isRequired": True,
"displayOrder": 1,
"metadata": {}
}
]
}
headers = {
"X-Api-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
title: {es: 'Seguimiento postconsulta'},
defaultLanguage: 'es',
externalId: 'postconsulta-2026',
questions: [
{
questionText: {es: '¿Cómo se encuentra hoy?'},
questionType: 'text',
isRequired: true,
displayOrder: 1,
metadata: {}
}
]
})
};
fetch('https://{your-prod-endpoint}/api/v1/questionnaires', 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://{your-prod-endpoint}/api/v1/questionnaires",
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([
'title' => [
'es' => 'Seguimiento postconsulta'
],
'defaultLanguage' => 'es',
'externalId' => 'postconsulta-2026',
'questions' => [
[
'questionText' => [
'es' => '¿Cómo se encuentra hoy?'
],
'questionType' => 'text',
'isRequired' => true,
'displayOrder' => 1,
'metadata' => [
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Api-Key: <api-key>"
],
]);
$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://{your-prod-endpoint}/api/v1/questionnaires"
payload := strings.NewReader("{\n \"title\": {\n \"es\": \"Seguimiento postconsulta\"\n },\n \"defaultLanguage\": \"es\",\n \"externalId\": \"postconsulta-2026\",\n \"questions\": [\n {\n \"questionText\": {\n \"es\": \"¿Cómo se encuentra hoy?\"\n },\n \"questionType\": \"text\",\n \"isRequired\": true,\n \"displayOrder\": 1,\n \"metadata\": {}\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Api-Key", "<api-key>")
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://{your-prod-endpoint}/api/v1/questionnaires")
.header("X-Api-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"title\": {\n \"es\": \"Seguimiento postconsulta\"\n },\n \"defaultLanguage\": \"es\",\n \"externalId\": \"postconsulta-2026\",\n \"questions\": [\n {\n \"questionText\": {\n \"es\": \"¿Cómo se encuentra hoy?\"\n },\n \"questionType\": \"text\",\n \"isRequired\": true,\n \"displayOrder\": 1,\n \"metadata\": {}\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{your-prod-endpoint}/api/v1/questionnaires")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Api-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"title\": {\n \"es\": \"Seguimiento postconsulta\"\n },\n \"defaultLanguage\": \"es\",\n \"externalId\": \"postconsulta-2026\",\n \"questions\": [\n {\n \"questionText\": {\n \"es\": \"¿Cómo se encuentra hoy?\"\n },\n \"questionType\": \"text\",\n \"isRequired\": true,\n \"displayOrder\": 1,\n \"metadata\": {}\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"title": {
"es": "Seguimiento postconsulta",
"en": "Post-visit follow up"
},
"questions": [
{
"questionText": {
"es": "Seguimiento postconsulta",
"en": "Post-visit follow up"
},
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"clarificationText": {
"es": "Seguimiento postconsulta",
"en": "Post-visit follow up"
},
"externalId": "<string>",
"options": [
{
"value": "<string>",
"label": {
"es": "Seguimiento postconsulta",
"en": "Post-visit follow up"
},
"score": 123
}
],
"isRequired": true,
"displayOrder": 123,
"metadata": {},
"questionnaireId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
],
"description": {
"es": "Seguimiento postconsulta",
"en": "Post-visit follow up"
},
"defaultLanguage": "es",
"version": 123,
"externalId": "<string>",
"metadata": {},
"templateVariables": [
{
"key": "<string>",
"label": "<string>",
"required": true
}
],
"edges": [
{
"id": "<string>",
"questionnaireId": "<string>",
"sourceQuestionId": "<string>",
"targetQuestionId": "<string>",
"conditionValue": "<string>",
"edgeOrder": 123,
"label": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
],
"scoreClasses": [
{
"min": 123,
"max": 123,
"level": 123,
"label": "<string>"
}
],
"webhooks": {},
"scheduling": {
"startDate": "<string>",
"endDate": "<string>",
"frequency": {
"every": 2
},
"timeSlots": [
{
"key": "<string>",
"label": "<string>",
"startTime": "<string>",
"endTime": "<string>"
}
],
"allowedDaysOfWeek": [
3
],
"maxInstances": 2,
"maxRetries": 1,
"retryWindow": {
"every": 2
},
"frequencyOverrides": [
{
"every": 2,
"scoreLevel": 123
}
]
},
"protocolActions": [
{
"title": "<string>",
"displayOrder": 123,
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"options": [
{
"label": "<string>",
"value": "<string>"
}
],
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
],
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
}{
"status": "error",
"code": 123,
"error_code": "<string>",
"message": "<string>"
}Autorizaciones
API Key proporcionada por Omniloy. La misma key se usa para llamadas entrantes y salientes.
Cuerpo
application/json
Show child attributes
Show child attributes
Ejemplo:
{
"es": "Seguimiento postconsulta",
"en": "Post-visit follow up"
}
Minimum array length:
1Show child attributes
Show child attributes
Show child attributes
Show child attributes
Ejemplo:
{
"es": "Seguimiento postconsulta",
"en": "Post-visit follow up"
}
Ejemplo:
"es"
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Mapa de evento de cuestionario a webhookId.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
⌘I