# Facebook App Setup

Log into [Facebook for Developers](https://developers.facebook.com/) and Go to [MyApps](https://developers.facebook.com/apps/)

### Create New App

1. Click "Create App"
2. Choose "Business" from the "Select an app type" popup
3. Click "Continue"
4. Add "App Display Name"
5. Add "App Contact Email"
6. Choose "App Purpose" as "Yourself or your own business"
7. Choose a Business Manager account if you have one
8. Click "Create App"

{% hint style="warning" %}
In order to access certain aspects of the Facebook platform, apps may need to be connected to a verified Business Manager account. If you haven't yet set up an account, you can create one now or later in the process.
{% endhint %}

### Add Products to Your App

1. Find the "Messenger" from the page and click "Set Up"

### Access Tokens

1. Click "Add or Remove Pages"
2. Complete the Facebook authentication and select the pages
3. Generate token by clicking the button "Generate Token"
4. Copy that generated token
5. Go back to our dashboard
   1. Go to "Application Settings"
   2. Click "Facebook Messenger Setup"
   3. Add the generated token in the field "Token"
   4. Add a "Verification Key" (This can be any string)
   5. Click "Save Changes"

### Webhooks

{% hint style="danger" %}
To deploy a live webhook that can receive webhook events from the Messenger Platform, your code must be hosted on a public HTTPS server that meets the following requirements.

**HTTPS support:** Self-signed certificates are not supported. A valid SSL certificate.
{% endhint %}

1. Click the "Add Callback URL" button
2. Add "Callback URL"
3. Add "Verify Token" (This is the Verification Key you have added in the previous step)
4. Click "Verify and Save"
5. The verification should be successful before moving forward

```
Your Callback URL will be https::yourdomain.com/botman
```

### Add Subscriptions

1. Click the button "Add Subscription"
2. Choose the following fields from the Subscription Fields
   1. messages
   2. messaging\_postbacks
   3. messaging\_referrals
3. Click "Save"

{% hint style="warning" %}
To ensure quality and prevent abuse of the Platform, all Messenger apps must be submitted for review before they can interact with everyone on Messenger. During development, you will be able to send messages to anyone that has been granted either the Administrator, Developer, or Tester role for your app.
{% endhint %}


---

# 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://cedextech.gitbook.io/delta-quizy/getting-started/facebook-app-setup.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.
