# Facebook Messenger Sample

Demonstrates the Facebook Messenger connector (`FacebookMessengerConnector`): sending and receiving messages through a Facebook Page, schema validation, and webhook inbound processing.

## What it shows

* Building a `Message` with text or media content targeted at a Facebook Page recipient
* Sending via `IMessagingClient` using the `facebook` channel name
* Validating messages against the Facebook channel schema before sending
* Parsing inbound Facebook webhook payloads into `IMessage` objects
* Viewing the channel schema, capabilities, and parameters
* Checking connector runtime status

## Run

```bash
cd samples/facebook-messenger
./run.sh -- facebook <command>
```

## Commands

| Command              | Description                                               |
| -------------------- | --------------------------------------------------------- |
| `schema [name]`      | Show the Facebook channel schema                          |
| `configure`          | Prompt for Page Access Token, Page ID, and other settings |
| `send`               | Build and send a live Facebook message interactively      |
| `validate -k <kind>` | Validate a sample message (`text` or `media`)             |
| `status`             | Show connector runtime status                             |
| `receive [-f file]`  | Parse a sample Facebook webhook payload                   |

## Example

```bash
./run.sh -- facebook configure
./run.sh -- facebook send
```

You will be prompted to select the message type (Text or Media) and compose the content.


---

# 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://ratatosk.deveel.org/samples/facebook-messenger.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.
