# Facebook Gateway

How do I connect two facebook channels in one app? in this case, 3Dolphins uses the channel gateway feature. The channel gateway feature allows data to flow from one App to several channels according to the pages.

for example case :

When there is a message from the customer on the Facebook page.

|                 | Customer Message                                         |
| --------------- | -------------------------------------------------------- |
| Facebook Page 1 | Hi, What is 3Dolphins Chatbot?                           |
| Facebook Page 2 | Hello, what are the advantages of the 3Dolphins chatbot? |

Message from each page will incoming to the same apps, then the message will be forwarded to the gateway channel. Well, this gateway channel will stream customer messages to the appropriate channel message on the Facebook page. for example, when there is a message on Facebook page 1, the gateway channel will automatically send the message to the Facebook page 1 channel.

![Channel Gateway](/files/-MUx7eGD_iWXQJ2puoHz)

To use channel gateway, please follow this steps :

Start channel gateway, enter query **‘/start-gateway.sh’**.

![Start Gateway](/files/-MX6dlprdsgyU7dMKxmO)

Settings webhooks on the apps. (On the right side menu, select ‘**Webhooks**‘, click ‘**Edit Subscription**‘ button).

![Webhooks ](/files/-MUx5b2v9ugHfmdcIs0P)

Enter callback URL ‘<https://channel\\_url/gateway/callback’>.

![Callback URL](/files/-MUx5r39Yd3picLKPUBk)

Filed component explanation for ‘page subscription’:

* **Callback URL**: The URLs that Auth invokes after the authentication process
  * Use the following Callback URL: <https://channel\\_url/gateway/callback>
  * For example: <https://adapter.3dolphins.ai/facebook/callback>
* **Verify Token**: Label for token verification
  * For example: Facebook Gateway

To stop channel gateway, enter query **‘/stop-gateway.sh’**

![Stop Gateway ](/files/-MX6drjA2XdOOrQH4mjo)


---

# 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://docs.3dolphins.ai/integration/channel-connector/facebook/facebook-gateway.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.
