Actualizar cuestionario
curl --request PUT \
--url https://{your-prod-endpoint}/api/v1/questionnaires/{id} \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <api-key>' \
--data '
{
"title": {
"es": "Seguimiento postconsulta",
"en": "Post-visit follow up"
},
"description": {
"es": "Seguimiento postconsulta",
"en": "Post-visit follow up"
},
"defaultLanguage": "<string>",
"metadata": {},
"templateVariables": [
{
"key": "<string>",
"label": "<string>",
"required": true
}
],
"questions": [
{
"questionText": {
"es": "Seguimiento postconsulta",
"en": "Post-visit follow up"
},
"id": "<string>",
"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": {}
}
],
"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"
}
]
}
'import requests
url = "https://{your-prod-endpoint}/api/v1/questionnaires/{id}"
payload = {
"title": {
"es": "Seguimiento postconsulta",
"en": "Post-visit follow up"
},
"description": {
"es": "Seguimiento postconsulta",
"en": "Post-visit follow up"
},
"defaultLanguage": "<string>",
"metadata": {},
"templateVariables": [
{
"key": "<string>",
"label": "<string>",
"required": True
}
],
"questions": [
{
"questionText": {
"es": "Seguimiento postconsulta",
"en": "Post-visit follow up"
},
"id": "<string>",
"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": {}
}
],
"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"
}
]
}
headers = {
"X-Api-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'X-Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
title: {es: 'Seguimiento postconsulta', en: 'Post-visit follow up'},
description: {es: 'Seguimiento postconsulta', en: 'Post-visit follow up'},
defaultLanguage: '<string>',
metadata: {},
templateVariables: [{key: '<string>', label: '<string>', required: true}],
questions: [
{
questionText: {es: 'Seguimiento postconsulta', en: 'Post-visit follow up'},
id: '<string>',
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: {}
}
],
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'
}
]
})
};
fetch('https://{your-prod-endpoint}/api/v1/questionnaires/{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://{your-prod-endpoint}/api/v1/questionnaires/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'title' => [
'es' => 'Seguimiento postconsulta',
'en' => 'Post-visit follow up'
],
'description' => [
'es' => 'Seguimiento postconsulta',
'en' => 'Post-visit follow up'
],
'defaultLanguage' => '<string>',
'metadata' => [
],
'templateVariables' => [
[
'key' => '<string>',
'label' => '<string>',
'required' => true
]
],
'questions' => [
[
'questionText' => [
'es' => 'Seguimiento postconsulta',
'en' => 'Post-visit follow up'
],
'id' => '<string>',
'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' => [
]
]
],
'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'
]
]
]),
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/{id}"
payload := strings.NewReader("{\n \"title\": {\n \"es\": \"Seguimiento postconsulta\",\n \"en\": \"Post-visit follow up\"\n },\n \"description\": {\n \"es\": \"Seguimiento postconsulta\",\n \"en\": \"Post-visit follow up\"\n },\n \"defaultLanguage\": \"<string>\",\n \"metadata\": {},\n \"templateVariables\": [\n {\n \"key\": \"<string>\",\n \"label\": \"<string>\",\n \"required\": true\n }\n ],\n \"questions\": [\n {\n \"questionText\": {\n \"es\": \"Seguimiento postconsulta\",\n \"en\": \"Post-visit follow up\"\n },\n \"id\": \"<string>\",\n \"clarificationText\": {\n \"es\": \"Seguimiento postconsulta\",\n \"en\": \"Post-visit follow up\"\n },\n \"externalId\": \"<string>\",\n \"options\": [\n {\n \"value\": \"<string>\",\n \"label\": {\n \"es\": \"Seguimiento postconsulta\",\n \"en\": \"Post-visit follow up\"\n },\n \"score\": 123\n }\n ],\n \"isRequired\": true,\n \"displayOrder\": 123,\n \"metadata\": {}\n }\n ],\n \"edges\": [\n {\n \"id\": \"<string>\",\n \"questionnaireId\": \"<string>\",\n \"sourceQuestionId\": \"<string>\",\n \"targetQuestionId\": \"<string>\",\n \"conditionValue\": \"<string>\",\n \"edgeOrder\": 123,\n \"label\": \"<string>\",\n \"createdAt\": \"2023-11-07T05:31:56Z\",\n \"updatedAt\": \"2023-11-07T05:31:56Z\"\n }\n ],\n \"scoreClasses\": [\n {\n \"min\": 123,\n \"max\": 123,\n \"level\": 123,\n \"label\": \"<string>\"\n }\n ],\n \"webhooks\": {},\n \"scheduling\": {\n \"startDate\": \"<string>\",\n \"endDate\": \"<string>\",\n \"frequency\": {\n \"every\": 2\n },\n \"timeSlots\": [\n {\n \"key\": \"<string>\",\n \"label\": \"<string>\",\n \"startTime\": \"<string>\",\n \"endTime\": \"<string>\"\n }\n ],\n \"allowedDaysOfWeek\": [\n 3\n ],\n \"maxInstances\": 2,\n \"maxRetries\": 1,\n \"retryWindow\": {\n \"every\": 2\n },\n \"frequencyOverrides\": [\n {\n \"every\": 2,\n \"scoreLevel\": 123\n }\n ]\n },\n \"protocolActions\": [\n {\n \"title\": \"<string>\",\n \"displayOrder\": 123,\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"options\": [\n {\n \"label\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"createdAt\": \"2023-11-07T05:31:56Z\",\n \"updatedAt\": \"2023-11-07T05:31:56Z\"\n }\n ]\n}")
req, _ := http.NewRequest("PUT", 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.put("https://{your-prod-endpoint}/api/v1/questionnaires/{id}")
.header("X-Api-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"title\": {\n \"es\": \"Seguimiento postconsulta\",\n \"en\": \"Post-visit follow up\"\n },\n \"description\": {\n \"es\": \"Seguimiento postconsulta\",\n \"en\": \"Post-visit follow up\"\n },\n \"defaultLanguage\": \"<string>\",\n \"metadata\": {},\n \"templateVariables\": [\n {\n \"key\": \"<string>\",\n \"label\": \"<string>\",\n \"required\": true\n }\n ],\n \"questions\": [\n {\n \"questionText\": {\n \"es\": \"Seguimiento postconsulta\",\n \"en\": \"Post-visit follow up\"\n },\n \"id\": \"<string>\",\n \"clarificationText\": {\n \"es\": \"Seguimiento postconsulta\",\n \"en\": \"Post-visit follow up\"\n },\n \"externalId\": \"<string>\",\n \"options\": [\n {\n \"value\": \"<string>\",\n \"label\": {\n \"es\": \"Seguimiento postconsulta\",\n \"en\": \"Post-visit follow up\"\n },\n \"score\": 123\n }\n ],\n \"isRequired\": true,\n \"displayOrder\": 123,\n \"metadata\": {}\n }\n ],\n \"edges\": [\n {\n \"id\": \"<string>\",\n \"questionnaireId\": \"<string>\",\n \"sourceQuestionId\": \"<string>\",\n \"targetQuestionId\": \"<string>\",\n \"conditionValue\": \"<string>\",\n \"edgeOrder\": 123,\n \"label\": \"<string>\",\n \"createdAt\": \"2023-11-07T05:31:56Z\",\n \"updatedAt\": \"2023-11-07T05:31:56Z\"\n }\n ],\n \"scoreClasses\": [\n {\n \"min\": 123,\n \"max\": 123,\n \"level\": 123,\n \"label\": \"<string>\"\n }\n ],\n \"webhooks\": {},\n \"scheduling\": {\n \"startDate\": \"<string>\",\n \"endDate\": \"<string>\",\n \"frequency\": {\n \"every\": 2\n },\n \"timeSlots\": [\n {\n \"key\": \"<string>\",\n \"label\": \"<string>\",\n \"startTime\": \"<string>\",\n \"endTime\": \"<string>\"\n }\n ],\n \"allowedDaysOfWeek\": [\n 3\n ],\n \"maxInstances\": 2,\n \"maxRetries\": 1,\n \"retryWindow\": {\n \"every\": 2\n },\n \"frequencyOverrides\": [\n {\n \"every\": 2,\n \"scoreLevel\": 123\n }\n ]\n },\n \"protocolActions\": [\n {\n \"title\": \"<string>\",\n \"displayOrder\": 123,\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"options\": [\n {\n \"label\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"createdAt\": \"2023-11-07T05:31:56Z\",\n \"updatedAt\": \"2023-11-07T05:31:56Z\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{your-prod-endpoint}/api/v1/questionnaires/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["X-Api-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"title\": {\n \"es\": \"Seguimiento postconsulta\",\n \"en\": \"Post-visit follow up\"\n },\n \"description\": {\n \"es\": \"Seguimiento postconsulta\",\n \"en\": \"Post-visit follow up\"\n },\n \"defaultLanguage\": \"<string>\",\n \"metadata\": {},\n \"templateVariables\": [\n {\n \"key\": \"<string>\",\n \"label\": \"<string>\",\n \"required\": true\n }\n ],\n \"questions\": [\n {\n \"questionText\": {\n \"es\": \"Seguimiento postconsulta\",\n \"en\": \"Post-visit follow up\"\n },\n \"id\": \"<string>\",\n \"clarificationText\": {\n \"es\": \"Seguimiento postconsulta\",\n \"en\": \"Post-visit follow up\"\n },\n \"externalId\": \"<string>\",\n \"options\": [\n {\n \"value\": \"<string>\",\n \"label\": {\n \"es\": \"Seguimiento postconsulta\",\n \"en\": \"Post-visit follow up\"\n },\n \"score\": 123\n }\n ],\n \"isRequired\": true,\n \"displayOrder\": 123,\n \"metadata\": {}\n }\n ],\n \"edges\": [\n {\n \"id\": \"<string>\",\n \"questionnaireId\": \"<string>\",\n \"sourceQuestionId\": \"<string>\",\n \"targetQuestionId\": \"<string>\",\n \"conditionValue\": \"<string>\",\n \"edgeOrder\": 123,\n \"label\": \"<string>\",\n \"createdAt\": \"2023-11-07T05:31:56Z\",\n \"updatedAt\": \"2023-11-07T05:31:56Z\"\n }\n ],\n \"scoreClasses\": [\n {\n \"min\": 123,\n \"max\": 123,\n \"level\": 123,\n \"label\": \"<string>\"\n }\n ],\n \"webhooks\": {},\n \"scheduling\": {\n \"startDate\": \"<string>\",\n \"endDate\": \"<string>\",\n \"frequency\": {\n \"every\": 2\n },\n \"timeSlots\": [\n {\n \"key\": \"<string>\",\n \"label\": \"<string>\",\n \"startTime\": \"<string>\",\n \"endTime\": \"<string>\"\n }\n ],\n \"allowedDaysOfWeek\": [\n 3\n ],\n \"maxInstances\": 2,\n \"maxRetries\": 1,\n \"retryWindow\": {\n \"every\": 2\n },\n \"frequencyOverrides\": [\n {\n \"every\": 2,\n \"scoreLevel\": 123\n }\n ]\n },\n \"protocolActions\": [\n {\n \"title\": \"<string>\",\n \"displayOrder\": 123,\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"options\": [\n {\n \"label\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"createdAt\": \"2023-11-07T05:31:56Z\",\n \"updatedAt\": \"2023-11-07T05:31:56Z\"\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>"
}{
"status": "error",
"code": 123,
"error_code": "<string>",
"message": "<string>"
}Content - Questionnaires
Actualizar cuestionario
Actualiza un cuestionario existente. Si se envía questions, reemplaza las preguntas existentes.
PUT
/
api
/
v1
/
questionnaires
/
{id}
Actualizar cuestionario
curl --request PUT \
--url https://{your-prod-endpoint}/api/v1/questionnaires/{id} \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <api-key>' \
--data '
{
"title": {
"es": "Seguimiento postconsulta",
"en": "Post-visit follow up"
},
"description": {
"es": "Seguimiento postconsulta",
"en": "Post-visit follow up"
},
"defaultLanguage": "<string>",
"metadata": {},
"templateVariables": [
{
"key": "<string>",
"label": "<string>",
"required": true
}
],
"questions": [
{
"questionText": {
"es": "Seguimiento postconsulta",
"en": "Post-visit follow up"
},
"id": "<string>",
"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": {}
}
],
"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"
}
]
}
'import requests
url = "https://{your-prod-endpoint}/api/v1/questionnaires/{id}"
payload = {
"title": {
"es": "Seguimiento postconsulta",
"en": "Post-visit follow up"
},
"description": {
"es": "Seguimiento postconsulta",
"en": "Post-visit follow up"
},
"defaultLanguage": "<string>",
"metadata": {},
"templateVariables": [
{
"key": "<string>",
"label": "<string>",
"required": True
}
],
"questions": [
{
"questionText": {
"es": "Seguimiento postconsulta",
"en": "Post-visit follow up"
},
"id": "<string>",
"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": {}
}
],
"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"
}
]
}
headers = {
"X-Api-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'X-Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
title: {es: 'Seguimiento postconsulta', en: 'Post-visit follow up'},
description: {es: 'Seguimiento postconsulta', en: 'Post-visit follow up'},
defaultLanguage: '<string>',
metadata: {},
templateVariables: [{key: '<string>', label: '<string>', required: true}],
questions: [
{
questionText: {es: 'Seguimiento postconsulta', en: 'Post-visit follow up'},
id: '<string>',
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: {}
}
],
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'
}
]
})
};
fetch('https://{your-prod-endpoint}/api/v1/questionnaires/{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://{your-prod-endpoint}/api/v1/questionnaires/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'title' => [
'es' => 'Seguimiento postconsulta',
'en' => 'Post-visit follow up'
],
'description' => [
'es' => 'Seguimiento postconsulta',
'en' => 'Post-visit follow up'
],
'defaultLanguage' => '<string>',
'metadata' => [
],
'templateVariables' => [
[
'key' => '<string>',
'label' => '<string>',
'required' => true
]
],
'questions' => [
[
'questionText' => [
'es' => 'Seguimiento postconsulta',
'en' => 'Post-visit follow up'
],
'id' => '<string>',
'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' => [
]
]
],
'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'
]
]
]),
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/{id}"
payload := strings.NewReader("{\n \"title\": {\n \"es\": \"Seguimiento postconsulta\",\n \"en\": \"Post-visit follow up\"\n },\n \"description\": {\n \"es\": \"Seguimiento postconsulta\",\n \"en\": \"Post-visit follow up\"\n },\n \"defaultLanguage\": \"<string>\",\n \"metadata\": {},\n \"templateVariables\": [\n {\n \"key\": \"<string>\",\n \"label\": \"<string>\",\n \"required\": true\n }\n ],\n \"questions\": [\n {\n \"questionText\": {\n \"es\": \"Seguimiento postconsulta\",\n \"en\": \"Post-visit follow up\"\n },\n \"id\": \"<string>\",\n \"clarificationText\": {\n \"es\": \"Seguimiento postconsulta\",\n \"en\": \"Post-visit follow up\"\n },\n \"externalId\": \"<string>\",\n \"options\": [\n {\n \"value\": \"<string>\",\n \"label\": {\n \"es\": \"Seguimiento postconsulta\",\n \"en\": \"Post-visit follow up\"\n },\n \"score\": 123\n }\n ],\n \"isRequired\": true,\n \"displayOrder\": 123,\n \"metadata\": {}\n }\n ],\n \"edges\": [\n {\n \"id\": \"<string>\",\n \"questionnaireId\": \"<string>\",\n \"sourceQuestionId\": \"<string>\",\n \"targetQuestionId\": \"<string>\",\n \"conditionValue\": \"<string>\",\n \"edgeOrder\": 123,\n \"label\": \"<string>\",\n \"createdAt\": \"2023-11-07T05:31:56Z\",\n \"updatedAt\": \"2023-11-07T05:31:56Z\"\n }\n ],\n \"scoreClasses\": [\n {\n \"min\": 123,\n \"max\": 123,\n \"level\": 123,\n \"label\": \"<string>\"\n }\n ],\n \"webhooks\": {},\n \"scheduling\": {\n \"startDate\": \"<string>\",\n \"endDate\": \"<string>\",\n \"frequency\": {\n \"every\": 2\n },\n \"timeSlots\": [\n {\n \"key\": \"<string>\",\n \"label\": \"<string>\",\n \"startTime\": \"<string>\",\n \"endTime\": \"<string>\"\n }\n ],\n \"allowedDaysOfWeek\": [\n 3\n ],\n \"maxInstances\": 2,\n \"maxRetries\": 1,\n \"retryWindow\": {\n \"every\": 2\n },\n \"frequencyOverrides\": [\n {\n \"every\": 2,\n \"scoreLevel\": 123\n }\n ]\n },\n \"protocolActions\": [\n {\n \"title\": \"<string>\",\n \"displayOrder\": 123,\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"options\": [\n {\n \"label\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"createdAt\": \"2023-11-07T05:31:56Z\",\n \"updatedAt\": \"2023-11-07T05:31:56Z\"\n }\n ]\n}")
req, _ := http.NewRequest("PUT", 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.put("https://{your-prod-endpoint}/api/v1/questionnaires/{id}")
.header("X-Api-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"title\": {\n \"es\": \"Seguimiento postconsulta\",\n \"en\": \"Post-visit follow up\"\n },\n \"description\": {\n \"es\": \"Seguimiento postconsulta\",\n \"en\": \"Post-visit follow up\"\n },\n \"defaultLanguage\": \"<string>\",\n \"metadata\": {},\n \"templateVariables\": [\n {\n \"key\": \"<string>\",\n \"label\": \"<string>\",\n \"required\": true\n }\n ],\n \"questions\": [\n {\n \"questionText\": {\n \"es\": \"Seguimiento postconsulta\",\n \"en\": \"Post-visit follow up\"\n },\n \"id\": \"<string>\",\n \"clarificationText\": {\n \"es\": \"Seguimiento postconsulta\",\n \"en\": \"Post-visit follow up\"\n },\n \"externalId\": \"<string>\",\n \"options\": [\n {\n \"value\": \"<string>\",\n \"label\": {\n \"es\": \"Seguimiento postconsulta\",\n \"en\": \"Post-visit follow up\"\n },\n \"score\": 123\n }\n ],\n \"isRequired\": true,\n \"displayOrder\": 123,\n \"metadata\": {}\n }\n ],\n \"edges\": [\n {\n \"id\": \"<string>\",\n \"questionnaireId\": \"<string>\",\n \"sourceQuestionId\": \"<string>\",\n \"targetQuestionId\": \"<string>\",\n \"conditionValue\": \"<string>\",\n \"edgeOrder\": 123,\n \"label\": \"<string>\",\n \"createdAt\": \"2023-11-07T05:31:56Z\",\n \"updatedAt\": \"2023-11-07T05:31:56Z\"\n }\n ],\n \"scoreClasses\": [\n {\n \"min\": 123,\n \"max\": 123,\n \"level\": 123,\n \"label\": \"<string>\"\n }\n ],\n \"webhooks\": {},\n \"scheduling\": {\n \"startDate\": \"<string>\",\n \"endDate\": \"<string>\",\n \"frequency\": {\n \"every\": 2\n },\n \"timeSlots\": [\n {\n \"key\": \"<string>\",\n \"label\": \"<string>\",\n \"startTime\": \"<string>\",\n \"endTime\": \"<string>\"\n }\n ],\n \"allowedDaysOfWeek\": [\n 3\n ],\n \"maxInstances\": 2,\n \"maxRetries\": 1,\n \"retryWindow\": {\n \"every\": 2\n },\n \"frequencyOverrides\": [\n {\n \"every\": 2,\n \"scoreLevel\": 123\n }\n ]\n },\n \"protocolActions\": [\n {\n \"title\": \"<string>\",\n \"displayOrder\": 123,\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"options\": [\n {\n \"label\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"createdAt\": \"2023-11-07T05:31:56Z\",\n \"updatedAt\": \"2023-11-07T05:31:56Z\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{your-prod-endpoint}/api/v1/questionnaires/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["X-Api-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"title\": {\n \"es\": \"Seguimiento postconsulta\",\n \"en\": \"Post-visit follow up\"\n },\n \"description\": {\n \"es\": \"Seguimiento postconsulta\",\n \"en\": \"Post-visit follow up\"\n },\n \"defaultLanguage\": \"<string>\",\n \"metadata\": {},\n \"templateVariables\": [\n {\n \"key\": \"<string>\",\n \"label\": \"<string>\",\n \"required\": true\n }\n ],\n \"questions\": [\n {\n \"questionText\": {\n \"es\": \"Seguimiento postconsulta\",\n \"en\": \"Post-visit follow up\"\n },\n \"id\": \"<string>\",\n \"clarificationText\": {\n \"es\": \"Seguimiento postconsulta\",\n \"en\": \"Post-visit follow up\"\n },\n \"externalId\": \"<string>\",\n \"options\": [\n {\n \"value\": \"<string>\",\n \"label\": {\n \"es\": \"Seguimiento postconsulta\",\n \"en\": \"Post-visit follow up\"\n },\n \"score\": 123\n }\n ],\n \"isRequired\": true,\n \"displayOrder\": 123,\n \"metadata\": {}\n }\n ],\n \"edges\": [\n {\n \"id\": \"<string>\",\n \"questionnaireId\": \"<string>\",\n \"sourceQuestionId\": \"<string>\",\n \"targetQuestionId\": \"<string>\",\n \"conditionValue\": \"<string>\",\n \"edgeOrder\": 123,\n \"label\": \"<string>\",\n \"createdAt\": \"2023-11-07T05:31:56Z\",\n \"updatedAt\": \"2023-11-07T05:31:56Z\"\n }\n ],\n \"scoreClasses\": [\n {\n \"min\": 123,\n \"max\": 123,\n \"level\": 123,\n \"label\": \"<string>\"\n }\n ],\n \"webhooks\": {},\n \"scheduling\": {\n \"startDate\": \"<string>\",\n \"endDate\": \"<string>\",\n \"frequency\": {\n \"every\": 2\n },\n \"timeSlots\": [\n {\n \"key\": \"<string>\",\n \"label\": \"<string>\",\n \"startTime\": \"<string>\",\n \"endTime\": \"<string>\"\n }\n ],\n \"allowedDaysOfWeek\": [\n 3\n ],\n \"maxInstances\": 2,\n \"maxRetries\": 1,\n \"retryWindow\": {\n \"every\": 2\n },\n \"frequencyOverrides\": [\n {\n \"every\": 2,\n \"scoreLevel\": 123\n }\n ]\n },\n \"protocolActions\": [\n {\n \"title\": \"<string>\",\n \"displayOrder\": 123,\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"options\": [\n {\n \"label\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"createdAt\": \"2023-11-07T05:31:56Z\",\n \"updatedAt\": \"2023-11-07T05:31:56Z\"\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>"
}{
"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.
Parámetros de ruta
Cuerpo
application/json
Todos los campos son opcionales; si se envía questions, reemplaza las preguntas existentes.
Show child attributes
Show child attributes
Ejemplo:
{ "es": "Seguimiento postconsulta", "en": "Post-visit follow up" }
Show child attributes
Show child attributes
Ejemplo:
{ "es": "Seguimiento postconsulta", "en": "Post-visit follow up" }
Opciones disponibles:
draft, active, archived Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
⌘I