---
updatedAt: 2025-11-12T22:15:58.000Z
agentTools:
  projectIndex: https://docs.nmp.arianee.com/llms.txt
---

# Fetch & Read Messages

## Fetch Received Messages

Fetch the dMessage a customer receives and retrieve information such as the digital passport receiver, if they have been read, and the content.

<Image align="center" width="600px" src="https://files.readme.io/09004b75ec0bfaa298aad99737cbbdca04a5d0c66e642a590c51d8c70a29cc25-Template_Flowchart_1.gif" />

#### URL

To fetch all the dMessages received by a digital passport owner, use [`https://custody.arianee.com/{{client}}/{{chainType}}/messages/getReceived`](https://docs.nmp.arianee.com/reference/fetchreceivedmessages).

```Text URL
GET - https://custody.arianee.com/{{client}}/{{chainType}}/messages/getReceived
```

#### Return Payload

| Status Code | Success | Description                 |
| :---------- | :------ | :-------------------------- |
| `200`       | `true`  | The dMessages are returned. |

```json 200 Return Payload
[
    {
        "data": {
            "id": "617768167",
            "certificateId": "287574096",
            "content": {
                "$schema": "https://cert.arianee.org/version1/ArianeeMessage-i18n.json",
                "language": "en-US",
                "title": "Welcome to Arianee NFTs",
                "content": " Test automessage 25/04 15:38"
            },
            "rawContent": {
                "$schema": "https://cert.arianee.org/version1/ArianeeMessage-i18n.json",
                "language": "en-US",
                "title": "Welcome to Arianee NFTs",
                "content": " Test automessage 25/04 15:38"
            },
            "imprint": "TODO",
            "isRead": true,
            "protocol": {
                "name": "testnet",
                "chainId": 77
            },
            "receiver": "0xa45d9dacbea470cf93e8454aca5eca4e62fb5fcf",
            "sender": "0x57f5111a7e997a7ba63cc8976c92decbd86c1b08",
            "timestamp": 1686817705
        }
    }
]
```

#### Error

| Status Code | Success | Description                                          |
| :---------- | :------ | :--------------------------------------------------- |
| `404`       | `false` | The wallet may not exist. You are not authenticated. |

***

## Fetch Message using ID

Fetch a dMessage by providing its ID and retrieve associated information such as a digital passport's receiver, if it has been read, and the content.

<Image align="center" width="600px" src="https://files.readme.io/c11105022bb2f055de8b418a35f9fefb3360e8e92036efb3699dfaccddea5352-Template_Flowchart_13.gif" />

#### URL

To fetch the dMessage information, use [`https://custody.arianee.com/{{client}}/{{chainType}}/messages/get`](https://docs.nmp.arianee.com/reference/fetchmessageusingid).

```Text URL
POST - https://custody.arianee.com/{{client}}/{{chainType}}/messages/get
```

#### Body

<Table align={["left","left","left","left"]}>
  <thead>
    <tr>
      <th>
        Field
      </th>

      <th>
        Type
      </th>

      <th>
        Required
      </th>

      <th>
        Description
      </th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        `id`
      </td>

      <td>
        Number
      </td>

      <td>
        ✅
      </td>

      <td>
        dMessage identification number.
      </td>
    </tr>

    <tr>
      <td>
        `protocolName`
      </td>

      <td>
        String - `testnet`, `mainnet`, `arianeetestnet`, `mumbai`, `polygon`, `arialabs`, `stadetoulousain`, `ysl`, `testnetSbt`, `arianeeSupernet`, `arianeesbt`, `supernettestnet`
      </td>

      <td>
        ✅
      </td>

      <td>
        Protocol on which the dMessage and its receiver have been minted.\
        [Dig deeper into Arianee Protocols.](https://github.com/Arianee/conventions/tree/main/public/contractAddresses)
      </td>
    </tr>
  </tbody>
</Table>

```json Body Example
{
    "id": "617768167",
    "protocolName": "testnet"
}
```

#### Return Payload

| Status Code | Description                                          |
| :---------- | :--------------------------------------------------- |
| `200`       | The dMessage's information and content are returned. |

```json 200 Return Payload
{
    "data": {
        "id": "617768167",
        "certificateId": "287574096",
        "content": {
            "$schema": "https://cert.arianee.org/version1/ArianeeMessage-i18n.json",
            "language": "en-US",
            "title": "Welcome to Arianee NFTs",
            "content": " Test automessage 25/04 15:38"
        },
        "rawContent": {
            "$schema": "https://cert.arianee.org/version1/ArianeeMessage-i18n.json",
            "language": "en-US",
            "title": "Welcome to Arianee NFTs",
            "content": " Test automessage 25/04 15:38"
        },
        "imprint": "TODO",
        "isRead": true,
        "protocol": {
            "name": "testnet",
            "chainId": 77
        },
        "receiver": "0xa45d9dacbea470cf93e8454aca5eca4e62fb5fcf",
        "sender": "0x57f5111a7e997a7ba63cc8976c92decbd86c1b08",
        "timestamp": 1686817705
    }
}
```

#### Status Code

| Status Code | Success | Description                                          |
| :---------- | :------ | :--------------------------------------------------- |
| `400`       | `false` | The body of the request may be wrong.                |
| `404`       | `false` | The wallet may not exist. You are not authenticated. |
| `500`       | `false` | Error server.                                        |

```json 400 Return Payload
{
    "errors": [
        {
            "type": "field",
            "msg": "Invalid value",
            "path": "id",
            "location": "body"
        },
        {
            "type": "field",
            "msg": "id parameter is required and must be a string",
            "path": "id",
            "location": "body"
        },
        {
            "type": "field",
            "msg": "Invalid value",
            "path": "protocolName",
            "location": "body"
        },
        {
            "type": "field",
            "msg": "protocolName parameter is required and must be a string",
            "path": "protocolName",
            "location": "body"
        }
    ]
}
```

***

## Mark Message as Read

<Image align="center" width="600px" src="https://files.readme.io/e5820421b6eaaa21848d3423c82aae535ea82500cd3f938fcc69f98b8208de52-Template_Flowchart_2.gif" />

#### URL

Use the [`https://custody.arianee.com/{{client}}/{{chainType}}/messages/markAsRead`](https://docs.nmp.arianee.com/reference/markmessageasread).

```Text URL
POST - https://custody.arianee.com/{{client}}/{{chainType}}/messages/markAsRead
```

#### Body

<Table align={["left","left","left","left"]}>
  <thead>
    <tr>
      <th>
        Field
      </th>

      <th>
        Type
      </th>

      <th>
        Required
      </th>

      <th>
        Description
      </th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        `id`
      </td>

      <td>
        Number
      </td>

      <td>
        ✅
      </td>

      <td>
        Message identification number to be marked as read.
      </td>
    </tr>

    <tr>
      <td>
        `protocolName`
      </td>

      <td>
        String - `testnet`, `mainnet`, `arianeetestnet`, `mumbai`, `polygon`, `arialabs`, `stadetoulousain`, `ysl`, `testnetSbt`, `arianeeSupernet`, `arianeesbt`, `tezostestnet`, `supernettestnet`, `etherlinktestnet`
      </td>

      <td>
        ✅
      </td>

      <td>
        Protocol on which the message has been sent.\
        [Dig deeper into Arianee Protocols.](https://github.com/Arianee/conventions/tree/main/public/contractAddresses)
      </td>
    </tr>
  </tbody>
</Table>

```json Body Example
{
    "id": "606514080",
    "protocolName": "testnet"
}
```

#### Return Payload

<Table align={["left","left","left"]}>
  <thead>
    <tr>
      <th>
        Status Code
      </th>

      <th>
        Success
      </th>

      <th>
        Description
      </th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        `200`
      </td>

      <td>
        `true`
      </td>

      <td>
        `true`: The message is marked as read.\
        `false`: The message has already been marked as read.
      </td>
    </tr>
  </tbody>
</Table>

```json 200 Return Payload
{
    "success": true
}
```

#### Errors

| Status Code | Success | Description                                          |
| :---------- | :------ | :--------------------------------------------------- |
| `400`       | `false` | Not authorized. You must be authenticated.           |
| `404`       | `false` | The wallet may not exist. You are not authenticated. |
| `404`       | `false` | No message was found using this ID.                  |