# API

## Actions: Uso del nodo “API” en Dapta

Caso de uso: Obtener las citas agendadas desde Cal.com y traerlas a un flujo automatizado.

{% embed url="<https://www.loom.com/share/81e8cba0adb140c2ba320ff9f6a45af0?sid=ed359d56-16c7-4091-b847-2137af9db34a>" %}

***

### ✅ ¿Qué es el nodo API?

Es una acción de Dapta que te permite conectarte con otras plataformas (como CRMs, Google Sheets, WhatsApp, etc.) usando sus APIs públicas.\
Con este nodo puedes consultar, enviar o recibir información desde un sistema externo.

***

### 🎯 ¿Qué vas a lograr?

En este ejemplo, vas a aprender cómo conectarte con[ Cal.com](https://cal.com), una plataforma para agendar citas (similar a Calendly), y traer automáticamente las citas que hayan sido reservadas en tu calendario.

***

### 🧭 Paso a paso para configurar el nodo

#### 1. API [cal.com](http://cal.com) para realizar el ejemplo

[https://cal.com/docs/api-reference/v2/bookings/get-all-bookings\ <br>](https://cal.com/docs/api-reference/v2/bookings/get-all-bookings)Curl:

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXdMGygWS2coAw63s2SYQgdUdlJKuh8T4qeNSChb6T7tToiUW6iAzvkyPHS5FeqJXEe6rRpPz4ZuBjWpICVnSjDoSJX8vPzRRItpq-G5zKSELyg99OSnAqcQRnaLKB5fGUGw1p7mMA?key=f_KTXLVGDSUQNBG6FelZPQ" alt=""><figcaption></figcaption></figure>

2\. Crea una API Key en Cal.com

* Entra a tu cuenta de Cal.com.
* Ve al menú lateral izquierdo y haz clic en Settings (Configuraciones).

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXegR-I_xli41Lf5YpECLmqJwDY_6fgCq7CxzjzslN5uKW5ers6gq3AUDiedsLcZjZB31xBZcvmCin9NlhCszyp15uHxUtKstDQPuBwzXObAZWr0RIGnF4PB0IOKST1GMkTTenA9?key=f_KTXLVGDSUQNBG6FelZPQ" alt=""><figcaption></figcaption></figure>

* Busca la sección API Keys.

![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXcTgSv-B2s-7XB5Qp8H-uf0fKBRxLGRb3C7A62r8y03UQpRZIznX1stV14W-qYTmYw_Hj85i4FiGtOmn6xUqnzn837s087Verm5vsZWBJGM_nlEVPgN_HnVc8ljISvkKIQ2Qz6jGQ?key=f_KTXLVGDSUQNBG6FelZPQ)

* Crea una nueva clave con nombre (por ejemplo: "ACTION - API - DAPTA").
* Marca la opción para que nunca expire y copia el código (token).

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXfSXoUGm4_Abo8xZKFCPsU1Lpi1M1oAMdJjhn_vWaU3er7hW-ySGfJphl3OVfgiOEQj2mBAZ1tSEcnKOCb5LElC5Lo9Le-CFgqf0DpUDuKt14lp4HxfdpSDcnmU715i8kxc_gOe1g?key=f_KTXLVGDSUQNBG6FelZPQ" alt=""><figcaption></figcaption></figure>

👉 Este token es importante porque sirve como una “llave” para acceder a tu información desde Dapta.

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXcXdVuUB9JxmsxuhRYCHIGEBg9Je42yC_AwRFwz9AQtNv7fQFzppHVXJ5Ds5g3vCCkV5pM78b0iYUM5DlwxRw_KCrsLslnwaPQXf5-M2_JN_YzmkDdgR7bg2EM2Za1blWdrQc8dlA?key=f_KTXLVGDSUQNBG6FelZPQ" alt=""><figcaption></figcaption></figure>

***

3\. Configura el nodo API en Dapta

**A. Método y URL**

* Método: GET
* URL: <https://api.cal.com/v2/bookings>

Esto significa que queremos consultar (leer) información de la lista de agendamientos.

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXde9mO7UIv2ddHLQ_6RvaD40NIcCvRZgY25ngAFZFeSbUVhiqNrVCNDpD5H9fEvVNog5dR4lVkmT3fjblQ-5yo3IiQgvtkfiDzZfIkkA6CLBrVGo49fj8KcDal_KYX0tCx2n_nBfQ?key=f_KTXLVGDSUQNBG6FelZPQ" alt=""><figcaption></figcaption></figure>

**B. Encabezados (Headers)**

Aquí debes decirle a Cal.com que tienes permiso para acceder a la información usando tu token.

* Key: Authorization
* Value: Bearer TU\_TOKEN\_AQUI\
  (Reemplaza TU\_TOKEN\_AQUI por el que copiaste de [Cal.com](http://cal.com))

**C. Parámetros opcionales (Query Parameters) (Opcional)**

Si quieres, puedes filtrar las citas que te devuelve Cal.com.\
Por ejemplo, puedes traer solo las citas con cierto estado o de cierto evento. Ejemplos:

* status: Filtra por estado (confirmed, canceled, etc.)
* eventTypeId: Filtra por tipo de evento

4\. Respuesta (complemento)\
Añadir un nodo de “response” ayuda a controlar la salida de la información

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXc0-IbWFI-6wO4s2t11JQlXf1k4AKhnMr-tjZCxuk_DQjSlLvHVXMVyFmGYmiAiEOjuojTmGVX5SwTYzn2UWEz5cwDqwvYD3g0AC9iAHo1LwWkocRkGpCYPKFTiJdXv0lUGAYzrYQ?key=f_KTXLVGDSUQNBG6FelZPQ" alt=""><figcaption></figcaption></figure>

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXeaeka9RqDcag6zbPyGes0mWPS8eraRReaPQhPtXTxHvDMboKmXoE7GTXUuCJxOKe2oSlhbmKBK6O9sJrJNa9f1ACE7SEombP0T9nO8NmoJNB1kAE4jOJVewkG_pJr_F1C5rnSzGA?key=f_KTXLVGDSUQNBG6FelZPQ" alt=""><figcaption></figcaption></figure>

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXfkJjcO_f8jBhiLAn9u541VdHQr5-BaHd0kWTZgD4JafCQ-UfdW1oDBcUtv1XmIqjVMEb7O2jWhRew50cKBTdKtE5Ie9rrEsT8t452a9IU3Z9lh3hdQ1binmhy-hW9331UuuoktUQ?key=f_KTXLVGDSUQNBG6FelZPQ" alt=""><figcaption></figcaption></figure>

<br>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.dapta.ai/dapta-docs-es/actions/api.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
