# WhatsApp

From hooks, you can integrate easily with Whatsapp to send and receive messages.

### Configure integration

First, you need to configure the settings in the application designer

{% hint style="info" %}
You will need to have configured your Facebook and WhatsApp applications properly. More info here: <https://developers.facebook.com/docs/whatsapp/business-management-api/get-started>
{% endhint %}

<figure><img src="/files/GoYJF3x2TLWurcySEQKJ" alt=""><figcaption><p>WhatsApp settings in Application Designer</p></figcaption></figure>

### Send Messages

To send a notification you can send it like this

```javascript
const sendWhatsAppMessage = require("./utils/sendWhatsAppMessage").default;

//send simple text
await sendWhatsAppMessage({
  to: '573173896699',
  type: 'text',
  content: { body: 'hola mundo' },
});

//send messages using WhatsApp templates
await sendWhatsAppMessage({
  to: '573173896699',
  type: 'template',
  from: 'comercial',
  content: {
    name: 'sample_issue_resolution',
    language: {
      code: 'en_US',
    },
    components: [
      {
        type: 'body',
        parameters: [
          {
            type: 'text',
            text: 'Jhon Doe',
          },
        ],
      },
    ],
  },
});
```


---

# 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://codenull.gitbook.io/dev/configurations/hooks/whatsapp.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.
