Programar llamada saliente con cuestionario externo
curl --request POST \
--url https://{your-prod-endpoint}/api/v1/calls/external-questionnaire \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <api-key>' \
--data '
{
"name": "Ana",
"surname1": "García",
"phone": "+34612345678",
"questionnaireId": "550e8400-e29b-41d4-a716-446655440000",
"externalId": "case-123",
"schedulingWindow": {
"date": "2026-05-12",
"startTime": "10:00",
"endTime": "12:00"
},
"metadata": {
"source": "ehr"
}
}
'import requests
url = "https://{your-prod-endpoint}/api/v1/calls/external-questionnaire"
payload = {
"name": "Ana",
"surname1": "García",
"phone": "+34612345678",
"questionnaireId": "550e8400-e29b-41d4-a716-446655440000",
"externalId": "case-123",
"schedulingWindow": {
"date": "2026-05-12",
"startTime": "10:00",
"endTime": "12:00"
},
"metadata": { "source": "ehr" }
}
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({
name: 'Ana',
surname1: 'García',
phone: '+34612345678',
questionnaireId: '550e8400-e29b-41d4-a716-446655440000',
externalId: 'case-123',
schedulingWindow: {date: '2026-05-12', startTime: '10:00', endTime: '12:00'},
metadata: {source: 'ehr'}
})
};
fetch('https://{your-prod-endpoint}/api/v1/calls/external-questionnaire', 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/calls/external-questionnaire",
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([
'name' => 'Ana',
'surname1' => 'García',
'phone' => '+34612345678',
'questionnaireId' => '550e8400-e29b-41d4-a716-446655440000',
'externalId' => 'case-123',
'schedulingWindow' => [
'date' => '2026-05-12',
'startTime' => '10:00',
'endTime' => '12:00'
],
'metadata' => [
'source' => 'ehr'
]
]),
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/calls/external-questionnaire"
payload := strings.NewReader("{\n \"name\": \"Ana\",\n \"surname1\": \"García\",\n \"phone\": \"+34612345678\",\n \"questionnaireId\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"externalId\": \"case-123\",\n \"schedulingWindow\": {\n \"date\": \"2026-05-12\",\n \"startTime\": \"10:00\",\n \"endTime\": \"12:00\"\n },\n \"metadata\": {\n \"source\": \"ehr\"\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/calls/external-questionnaire")
.header("X-Api-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Ana\",\n \"surname1\": \"García\",\n \"phone\": \"+34612345678\",\n \"questionnaireId\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"externalId\": \"case-123\",\n \"schedulingWindow\": {\n \"date\": \"2026-05-12\",\n \"startTime\": \"10:00\",\n \"endTime\": \"12:00\"\n },\n \"metadata\": {\n \"source\": \"ehr\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{your-prod-endpoint}/api/v1/calls/external-questionnaire")
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 \"name\": \"Ana\",\n \"surname1\": \"García\",\n \"phone\": \"+34612345678\",\n \"questionnaireId\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"externalId\": \"case-123\",\n \"schedulingWindow\": {\n \"date\": \"2026-05-12\",\n \"startTime\": \"10:00\",\n \"endTime\": \"12:00\"\n },\n \"metadata\": {\n \"source\": \"ehr\"\n }\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"callId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"call": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"apiKeyId": "<string>",
"endUserId": "<string>",
"questionnaireInstanceId": "<string>",
"scheduledAt": "2023-11-07T05:31:56Z",
"startedAt": "2023-11-07T05:31:56Z",
"endedAt": "2023-11-07T05:31:56Z",
"schedulingWindow": {
"date": "<string>",
"startTime": "<string>",
"endTime": "<string>",
"allowedDaysOfWeek": [
3
]
},
"transcription": [
{
"content": "<string>",
"time": "2023-11-07T05:31:56Z"
}
],
"summary": "<string>",
"transferReason": "<string>",
"userIntent": "<string>",
"callResult": "<string>"
}
}
}{
"status": "error",
"code": 123,
"error_code": "<string>",
"message": "<string>"
}{
"status": "error",
"code": 123,
"error_code": "<string>",
"message": "<string>"
}Voice Calls
Programar llamada saliente con cuestionario externo
Crea una llamada outbound en estado pending, vinculada a un questionnaireId. Usa schedulingWindow si quieres acotar fecha u horario.
POST
/
api
/
v1
/
calls
/
external-questionnaire
Programar llamada saliente con cuestionario externo
curl --request POST \
--url https://{your-prod-endpoint}/api/v1/calls/external-questionnaire \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <api-key>' \
--data '
{
"name": "Ana",
"surname1": "García",
"phone": "+34612345678",
"questionnaireId": "550e8400-e29b-41d4-a716-446655440000",
"externalId": "case-123",
"schedulingWindow": {
"date": "2026-05-12",
"startTime": "10:00",
"endTime": "12:00"
},
"metadata": {
"source": "ehr"
}
}
'import requests
url = "https://{your-prod-endpoint}/api/v1/calls/external-questionnaire"
payload = {
"name": "Ana",
"surname1": "García",
"phone": "+34612345678",
"questionnaireId": "550e8400-e29b-41d4-a716-446655440000",
"externalId": "case-123",
"schedulingWindow": {
"date": "2026-05-12",
"startTime": "10:00",
"endTime": "12:00"
},
"metadata": { "source": "ehr" }
}
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({
name: 'Ana',
surname1: 'García',
phone: '+34612345678',
questionnaireId: '550e8400-e29b-41d4-a716-446655440000',
externalId: 'case-123',
schedulingWindow: {date: '2026-05-12', startTime: '10:00', endTime: '12:00'},
metadata: {source: 'ehr'}
})
};
fetch('https://{your-prod-endpoint}/api/v1/calls/external-questionnaire', 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/calls/external-questionnaire",
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([
'name' => 'Ana',
'surname1' => 'García',
'phone' => '+34612345678',
'questionnaireId' => '550e8400-e29b-41d4-a716-446655440000',
'externalId' => 'case-123',
'schedulingWindow' => [
'date' => '2026-05-12',
'startTime' => '10:00',
'endTime' => '12:00'
],
'metadata' => [
'source' => 'ehr'
]
]),
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/calls/external-questionnaire"
payload := strings.NewReader("{\n \"name\": \"Ana\",\n \"surname1\": \"García\",\n \"phone\": \"+34612345678\",\n \"questionnaireId\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"externalId\": \"case-123\",\n \"schedulingWindow\": {\n \"date\": \"2026-05-12\",\n \"startTime\": \"10:00\",\n \"endTime\": \"12:00\"\n },\n \"metadata\": {\n \"source\": \"ehr\"\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/calls/external-questionnaire")
.header("X-Api-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Ana\",\n \"surname1\": \"García\",\n \"phone\": \"+34612345678\",\n \"questionnaireId\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"externalId\": \"case-123\",\n \"schedulingWindow\": {\n \"date\": \"2026-05-12\",\n \"startTime\": \"10:00\",\n \"endTime\": \"12:00\"\n },\n \"metadata\": {\n \"source\": \"ehr\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{your-prod-endpoint}/api/v1/calls/external-questionnaire")
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 \"name\": \"Ana\",\n \"surname1\": \"García\",\n \"phone\": \"+34612345678\",\n \"questionnaireId\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"externalId\": \"case-123\",\n \"schedulingWindow\": {\n \"date\": \"2026-05-12\",\n \"startTime\": \"10:00\",\n \"endTime\": \"12:00\"\n },\n \"metadata\": {\n \"source\": \"ehr\"\n }\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"callId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"call": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"apiKeyId": "<string>",
"endUserId": "<string>",
"questionnaireInstanceId": "<string>",
"scheduledAt": "2023-11-07T05:31:56Z",
"startedAt": "2023-11-07T05:31:56Z",
"endedAt": "2023-11-07T05:31:56Z",
"schedulingWindow": {
"date": "<string>",
"startTime": "<string>",
"endTime": "<string>",
"allowedDaysOfWeek": [
3
]
},
"transcription": [
{
"content": "<string>",
"time": "2023-11-07T05:31:56Z"
}
],
"summary": "<string>",
"transferReason": "<string>",
"userIntent": "<string>",
"callResult": "<string>"
}
}
}{
"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.
Cuerpo
application/json
⌘I