> ## Documentation Index
> Fetch the complete documentation index at: https://developer.flabslis.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Connect Your WhatsApp Provider

> Send Flabs reports and bills from your own WhatsApp number, step by step.

## Before you start

* **A WhatsApp provider account** that can send approved templates from your number.
* **Flabs API access:** ask Flabs support for API access. You get a **Client ID** and **Client Secret**. If your lab already has an integration, use the same credentials.
* **A webhook URL:** a public HTTPS URL on your side that receives the events and sends the WhatsApp through your provider.

## Steps

<Steps>
  <Step title="Add the templates to your provider">
    Create the [templates](/whatsapp/templates) in your provider and get them approved by Meta.
  </Step>

  <Step title="Get a token">
    ```bash theme={null}
    curl --request POST \
      --url https://v2.flabs.in/client/auth/token \
      --header 'Content-Type: application/json' \
      --data '{ "clientID": "<Client ID>", "clientSecret": "<Client Secret>" }'
    ```

    Copy `authToken` from the response (valid for 10 minutes).
  </Step>

  <Step title="Register your webhook">
    ```bash theme={null}
    curl --request POST \
      --url https://v2.flabs.in/client/events/subscribe \
      --header 'Authorization: Bearer <authToken>' \
      --header 'Content-Type: application/json' \
      --data '{
        "labID": "<branch ID>",
        "events": ["report.send", "bill.send"],
        "endpoint": "<your webhook URL>",
        "protocol": "https"
      }'
    ```

    Do this once per branch. See [Register WhatsApp Webhook](/whatsapp/register-webhook).
  </Step>

  <Step title="Test">
    Send a test bill or report (or click **WhatsApp** on a booking) to your own number. Your webhook receives the [event](/whatsapp/payload) and the WhatsApp arrives from your number.
  </Step>

  <Step title="Go live">
    From now on only your provider sends the subscribed messages. To go back to the Flabs number (or AiSensy), [delete the webhook](/whatsapp/register-webhook#remove-or-change).
  </Step>
</Steps>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.