---
updatedAt: 2025-05-19T20:52:23.000Z
agentTools:
  projectIndex: https://docs.arianee.org/llms.txt
---

# Manage Message

Methods related to <<glossary:dMessage>> data collection.

## Retrieve Received dMessages

Retrieve the content and data of dMessages received by a user on a given chain type.

#### Method

```javascript Method
wallet.message.getReceived(i18nStrategy?:useLanguages)
```

| Parameter  | Type                      | Required | Description            |
| :--------- | :------------------------ | :------- | :--------------------- |
| `language` | `en`, `fr`,  `es`, etc... | ❌        | Language(s) to return. |

```javascript Example
const wallet = new Wallet({ chainType: 'mainnet' });
const myMessage = await wallet.message.getReceived();
await myMessage[0].readMessage();
```

#### Return Payload

`promise` returns an `array` with message information.

```json Example
[{
    data: {
      id: '238153639',
      certificateId: '86429342',
      content: ArianeeMessageI18N,
      rawContent: ArianeeMessageI18N,
      imprint: 'TODO',
      isRead: true,
      protocol: { name: "testnet"; chainId: 77 }
      receiver: '0xa9bc90d24d0b8495043ab5857455444630028caf',
      sender: '0xb908b66915ecd1ec31e669adc9c71bdce44ec601',
      timestamp: 1682609160
    }
  }]
```

***

## Retrieve a dMessage

Retrieve a specific dMessage for a given protocol instance.

#### Method

```javascript Method
wallet.message.get(messageId, protocol, i18nStrategy?:useLanguages)
```

| Parameter   | Type                | Required | Description                                  |
| :---------- | :------------------ | :------- | :------------------------------------------- |
| `messageId` | String              | ✅        | Identification number of the message.        |
| `protocol`  | String              | ✅        | Protocol name.                               |
| `language`  | `en-US`, `fr-FR`... | ❌        | Language(s) returned in order of preference. |

#### Return Payload

`promise` returns an `object` with the message information.

```json Example
{
    data: {
      id: '238153639',
      certificateId: '86429342',
      content: ArianeeMessageI18N,
      rawContent: ArianeeMessageI18N,
      imprint: 'TODO',
      isRead: true,
      protocol: { name: "testnet"; chainId: 77 }
      receiver: '0xa9bc90d24d0b8495043ab5857455444630028caf',
      sender: '0xb908b66915ecd1ec31e669adc9c71bdce44ec601',
      timestamp: 1682609160
    }
  }
```

***

## Mark dMessage as read

#### Method

```javascript Method
wallet.message.readMessage(network, messageId)
```

| Parameter   | Type   | Required | Description                                |
| ----------- | ------ | -------- | ------------------------------------------ |
| `network`   | String | ✅        | Protocol network of the message.           |
| `messageId` | String | ✅        | Identification number of the read message. |

***

## Read opt-in/ou status

#### Methods

```javascript Blacklist Method
wallet.message.blackListAddress(msgSender, tokenId)
```

```javascript Unblacklist Method
wallet.message.unblackListAddress(msgSender, tokenId)
```

| Parameter   | Type   | Required | Description                                          |
| ----------- | ------ | -------- | ---------------------------------------------------- |
| `msgSender` | String | ✅        | The wallet address of the related message issuer.    |
| `tokenId`   | String | ✅        | Arianee digital passport ID of the digital passport. |