---
title: "Facebook Messenger incoming messages"
description: "Get started with CM.com's Developer API Documentation for Facebook Messenger Inbound. Find everything you need to implement inbound Facebook Messenger messages for your business."
canonical: "https://docs.cm.com/messaging/other-channels/facebook-messenger-inbound"
---

# Facebook Messenger incoming messages

> Get started with CM.com's Developer API Documentation for Facebook Messenger Inbound. Find everything you need to implement inbound Facebook Messenger messages for your business.

Source: https://docs.cm.com/messaging/other-channels/facebook-messenger-inbound

This page describes the incoming (MO) messages you can receive from Facebook Messenger users through the CM.com Messaging API.

For the generic behaviour of inbound messages across all channels, see [Incoming messages](https://docs.cm.com/messaging/business-messaging/incoming-messages).

The main difference to other channels is the fact that Facebook Messenger uses numeric identifier for a sender and recipient. So called **"Page Scoped User ID (PSID)"** for the sender and a **"Page ID"** for the recipient of the MO message. A person is assigned a unique PSID for each Facebook Page they start a conversation with.

These identifiers are visible in the CM.com platform as the `userid` under `channels...Facebook Messenger`.

### Media message

> See also [receiving media messages](https://docs.cm.com/messaging/business-messaging/incoming-messages#media-messages)

The support and restrictions for media files are the same as for [sending Facebook Messenger messages](https://docs.cm.com/messaging/other-channels/facebook-messenger#fact-sheet).

### Suggestions

#### Quick reply

When the customer clicks on an item in a quick reply suggestion list, the reply will have the original action and the original postbackData in the custom/suggestions item:

```json
"custom: "{
  "suggestions": [
    {
      "action": "Reply",
      "postbackData": "EDIT_APPOINTMENT"
    }
  ]
}
```

#### Example message

```json
{
  "reference": "my-reference",
  "messageContext": "",
  "from": {
    "number": "87654321",
    "name": "John Doe"
  },
  "to": {
    "number": "12345678"
  },
  "message": {
    "text": "Edit appointment",
    "media": {
      "mediaUri": "",
      "contentType": "",
      "title": ""
    },
    "custom": {
      "suggestions": [
        {
          "action": "Reply",
          "postbackData": "EDIT_APPOINTMENT"
        }
      ]
    }
  },
  "groupings": ["", "", ""],
  "time": "2021-05-27 15:47:52",
  "timeUtc": "2021-05-27T13:47:52",
  "channel": "Facebook Messenger"
}
```

#### Chosen product

:::warning[Note]
This feature is in beta and not publicly available yet
:::

There are two scenarios in which you will receive this type of message:

- When the end-user reacts to a sent product template (mobile only)
  - The end-user will be redirected to your Facebook shop when reacting via browser
- When the end-user chooses a product in your Facebook shop

For both scenarios, the reply will have the referenced product id in the custom/suggestions item:

```json
"custom: "{
  "suggestions": [
    {
      "action": "ViewProduct",
      "postbackData": "PRODUCT_ID"
    }
  ]
}
```

#### Example message

```json
{
  "reference": "my-reference",
  "messageContext": "",
  "from": {
    "number": "87654321",
    "name": "John Doe"
  },
  "to": {
    "number": "12345678"
  },
  "message": {
    "text": "Chosen product",
    "media": {
      "mediaUri": "",
      "contentType": "",
      "title": ""
    },
    "custom": {
      "suggestions": [
        {
          "action": "ViewProduct",
          "postbackData": "PRODUCT_ID"
        }
      ]
    }
  },
  "groupings": ["", "", ""],
  "time": "2021-05-27 15:47:52",
  "timeUtc": "2021-05-27T13:47:52",
  "channel": "Facebook Messenger"
}
```
