# Create a New Channel of Facebook

This section describes for how to mechanism for create a new Facebook page channel, by doing the following steps:

Go to the **Integration** menu and click the channel connector menus, then you will see a channel connector page such images below.

![Integration](/files/-MUNqqmaAJEezNlOy0oR)

On the channel connector page, click the 'plus' button on the channel Facebook page, and then you will see a pop-up channel setting.&#x20;

![Channel Setting](/files/-MUvLjFw_DoHJueub1s4)

**Component Explanation:**

| **Field Name**  | Description                                                                                                                                                                                                         |
| --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| App ID          | A unique identification number will be added to your App.                                                                                                                                                           |
| App Secret      | Facebook App will automatically generate a secret code that is connected with your App. Its purpose is to authenticate demands from the application towards Facebook servers. This code is also used as a password. |
| Consumer Secret | Access token to the Facebook API                                                                                                                                                                                    |
| Access Token    | A Page access token to start using the platform APIs or to manage and access Page conversations in Messenger.                                                                                                       |
| Version         | API Version used on Facebook.                                                                                                                                                                                       |

### Get App ID

Copy Facebook page **‘App ID’** to the channel settings page which can be found on the **‘Settings’** section, select '**Basic'** from the drop-down menu. Settings basic console will be displayed. See the image below.

![Basic Settings](/files/-MUrNgd_OzSVp0I_DR9T)

Paste **‘App ID’** into the pop-up channel settings.

![App ID](/files/-MUrOEkXMq4dfS74ZNDS)

### Get App Secret

Copy the Facebook page **‘App Secret’** to the settings page which can be found on the **‘Settings’** section, select **'Basic'** from the drop-down menu. Settings basic console will be displayed, click the '**Show'** button on the app secret. See the image below.

![Basic Settings](/files/-MUrNgd_OzSVp0I_DR9T)

Paste **‘App Secret’** into the pop-up channel settings.

![App Secret](/files/-MUrPWi_bonR1P3hV382)

### Get User Access Token

Paste **‘User Access Token’** into the Facebook page channel settings box.

![User Acces Token](/files/-MUrXinehcZBgHAs5SX7)

You can get a user access token by following the steps below.&#x20;

#### Obtain Short-Lived User Access Token

Click the **'Tools'** menu, select '**Graph API Explorer'**.

![Graph API Explorer](/files/-MUvMVWVj2mj4pBfCH5q)

In the **Application**, select an app used to obtain the access token.

![Access Token](/files/-MUrR2hQs-3zU-dm01w6)

Click **User Token** → **Get User Access Token**.

![User Token](/files/-MUrTfiff2uf-CFJxVTS)

On the permission field, '**Select Permissions'**, under **User Data Permissions** check **Email** and under **Events, Groups & Pages**, Check **manage\_pages***,* **pages\_messaging***,* and **publish\_pages**. And, Click the '**Get Access Token'** button.

![Permissions](/files/-MUrSDp5G6EVnxqfOonw)

&#x20;Click the access token field to copy **User Access Token**.

![Copy User Access Token](/files/-MUrUeTlEl0kl6xw0mvG)

Check the properties in [**Access Token Debugger**](https://developers.facebook.com/tools/debug/accesstoken), click **Tool** to see the token in **Access Token Debugger** Paste the access token copied in the last step above to the text field and click the **'Debug'** button.

![Access Token Debugger](/files/-MUrUqVzxz8kGwdtWHZF)

Please check the followings:

![User Access Token](/files/-MUrVFuzICXXqNKBCVes)

1. **App ID**: the app id mentioned in the prerequisite section
2. **User ID**: you, a person who has admin right to the Facebook Page mentioned in the prerequisite section
3. **Expires**: a time stamp that would probably expires in an hour or two
4. **Scope**: should contain the '**email', 'manage\_pages', 'publish\_pages', 'pages\_messaging'** permission.

**Exchange for Long-Lived Access Token**

Click **Extend Access Token** to get a long-lived token.

![Extend Access Token](/files/-MUrVp7f3uS-iySbNfGG)

&#x20;Click the '**Debug'** button.

![Debug](/files/-MUrW9sTg0wlWIwEIqey)

Check the properties of this access token in **Access Token Debugger**. It should have a longer time such as 60 days, or Never in the 'Expires'.

![User Access Token](/files/-MUrWbrI59vPeWfOGXSo)

Check the properties of this page access token in **Access Token Debugger**:

1. **App ID**: the app id mentioned in the prerequisite section.
2. **Profile ID**: the page id mentioned in the prerequisite section.
3. **User ID**: you, a person who has admin right to the Facebook Page mentioned in the prerequisite section.
4. **Expires: Never**.

### Get Page Access Token

Paste **‘Page Access Token’** into the Facebook page channel settings box.

![Page Access Token](/files/-MUvVHItCklhlIXN-VV7)

You can get a page access token by following the steps below.

#### Obtain Short-Lived Page Access Token

Click the **'Tools'** menu, select '**Graph API Explorer'**.

![Graph API Explorer](/files/-MUrQY_8L83KuzqKKfAu)

In the **Application**, select an app used to obtain the access token.

![Access Token](/files/-MUrYtrIFwRhbdtGImfX)

Click **Get Token** → **Get Page Access Token**.

![Page Acces Token](/files/-MUrdc3pPt_cjM69Mst0)

Click the access token field to copy **Page Access Token**.

![Copy Page Access Token](/files/-MUre3Fg-LCOV8bMJFgT)

Check the properties in [**Access Token Debugger**](https://developers.facebook.com/tools/debug/accesstoken), click **Tool** to see the token in **Access Token Debugger**, paste the access token copied in the last step above to the text field and click the **'Debug'** button.

![Access Token Debugger](/files/-MUresZvoBU-SrIMnIoI)

Please check the followings:

![Page Access Token](/files/-MUrfcfaqTubICsgDE1Y)

1. **App ID**: the app id mentioned in the pre-requisite section.
2. **User ID**: you, a person who has admin right to the Facebook Page mentioned in the pre-requisite section.
3. **Type: User**.
4. **Expires**: a time stamp that would probably expires in an hour or two.

#### **Exchange for Long-Lived Page Access Token**

Click **Extend Access Token** to get a long-lived token.

![Exted Access Token](/files/-MUrg_uujZHawl1Q3SMI)

Click the '**Debug'** button.

![Debug](/files/-MUrh9Bh3Z4kKRIKQ8MM)

Check the properties of this access token in **Access Token Debugger**. It should have a longer time such as 90 days, or Never in the Expires.

![Page Access Token](/files/-MUrk8xiVH7A8xnctXBn)

1. **App ID**: the app id mentioned in the prerequisite section
2. **User ID**: you, a person who has admin right to the Facebook Page mentioned in the prerequisite section
3. **Type**: User.
4. **Expires:** About 2 Months.

Next, select the version and click the ‘**Authorize’** button.

![Version](/files/-MUvPa8GJznxFzN0wDk0)

On the pop-up, click '**Add Page Channel'**.

![Pop-up Authorization](/files/-MUrl549Q519UztmXVFQ)

If authorize successfully, click the ‘**Save’** button. And then, the Facebook Page channel ‘**3Dolphins SRM’** has successfully created.

![Add New Facebook Channel](/files/-MUvYc-TgHP8KzGCjyTU)

**Component Explanation:**

| No. | Component               | Description                                                                                               |
| --- | ----------------------- | --------------------------------------------------------------------------------------------------------- |
| 1.  | Channel Name            | Name of your Facebook Page channel. Hover on the channel name to view the channel port.                   |
| 2.  | Channel ID              | An ID, you register with 3Dolphins. Each channel registered in Omni Channel 3Dolphins has a different ID. |
| 3.  | Channel Config Button   | Click to use gateway.                                                                                     |
| 4.  | Channel URL Edit Button | Click to edit channel URL. If connecting with proxy, please adjust the URL accordingly.                   |
| 5   | Channel URL Copy Button | Click to copy the channel URL to the clipboard.                                                           |
| 6   | Online / Offline Button | Click to turn on or off the channel. Red means offline, Green means online.                               |
| 7   | Refresh Button          | Refresh your channel at any time to ensure you are always up to date with the refresh button.             |


---

# 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/5.1.x/integration/channel-connector/facebook/create-a-new-channel-of-facebook.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.
