# Setting up WhatsApp webhooks for responses

> [!NOTE]
>
> For general setup and configuration documentation for WhatsApp, see the WhatsApp with Apteco documentation.

The WhatsApp webhook process works as follows:

- Meta sends WhatsApp events as JSON to the webhook.
- Responses stream to your Webhooks table in the social database.
- You then run the social response gatherer to pull data from the Webhooks table and place it in the SO\_ response tables.

## Create an Orbit Webhook Connector app in Meta

1. Go to [developers.facebook.com](<https://developers.facebook.com/>) and sign in.
2. Select **My Apps**, then select **Create App**.
3. Select **Other**, then select **Next**.
4. Select **Business**.
5. Name your app **Orbit Webhook Connector** and verify by logging in again.

You should now have the Orbit Webhook Connector shell.

## Get your app secret and privacy policy address

You need an app secret to set up the webhook successfully.

Use this app secret as your `AptecoOrbitSecret` in the configuration below. This ensures you only receive events from this app.

## Configure the Orbit Responses API

> [!NOTE]
>
> Make sure you have access to the OrbitResponses API. Verify using Swagger.

Add the following configuration to your `appsettings.json` for the OrbitResponsesAPI:

JSON

```json
"WhatsApp": {
  "ConnectionString": "user id=faststats_service;password=xxx;initial catalog=SO_Develop;data source=192.0.2.1;pooling=true;max pool size=10000;",
  "ConfiguredToken": "some-whatsapp-token",
  "AptecoOrbitSecret": "some-whatsapp-secret",
  "VerifyPayloadAfterRoundtripThroughJsonParser": true
}
```

Where:

- `ConnectionString`: points to your social response database
- `ConfiguredToken`: the token you wish to use when validating your webhook in Meta (e.g. `00000000-0000-0000-0000-000000000000`)
- `AptecoOrbitSecret`: your app secret from Meta

## Get your webhook endpoint

Navigate to the Orbit Responses API Swagger page to find your endpoint.

## Set up the webhook in Meta

1. In your Orbit Webhook Connector app, choose to add **Webhooks**.
2. Select **Subscribe** to get to the verification page.
3. Enter the webhook URL found in the previous step.

   > **Note**
   >
   > Enter the `ConfiguredToken` value (e.g. `00000000-0000-0000-0000-000000000000`) as the **Verify Token**.
4. Subscribe to the **messages** events.
5. Make sure your connector is now live.

You can now send WhatsApp messages and Apteco will store the messages and replies in your response database.
