# Push Notification API

{% hint style="warning" %}
**IMPORTANTE**: O Push Notification funciona, no momento, apenas para alunos. Para que a notificação seja enviada com sucesso, o usuário precisa estar cadastrado na plataforma e ter feito login pelo menos uma vez no aplicativo. A notificação aparecerá somente quando o aplicativo estiver em segundo plano ou fechado.
{% endhint %}

## Disparar Push Notifications buscando o aluno pelo email

<mark style="color:green;">`POST`</mark> <https://api.themembers.dev.br/api/push-notification-by-email>

Com esta rota de API, você poderá enviar Push Notifications para um grupo de usuários que possuem os emails enviados na requisição.

**Headers**

| Name         | Value              |
| ------------ | ------------------ |
| Content-Type | `application/json` |
| Accept       | `application/json` |

**Body**

<table><thead><tr><th>Name</th><th width="203">Type</th><th>Description</th></tr></thead><tbody><tr><td>title</td><td>string</td><td>Titulo do Push Notification</td></tr><tr><td>body</td><td>string</td><td>Mensagem do Push Notification</td></tr><tr><td>emails</td><td>array</td><td>Um ou mais emails</td></tr><tr><td>developer_token</td><td>string</td><td>token_do_desenvolvedor</td></tr><tr><td>platform_token</td><td>string</td><td>token_da_plataforma</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
{
    "message": "Push notification sent successfully"
}
```

{% endtab %}

{% tab title="400" %}

```json
{
  "error": "Bad Request"
}
```

{% endtab %}
{% endtabs %}

## Disparar Push Notifications buscando o(s) aluno(s) pelo ID de produto

<mark style="color:green;">`POST`</mark> <https://api.themembers.dev.br/api/push-notification-by-product>

Com esta rota de API, você poderá enviar Push Notifications para um grupo de alunos que possuem assinaturas nos mesmos produtos.

**Headers**

| Name         | Value              |
| ------------ | ------------------ |
| Content-Type | `application/json` |
| Accept       | `application/json` |

**Body**

<table><thead><tr><th>Name</th><th width="203">Type</th><th>Description</th></tr></thead><tbody><tr><td>title</td><td>string</td><td>Titulo do Push Notification</td></tr><tr><td>body</td><td>string</td><td>Mensagem do Push Notification</td></tr><tr><td>product_ids</td><td>array</td><td>Um ou mais IDs de produto</td></tr><tr><td>developer_token</td><td>string</td><td>token_do_desenvolvedor</td></tr><tr><td>platform_token</td><td>string</td><td>token_da_plataforma</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
{
   "message": "Push notification sent successfully"
}
```

{% endtab %}

{% tab title="400" %}

```json
{
  "error": "Bad Request"
}
```

{% endtab %}
{% endtabs %}


---

# 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://documentation.themembers.dev.br/api-push-notification/push-notification-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.
