MENU navbar-image

Introducción

Documentación de la API de Qclinicas Cloud

Esta documentación proporciona toda la información necesaria que necesitas para trabajar con la API de Qclinicas Cloud. Si tienes dudas puedes ponerte en contacto con nosotros.

Base URL

http://qclinicascloud.local

Identificación obligatoria

Necesitas estar indentificado en el sistema para poder hacer uso de los endpoints de la API enviando para ello una cabecera de
Authorization con el valor "Bearer {TU_CLAVE_DE_API_DE_QCLINICAS_CLOUD}".

Todos los endpoints que contengan el icono requires authentication en la documentación deberán llevar en la cabecera el token de autenticación.

Si todavía no tienes un token puedes crear uno en la pestaña "Cita online" de tu menú de "Organización".

Endpoints

S01- Listado de clínicas físicas disponibles.

requires authentication

Obtener un listado de clínicas físicas en las cuales puedes solicitar la reserva de una cita.

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'http://qclinicascloud.local/api/v1/sedes',
    [
        'headers' => [
            'Authorization' => 'Bearer {TU_CLAVE_DE_API_DE_QCLINICAS_CLOUD}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "http://qclinicascloud.local/api/v1/sedes"
);

const headers = {
    "Authorization": "Bearer {TU_CLAVE_DE_API_DE_QCLINICAS_CLOUD}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "data": {
        "id": "djmWX1RBxpjOgpoL7wYD",
        "nombre": "Sede Quadralia",
        "domicilio_linea_1": "Travía 1",
        "domicilio_linea_2": "1ºC",
        "codigo_postal": "36400",
        "municipio": "Porriño (O)",
        "provincia": "Pontevedra",
        "pais": "España",
        "telefono": "986134373",
        "email": "pide.tu.cita.en@qclinicas.com"
    }
}
 

Request      

GET api/v1/sedes

E01- Listado de especialidades disponibles.

requires authentication

Obtener un listado de especialidades tratadas por la clínica en las que puedes solicitar una reserva de cita.

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'http://qclinicascloud.local/api/v1/especialidades',
    [
        'headers' => [
            'Authorization' => 'Bearer {TU_CLAVE_DE_API_DE_QCLINICAS_CLOUD}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "http://qclinicascloud.local/api/v1/especialidades"
);

const headers = {
    "Authorization": "Bearer {TU_CLAVE_DE_API_DE_QCLINICAS_CLOUD}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "data": [
        {
            "id": "dp8jzNBkOl9Jl7y3oq42",
            "nombre": "Estética",
            "duracion_cita": 50
        },
        {
            "id": "rej29YvAnB3O3oyzPK05",
            "nombre": "Fisioterapia",
            "duracion_cita": null
        },
        {
            "id": "wXK2GVM3x7vJ4ER0rYQ8",
            "nombre": "Podología",
            "duracion_cita": 10
        }
    ]
}
 

Request      

GET api/v1/especialidades

T01- Listado de tarifas disponibles.

requires authentication

Obtener un listado de todas las tarifas que la clínica ofrece.

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'http://qclinicascloud.local/api/v1/tarifas',
    [
        'headers' => [
            'Authorization' => 'Bearer {TU_CLAVE_DE_API_DE_QCLINICAS_CLOUD}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "http://qclinicascloud.local/api/v1/tarifas"
);

const headers = {
    "Authorization": "Bearer {TU_CLAVE_DE_API_DE_QCLINICAS_CLOUD}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "data": [
        {
            "id": "djmWX1RBxpjOgpoL7wYD",
            "nombre": "Servicio 1",
            "codigo": "SE001",
            "precio": "25.9500",
            "duracion_cita": 18
        },
        {
            "id": "wXK2GVM3x7vJ4ER0rYQ8",
            "nombre": "Servicio 2",
            "codigo": "SE002",
            "precio": "30.0000",
            "duracion_cita": 35
        },
        {
            "id": "Q7kKLqrpxQ3OZ8RdWyA0",
            "nombre": "Tratamiento 2",
            "codigo": "TR002",
            "precio": "18.1500",
            "duracion_cita": null
        }
    ]
}
 

Request      

GET api/v1/tarifas

C01- Listado de horas disponibles

requires authentication

Obtener un listado de todas las horas en las que se puede realizar una reserva.

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'http://qclinicascloud.local/api/v1/citas',
    [
        'headers' => [
            'Authorization' => 'Bearer {TU_CLAVE_DE_API_DE_QCLINICAS_CLOUD}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'fecha_inicio' => '"2023-02-23"',
            'fecha_fin' => '"2023-02-23"',
            'especialidad' => 'natus',
            'tarifa' => 'a',
            'sanitario' => 'hic',
            'sede' => 'voluptatem',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "http://qclinicascloud.local/api/v1/citas"
);

const headers = {
    "Authorization": "Bearer {TU_CLAVE_DE_API_DE_QCLINICAS_CLOUD}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "fecha_inicio": "\"2023-02-23\"",
    "fecha_fin": "\"2023-02-23\"",
    "especialidad": "natus",
    "tarifa": "a",
    "sanitario": "hic",
    "sede": "voluptatem"
};

fetch(url, {
    method: "GET",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (422):


{
 {
"message": "The given data was invalid.",
"errors": {
"especialidad": [
"El campo especialidad es obligatorio cuando tarifa no está presente."
],
"tarifa": [
"El campo tarifa es obligatorio cuando especialidad no está presente."
]
}
}
 

Example response (400):


{
 {
"data": {
"status": "ERROR",
"code": 5,
"info": "Marty McFly todavía no nos ha devuelto el delorean. La fecha tiene que ser igual o posterior a hoy"
}
}
 

Example response (200):


{
    "23/11/2022": [
        {
            "fecha": "23/11/2022",
            "hora_inicio": "09:00",
            "duracion_cita": "00:35",
            "sede": {
                "id": null,
                "nombre": "Sede principal"
            },
            "sanitario": {
                "id": "rej29YvAnB3O3oyzPK05",
                "nombre": "Jesús"
            },
            "tarifa": {
                "id": "wXK2GVM3x7vJ4ER0rYQ8",
                "nombre": "Servicio 2"
            }
        },
        {
            "fecha": "23/11/2022",
            "hora_inicio": "09:35",
            "duracion_cita": "00:35",
            "sede": {
                "id": null,
                "nombre": "Sede principal"
            },
            "sanitario": {
                "id": "GlR8Mbg5xdZO4jQp0y3L",
                "nombre": "Brais"
            },
            "tarifa": {
                "id": "wXK2GVM3x7vJ4ER0rYQ8",
                "nombre": "Servicio 2"
            }
        },
        {
            "fecha": "23/11/2022",
            "hora_inicio": "10:10",
            "duracion_cita": "00:35",
            "sede": {
                "id": null,
                "nombre": "Sede principal"
            },
            "sanitario": {
                "id": "GlR8Mbg5xdZO4jQp0y3L",
                "nombre": "Marta"
            },
            "tarifa": {
                "id": "wXK2GVM3x7vJ4ER0rYQ8",
                "nombre": "Servicio 2"
            }
        }
    ]
}
 

Request      

GET api/v1/citas

Body Parameters

fecha_inicio  string  

Must be a valid date in the format "Y-m-d".

fecha_fin  string  

Must be a valid date in the format "Y-m-d".

especialidad  string  

tarifa  string optional  

sanitario  string optional  

sede  string optional  

C02- Solicitar una reserva de cita con base a los parámetros enviados.

requires authentication

Enviar los datos requeridos por la clínica para proceder a la reserva. Según la configuración de la clínica, los datos enviados pueden ser obligatorios u opcionales y es obligación de usuario cubrir los obligatorios para que la petición de reserva se haga efectiva.

La reserva puede ser confirmada automáticamente en el momento de la reserva o bien quedar en estado de pendiente de confirmación, siendo la clínica posteriormente la que confirme la reserva -se le notificará al usuario- mediante los canales de comunicación que tenga establecidos la clínica.

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->post(
    'http://qclinicascloud.local/api/v1/citas',
    [
        'headers' => [
            'Authorization' => 'Bearer {TU_CLAVE_DE_API_DE_QCLINICAS_CLOUD}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'fecha' => '"2023-02-23"',
            'hora_inicio' => 'quae',
            'duracion' => 'explicabo',
            'tarifa' => 'in',
            'sanitario' => 'non',
            'sede' => 'sit',
            'datos_contacto' => [
                'nombre' => 'ratione',
                'apellido1' => 'eius',
                'apellido2' => 'quam',
                'nif' => 'perferendis',
                'email' => 'qui',
                'telefono' => 'harum',
            ],
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "http://qclinicascloud.local/api/v1/citas"
);

const headers = {
    "Authorization": "Bearer {TU_CLAVE_DE_API_DE_QCLINICAS_CLOUD}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "fecha": "\"2023-02-23\"",
    "hora_inicio": "quae",
    "duracion": "explicabo",
    "tarifa": "in",
    "sanitario": "non",
    "sede": "sit",
    "datos_contacto": {
        "nombre": "ratione",
        "apellido1": "eius",
        "apellido2": "quam",
        "nif": "perferendis",
        "email": "qui",
        "telefono": "harum"
    }
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (422):


{
    "message": "The given data was invalid.",
    "errors": {
        "datos_contacto.nombre": [
            "El campo datos contacto.nombre es obligatorio."
        ]
    }
}
 

Example response (400):


{
    "status": "ERROR",
    "code": 4,
    "info": "La clínica todavía no ha abierto el horario para la fecha solicitada"
}
 

Example response (200):


{
"data": {
"info": "La reserva de cita se ha solicitado correctamente. Recibirás más información acerca de
la confirmación a través del correo electrónico.",
"reserva": {
"fecha": "23/11/2022",
"hora_inicio": "09:00",
"duracion_cita": "00:35",
"sede": {
"id": null,
"nombre": "Sede principal"
},
"sanitario": {
"id": "GlR8Mbg5xdZO4jQp0y3L",
"nombre": "Brais"
},
"tarifa": {
"id": "wXK2GVM3x7vJ4ER0rYQ8",
"nombre": "Servicio 2"
}
}
}
}
 

Request      

POST api/v1/citas

Body Parameters

fecha  string  

Must be a valid date in the format "Y-m-d".

hora_inicio  string  

duracion  string  

tarifa  string optional  

sanitario  string  

sede  string optional  

datos_contacto  object optional  

datos_contacto.nombre  string  

datos_contacto.apellido1  string  

datos_contacto.apellido2  string optional  

datos_contacto.nif  string  

datos_contacto.email  string  

El campo value no tiene un formato válido.

datos_contacto.telefono  string  

U01- Listado de sanitarios disponibles.

requires authentication

Obtener un listado de todos los sanitarios disponibles para la clínica.

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'http://qclinicascloud.local/api/v1/sanitarios',
    [
        'headers' => [
            'Authorization' => 'Bearer {TU_CLAVE_DE_API_DE_QCLINICAS_CLOUD}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "http://qclinicascloud.local/api/v1/sanitarios"
);

const headers = {
    "Authorization": "Bearer {TU_CLAVE_DE_API_DE_QCLINICAS_CLOUD}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
"data": [
{
"id": "wXK2GVM3x7vJ4ER0rYQ8",
"nombre": "Iago Aspas",
},
{
"id": "bpVZ6je5JXmxl8PXgE9d",
"nombre": "Gerard Piqué",
},
{
"id": "GlR8Mbg5xdZO4jQp0y3L",
"nombre": "Leo Messi",
}
]
}
 

Request      

GET api/v1/sanitarios

T02- Listado de sanitarios por especialidad.

requires authentication

Obtener un listado de sanitarios que atienden a la especialidad indicada.

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'http://qclinicascloud.local/api/v1/tarifas/1/sanitarios',
    [
        'headers' => [
            'Authorization' => 'Bearer {TU_CLAVE_DE_API_DE_QCLINICAS_CLOUD}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "http://qclinicascloud.local/api/v1/tarifas/1/sanitarios"
);

const headers = {
    "Authorization": "Bearer {TU_CLAVE_DE_API_DE_QCLINICAS_CLOUD}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "data": [
        {
            "id": "wXK2GVM3x7vJ4ER0rYQ8",
            "nombre": "Iago",
            "apellido1": "Aspas"
        },
        {
            "id": "bpVZ6je5JXmxl8PXgE9d",
            "nombre": "Gerard",
            "apellido1": "Piqué"
        },
        {
            "id": "GlR8Mbg5xdZO4jQp0y3L",
            "nombre": "Leo",
            "apellido1": "Messi"
        }
    ]
}
 

Request      

GET api/v1/tarifas/{tarifa_id}/sanitarios

URL Parameters

tarifa_id  integer  

The ID of the tarifa.

O01- Campos obligatorios y opcionales para formalizar la reserva.

requires authentication

Obtener los campos obligatorios y opcionales que la organización solicita a los pacientes que utilicen el motor de reservas para formalizar dicha reserva de cita.

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'http://qclinicascloud.local/api/v1/organizacion',
    [
        'headers' => [
            'Authorization' => 'Bearer {TU_CLAVE_DE_API_DE_QCLINICAS_CLOUD}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "http://qclinicascloud.local/api/v1/organizacion"
);

const headers = {
    "Authorization": "Bearer {TU_CLAVE_DE_API_DE_QCLINICAS_CLOUD}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
"campos_reserva": "{
 "nif": "nullable",
 "email": "required",
 "nombre": "required",
 "telefono": "required",
 "apellido1": "required",
 "apellido2": "nullable"
 }",
}
 

Request      

GET api/v1/organizacion

E02- Listado de sanitarios por especialidad.

requires authentication

Obtener un listado de sanitarios que atienden a la especialidad indicada.

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'http://qclinicascloud.local/api/v1/especialidades/laboriosam/sanitarios',
    [
        'headers' => [
            'Authorization' => 'Bearer {TU_CLAVE_DE_API_DE_QCLINICAS_CLOUD}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "http://qclinicascloud.local/api/v1/especialidades/laboriosam/sanitarios"
);

const headers = {
    "Authorization": "Bearer {TU_CLAVE_DE_API_DE_QCLINICAS_CLOUD}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "data": [
        {
            "id": "wXK2GVM3x7vJ4ER0rYQ8",
            "nombre": "Iago",
            "apellido1": "Aspas",
            "tarifas": [
                {
                    "id": "djmWX1RBxpjOgpoL7wYD",
                    "nombre": "Servicio 1",
                    "codigo": "SE001",
                    "precio": "25.9500",
                    "duracion_cita": null
                }
            ]
        },
        {
            "id": "bpVZ6je5JXmxl8PXgE9d",
            "nombre": "Gerard",
            "apellido1": "Piqué",
            "tarifas": [
                {
                    "id": "djmWX1RBxpjOgpoL7wYD",
                    "nombre": "Servicio 1",
                    "codigo": "SE001",
                    "precio": "25.9500",
                    "duracion_cita": null
                }
            ]
        },
        {
            "id": "GlR8Mbg5xdZO4jQp0y3L",
            "nombre": "Leo",
            "apellido1": "Messi",
            "tarifas": [
                {
                    "id": "djmWX1RBxpjOgpoL7wYD",
                    "nombre": "Servicio 1",
                    "codigo": "SE001",
                    "precio": "25.9500",
                    "duracion_cita": null
                }
            ]
        }
    ]
}
 

Request      

GET api/v1/especialidades/{especialidadApi}/sanitarios

URL Parameters

especialidadApi  string  

E03- Listado de tarifas por especialidad.

requires authentication

Obtener un listado de tarifas que responden a la especialidad indicada.

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'http://qclinicascloud.local/api/v1/especialidades/aut/tarifas',
    [
        'headers' => [
            'Authorization' => 'Bearer {TU_CLAVE_DE_API_DE_QCLINICAS_CLOUD}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "http://qclinicascloud.local/api/v1/especialidades/aut/tarifas"
);

const headers = {
    "Authorization": "Bearer {TU_CLAVE_DE_API_DE_QCLINICAS_CLOUD}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
"data": [
{
"id": "djmWX1RBxpjOgpoL7wYD",
"nombre": "Servicio 1",
"codigo": "SE001",
"precio": "25.9500",
"duracion_cita": 18,
"sanitarios": [
{
 "id": "wXK2GVM3x7vJ4ER0rYQ8",
 "nombre": "Iago Aspas",
}
]
},
{
"id": "wXK2GVM3x7vJ4ER0rYQ8",
"nombre": "Servicio 2",
"codigo": "SE002",
"precio": "30.0000",
"duracion_cita": 35,
"sanitarios": [
{
 "id": "wXK2GVM3x7vJ4ER0rYQ8",
 "nombre": "Iago Aspas",
}
]
}
]
}
 

Request      

GET api/v1/especialidades/{especialidadApi}/tarifas

URL Parameters

especialidadApi  string  

Body Parameters

0  string optional  

L01- Textos legales: Condiciones de uso del motor de reservas de la clínica.

requires authentication

Obtener los textos legales de la clínica. El mismo aviso se puede obtener en formato url o en texto según haya especificado la clínica.

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'http://qclinicascloud.local/api/v1/condiciones-uso',
    [
        'headers' => [
            'Authorization' => 'Bearer {TU_CLAVE_DE_API_DE_QCLINICAS_CLOUD}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "http://qclinicascloud.local/api/v1/condiciones-uso"
);

const headers = {
    "Authorization": "Bearer {TU_CLAVE_DE_API_DE_QCLINICAS_CLOUD}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
"condiciones_uso_url": "htps://clinica-de-ejemplo.com/condiciones-uso",
"condiciones_uso_texto": "texto ejemplo",
}
 

Request      

GET api/v1/condiciones-uso

L02- Textos legales: política de privacidad del motor de reservas de la clínica.

requires authentication

Obtener los textos legales de la clínica. El mismo aviso se puede obtener en formato url o en texto según haya especificado la clínica.

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'http://qclinicascloud.local/api/v1/politica-privacidad',
    [
        'headers' => [
            'Authorization' => 'Bearer {TU_CLAVE_DE_API_DE_QCLINICAS_CLOUD}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "http://qclinicascloud.local/api/v1/politica-privacidad"
);

const headers = {
    "Authorization": "Bearer {TU_CLAVE_DE_API_DE_QCLINICAS_CLOUD}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
"politica_privacidad_url": "htps://clinica-de-ejemplo.com/politica-privacidad",
"politica_privacidad_texto": "texto ejemplo",
}
 

Request      

GET api/v1/politica-privacidad