> For the complete documentation index, see [llms.txt](https://missiveapp.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://missiveapp.com/docs/developers/es/rest-api.md).

# API REST

Use la API REST de Missive para enriquecer conversaciones, automatizar borradores, Sincronizar contactos y más.

La API de Missive le permite enriquecer las conversaciones de Missive con contenido de cualquier lugar de la web. También puede automatizar tareas como crear y enviar borradores, sincronizar contactos y más.

<div data-with-frame="true"><img src="https://2737945495-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FegxqkD7AXM4n11rNf5qI%2Fuploads%2Fgit-blob-d4c7502fa58585f3a1b3050bb1672f806ff44dd6%2Fpost%20demo%20837ff16f2134b2eb4887a40565599235342f710c7fcf8da425fc5afe91d554ca.png?alt=media" alt="Ejemplo de una publicación creada mediante la REST API" width="563"></div>

p. ej. Una acción en otra app insertando una publicación en una conversación.

#### Aspectos básicos

La API es un conjunto de endpoints con un método (p. ej. `POST`) y una URL con el formato:

```
https://public.missiveapp.com/v1/:endpoint_name
```

#### Autenticación

Para empezar a usar la API, primero necesita obtener su API token. Obténgalo desde sus Preferencias de Missive, haga clic en la **API** pestaña, luego en el **Nuevo token** enlace.

{% hint style="info" %}
Necesita formar parte de una organización suscrita al [plan Productive](https://missiveapp.com/pricing) para generar API tokens.
{% endhint %}

Debe enviar su token de usuario como un `token Bearer` en el `Authorization` header HTTP.

{% code title="Ejemplo de solicitud" %}

```http
POST /v1/drafts
Host: public.missiveapp.com
Authorization: Bearer missive_pat-26pApm_QTmyhLLbA...FwoFGmJ6x-6fikpQ
```

{% endcode %}

{% hint style="info" %}
Todos los API tokens son personales. No existe un token a nivel de organización ni un token específico de cuenta compartida. Su token personal tiene acceso a cualquier cuenta a la que pueda acceder en Missive, incluidas las cuentas compartidas. Use los parámetros account o mailbox en sus solicitudes para filtrar los resultados a una cuenta compartida específica.
{% endhint %}

#### Plantillas

Todas las Plantillas de la API tienen formato [JSON](http://www.json.org/), incluidos los errores. Las solicitudes exitosas pueden devolver el `POST` código de estado [201](https://en.wikipedia.org/wiki/List_of_HTTP_status_codes) sin cuerpo.

#### Evaluación de Plantillas

Debe inferir el éxito de sus solicitudes a partir del código de estado HTTP devuelto. Una solicitud exitosa devolverá ya sea un [200](https://en.wikipedia.org/wiki/List_of_HTTP_status_codes) o [201](https://en.wikipedia.org/wiki/List_of_HTTP_status_codes) código de estado.

#### Cuerpos POST

Debe enviar explícitamente las solicitudes POST con `Content-Type: application/json`.

{% code title="Ejemplo de POST" %}

```http
POST /v1/drafts
Host: public.missiveapp.com
Authorization: Bearer missive_pat-26pApm_QTmyhLLbA...FwoFGmJ6x-6fikpQ
Content-Type: application/json

{"drafts":{}}
```

{% endcode %}

#### ID de recursos

Para interactuar con recursos a través de la API, necesitará el `ID`. Por ejemplo, si desea aplicar una etiqueta a una conversación al crear una publicación, necesitará la etiqueta `ID`. Puede obtener esos ID de recursos al abrir la Configuración de API y hacer clic en la pestaña ID de recursos.

<div data-with-frame="true"><img src="https://2737945495-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FegxqkD7AXM4n11rNf5qI%2Fuploads%2Fgit-blob-df98688126a968a54a0aa12f7fe7b7040b2445a3%2Fresource%20ids%20f49af9ae85108c87a6db51903e6f25c86583020b057d5e415b8eeaaa528d243a.png?alt=media" alt="Encuentre los ID de recursos en su Configuración de API"></div>

Configuración > API > ID de recursos

Última actualización el 24 de febrero de 2020

<details>

<summary>¿Necesita respuestas más específicas?</summary>

[Contáctenos](https://missiveapp.com/docs/developers/es/contact.md)

</details>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://missiveapp.com/docs/developers/es/rest-api.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
