# Receiving messages

## Inbound messages

In this section, you can find sample messages of every inbound message type supported by the Channels API from Line. The code snippets in every subsection demonstrate how a Line message is converted into a Channels API message.

See the following pages to understand more about [retrieving messages](/api/channels-api/api-reference/messaging.md) or [message statuses](/api/channels-api/message-status-and-interactions.md)

### Text

#### Text message

```json
{
    "id": "c2d34cdb-db79-4e3c-8cb1-5ba991c25b84",
    "channelId": "a1d50881-64f5-456c-a8ae-da18c0f203da",
    "sender": {
        "contact": {
            "id": "fb4bed31-cd9e-441b-b56d-6571c7ca8c30",
            "identifierKey": "line-2005309875",
            "identifierValue": "U82767028f6ac7935be3c631e2993212b",
            "annotations": {
                "name": "Test user"
            }
        }
    },
    "receiver": {
        "connector": {
            "id": "e2bf1441-2edd-483f-bfa3-6d30106177c0",
            "identifierValue": "2005309875"
        }
    },
    "body": {
        "type": "text",
        "text": {
            "text": "Incoming message"
        }
    },
    "meta": {},
    "reference": "",
    "parts": [
        {
            "platformReference": "518665685510651928"
        }
    ],
    "status": "delivered",
    "reason": "",
    "direction": "incoming",
    "chargeableUnits": 1,
    "lastStatusAt": "2024-07-26T07:49:07.923Z",
    "createdAt": "2024-07-26T07:49:07.588Z",
    "updatedAt": "2024-07-26T07:49:07.923Z"
}
```

#### Text message with emoji

```json
{
    "id": "8998f388-18f9-4bfa-a1ab-cb56ba3b809f",
    "channelId": "a1d50881-64f5-456c-a8ae-da18c0f203da",
    "sender": {
        "contact": {
            "id": "fb4bed31-cd9e-441b-b56d-6571c7ca8c30",
            "identifierKey": "line-2005309875",
            "identifierValue": "U82767028f6ac7935be3c631e2993212b",
            "annotations": {
                "name": "Test user"
            }
        }
    },
    "receiver": {
        "connector": {
            "id": "e2bf1441-2edd-483f-bfa3-6d30106177c0",
            "identifierValue": "2005309875"
        }
    },
    "body": {
        "type": "text",
        "text": {
            "text": "(cutting hole in floor) incoming (incoming)",
            "metadata": {
                "line": {
                    "emoji": {
                        "items": [
                            {
                                "index": 0,
                                "productId": "5ac22e85040ab15980c9b44f",
                                "emojiId": "001",
                                "length": 23
                            },
                            {
                                "index": 33,
                                "productId": "5ac21a18040ab15980c9b43e",
                                "emojiId": "154",
                                "length": 10
                            }
                        ]
                    }
                }
            }
        }
    },
    "meta": {},
    "reference": "",
    "parts": [
        {
            "platformReference": "517529016476369256"
        }
    ],
    "status": "delivered",
    "reason": "",
    "direction": "incoming",
    "chargeableUnits": 1,
    "lastStatusAt": "2024-07-18T11:37:19.357Z",
    "createdAt": "2024-07-18T11:37:19.166Z",
    "updatedAt": "2024-07-18T11:37:19.357Z"
}
```

### Image

```json
{
    "id": "1465e896-5493-4e69-be05-25cabf64e2d4",
    "channelId": "a1d50881-64f5-456c-a8ae-da18c0f203da",
    "sender": {
        "contact": {
            "id": "fb4bed31-cd9e-441b-b56d-6571c7ca8c30",
            "identifierKey": "line-2005309875",
            "identifierValue": "U82767028f6ac7935be3c631e2993212b",
            "annotations": {
                "name": "Test user"
            }
        }
    },
    "receiver": {
        "connector": {
            "id": "e2bf1441-2edd-483f-bfa3-6d30106177c0",
            "identifierValue": "2005309875"
        }
    },
    "body": {
        "type": "image",
        "image": {
            "images": [
                {
                    "mediaUrl": "https://media.api.sandbox.bird.one/workspaces/ed06c631-ca43-47cc-b4a7-a7e2b141b22e/messages/1465e896-5493-4e69-be05-25cabf64e2d4/media/a42938aa-ee3d-437f-85f2-879f031d3c2e"
                }
            ]
        }
    },
    "meta": {},
    "reference": "",
    "parts": [
        {
            "platformReference": "518666020736204961"
        }
    ],
    "status": "delivered",
    "reason": "",
    "direction": "incoming",
    "chargeableUnits": 1,
    "lastStatusAt": "2024-07-26T07:52:26.515Z",
    "createdAt": "2024-07-26T07:52:26.416Z",
    "updatedAt": "2024-07-26T07:52:26.515Z"
}
```

### File

```json
{
    "id": "8f343ba0-b4d9-423d-b669-6105a145518e",
    "channelId": "a1d50881-64f5-456c-a8ae-da18c0f203da",
    "sender": {
        "contact": {
            "id": "fb4bed31-cd9e-441b-b56d-6571c7ca8c30",
            "identifierKey": "line-2005309875",
            "identifierValue": "U82767028f6ac7935be3c631e2993212b",
            "annotations": {
                "name": "Test user"
            }
        }
    },
    "receiver": {
        "connector": {
            "id": "e2bf1441-2edd-483f-bfa3-6d30106177c0",
            "identifierValue": "2005309875"
        }
    },
    "body": {
        "type": "file",
        "file": {
            "files": [
                {
                    "contentType": "video/mp4",
                    "mediaUrl": "https://media.api.sandbox.bird.one/workspaces/ed06c631-ca43-47cc-b4a7-a7e2b141b22e/messages/8f343ba0-b4d9-423d-b669-6105a145518e/media/c5478cfe-d399-43e4-b502-d8a409845ddb"
                }
            ]
        }
    },
    "meta": {},
    "reference": "",
    "parts": [
        {
            "platformReference": "518666192702145051"
        }
    ],
    "status": "delivered",
    "reason": "",
    "direction": "incoming",
    "chargeableUnits": 1,
    "lastStatusAt": "2024-07-26T07:54:11.313Z",
    "createdAt": "2024-07-26T07:54:11.171Z",
    "updatedAt": "2024-07-26T07:54:11.313Z"
}
```

### Location

```json
{
    "id": "663ffb25-f0c8-4a5b-aaba-3c9f8739287b",
    "channelId": "a1d50881-64f5-456c-a8ae-da18c0f203da",
    "sender": {
        "contact": {
            "id": "fb4bed31-cd9e-441b-b56d-6571c7ca8c30",
            "identifierKey": "line-2005309875",
            "identifierValue": "U82767028f6ac7935be3c631e2993212b",
            "annotations": {
                "name": "Test user"
            }
        }
    },
    "receiver": {
        "connector": {
            "id": "e2bf1441-2edd-483f-bfa3-6d30106177c0",
            "identifierValue": "2005309875"
        }
    },
    "body": {
        "type": "location",
        "location": {
            "coordinates": {
                "latitude": 52.378653,
                "longitude": 4.900124
            },
            "location": {
                "address": "Stationsplein 37B, 1012 AB Amsterdam, Netherlands",
                "label": ""
            }
        }
    },
    "meta": {},
    "reference": "",
    "parts": [
        {
            "platformReference": "518666390656778707"
        }
    ],
    "status": "delivered",
    "reason": "",
    "direction": "incoming",
    "chargeableUnits": 1,
    "lastStatusAt": "2024-07-26T07:56:06.462Z",
    "createdAt": "2024-07-26T07:56:06.307Z",
    "updatedAt": "2024-07-26T07:56:06.462Z"
}
```

### Interactive message

#### Interactive message reply

```json
{
    "id": "a99ebf46-cfd0-4895-9d99-598ebeaab4d3",
    "channelId": "a1d50881-64f5-456c-a8ae-da18c0f203da",
    "sender": {
        "contact": {
            "id": "fb4bed31-cd9e-441b-b56d-6571c7ca8c30",
            "identifierKey": "line-2005309875",
            "identifierValue": "U82767028f6ac7935be3c631e2993212b",
            "annotations": {
                "name": "Test user"
            }
        }
    },
    "receiver": {
        "connector": {
            "id": "e2bf1441-2edd-483f-bfa3-6d30106177c0",
            "identifierValue": "2005309875"
        }
    },
    "body": {
        "type": "text",
        "text": {
            "text": "Yes"
        }
    },
    "meta": {},
    "reference": "",
    "parts": [
        {
            "platformReference": "518666513986355384"
        }
    ],
    "status": "delivered",
    "reason": "",
    "direction": "incoming",
    "chargeableUnits": 1,
    "lastStatusAt": "2024-07-26T07:57:20.831Z",
    "createdAt": "2024-07-26T07:57:20.695Z",
    "updatedAt": "2024-07-26T07:57:20.831Z"
}
```

#### Interactive message postback

```json
{
    "id": "b4f87a47-fa5f-4719-b5f9-b2dfd6c8f56e",
    "channelId": "a1d50881-64f5-456c-a8ae-da18c0f203da",
    "sender": {
        "contact": {
            "id": "fb4bed31-cd9e-441b-b56d-6571c7ca8c30",
            "identifierKey": "line-2005309875",
            "identifierValue": "U82767028f6ac7935be3c631e2993212b",
            "annotations": {
                "name": "Test user"
            }
        }
    },
    "receiver": {
        "connector": {
            "id": "e2bf1441-2edd-483f-bfa3-6d30106177c0",
            "identifierValue": "2005309875"
        }
    },
    "body": {
        "type": "text",
        "text": {
            "text": "postback-payload-1",
            "actions": [
                {
                    "type": "postback",
                    "postback": {
                        "text": "postback-payload-1",
                        "payload": "postback-payload-1"
                    }
                }
            ]
        }
    },
    "meta": {},
    "reference": "",
    "replyTo": {
        "id": "53e0bb8c-9071-4b2d-98e7-58bb1916c467",
        "order": 0,
        "type": "click"
    },
    "parts": [
        {
            "platformReference": "01J3Q1QJW2RKC180JYJW9815YC"
        }
    ],
    "status": "delivered",
    "reason": "",
    "direction": "incoming",
    "chargeableUnits": 1,
    "lastStatusAt": "2024-07-26T08:15:19.192Z",
    "createdAt": "2024-07-26T08:15:19.025Z",
    "updatedAt": "2024-07-26T08:15:19.192Z"
}
```


---

# 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.bird.com/api/channels-api/supported-channels/programmable-line/receiving-messages.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.
