---
updatedAt: 2025-05-19T20:45:55.000Z
agentTools:
  projectIndex: https://docs.arianee.org/v1.0/llms.txt
---

# Message

Methods related to messages management.

## Create message

> ⚠️ Fees
>
> This method performs a blockchain transaction. It costs 1 credit and Gas.

**Method**

```javascript
ArianeeWallets.methods.createMessage(data)
```

| Parameter                 | Type   | Mandatory | Description                                                                                                                                           |
| :------------------------ | :----- | :-------- | :---------------------------------------------------------------------------------------------------------------------------------------------------- |
| `data`                    | Object | ✅         | Message creation data object.                                                                                                                         |
| `data` → `contentImprint` | String | ❌         | Message content imprint, either `contentImprint` or `content` need to be provided.                                                                    |
| `data` → `certificateId`  | Number | ✅         | Arianee token ID of the NFT.                                                                                                                          |
| `data` → `messageId`      | Number | ❌         | Message ID. Randomly generated if left empty.                                                                                                         |
| `data` → `content`        | Object | ❌         | [Message content object](https://api-documentation-nmp-test.readme.io/docs/message-schema), either `contentImprint` or `content` need to be provided. |

**Output**

`promise` returns `object`: The receipt of the blockchain transaction and keys.

* `contentImprint` - message content imprint.
* `messageId` - message ID.

**Example**

```javascript
const message={
    certificateId,
    content: {
        $schema: 'https://cert.arianee.org/version1/ArianeeMessage-i18nAlpha.json',
        title:'message title',
        content:'message content'
    }
}

const {  contentImprint, messageId } = await await wallet.methods.createMessage(event);
```

***

## Store message content

```javascript
ArianeeWallets.methods.storeMessage(certificateId, messageId, content, url)
```

| Parameter                 | Type   | Optional | Description                                                                                                                                           |
| :------------------------ | :----- | :------- | :---------------------------------------------------------------------------------------------------------------------------------------------------- |
| `data`                    | Object | ❌        | Message creation data object.                                                                                                                         |
| `data` → `contentImprint` | String | ✅        | Message content imprint, either `contentImprint` or `content` need to be provided.                                                                    |
| `data` → `certificateId`  | Number | ❌        | Arianee token ID of the NFT.                                                                                                                          |
| `data` → `messageId`      | Number | ✅        | Message ID. Randomly generated if left empty.                                                                                                         |
| `data` → `content`        | Object | ✅        | [Message content object](https://api-documentation-nmp-test.readme.io/docs/message-schema), either `contentImprint` or `content` need to be provided. |

**Output**

`promise` returns `any`.

**Example**

```javascript
await wallet
      .methods
      .storeMessage(
        certificateId, 
        messageId,
        message.content,
        'https://http://arianee.cleverapps.io/testnet/rpc');
```

***

## Get message information

**Method**

```javascript
ArianeeWallets.methods.getMessage(data)
```

| Parameter               | Type                           | Mandatory | Description                    |
| :---------------------- | :----------------------------- | :-------- | :----------------------------- |
| `data`                  | Object                         | ✅         | Message request data object.   |
| `data` → `messageId`    | Number                         | ❌         | Message ID.                    |
| `data` → `query`        | ConsolidatedCertificateRequest | ❌         | Object to request message.     |
| `data` → `url`          | String                         | ❌         | RPC server URL to get message. |
| `data` → `forceRefresh` | Boolean                        | ❌         | Force the messages refresh.    |

**Output**

`promise` returns `object`: The receipt of the blockchain transaction and keys.

* `certificateId` - Arianee token ID of the NFT linked to the message.
* `issuer`
  * `isIdentityVerified` - `yes` if issuer identity verified.
  * `isIdentityAuthentic` - `yes` if issuer identity authentic.
  * `imprint` - issuer imprint.
  * `identity` - issuer identity content.
* `to` - message recipient wallet public address.
* `messageId`- message ID.
* `timestamp`- message creation timestamp.

***

## Get your messages

**Method**

```javascript
ArianeeWallets.methods.getMyMessages(data)
```

| Parameter        | Type                           | Mandatory | Description                    |
| :--------------- | :----------------------------- | :-------- | :----------------------------- |
| `data`           | Object                         | ✅         | Message request data object.   |
| `data` → `query` | ConsolidatedCertificateRequest | ❌         | Object to request message.     |
| `data` → `url`   | String                         | ❌         | RPC server URL to get message. |

**Output**

`promise` returns array of `object`:

* `certificateId` - Arianee token ID of the NFT linked to the message.
* `issuer`
  * `isIdentityVerified` - `yes` if issuer identity verified.
  * `isIdentityAuthentic` - `yes` if issuer identity authentic.
  * `imprint` -  issuer imprint.
  * `identity`- issuer identity content.
* `to` : message recipient public address.
* `messageId`- message ID.
* `timestamp`- message creation timestamp.

***

## Mark message as read

> ⚠️ Fees
>
> This method performs a blockchain transaction. It costs Gas.

Mark a message as read and send $<Glossary>ARIA</Glossary>20 to the owner and wallet reward address.

**Method**

```javascript
ArianeeWallets.methods.markAsRead(messageId)
```

| Parameter   | Type   | Mandatory | Description |
| :---------- | :----- | :-------- | :---------- |
| `messageId` | Number | ✅         | Message ID. |

**Output**

`promise` returns `ExtendedBoolean`:

* `isTrue` - `true` if message is mark as read.
* `code` - returns code.
* `message` - returns message.

***

## Change send right for message issuer

Set optin/optout for a specific sender and NFT ID for current wallet.

> ⚠️ Fees
>
> This method performs a blockchain transaction. It costs Gas.

**Method**

```javascript
ArianeeWallets.methods.setMessageAuthorizationFor(certificateId, senderAddress, bool)

```

| Parameter       | Type    | Mandatory | Description                                   |
| :-------------- | :------ | :-------- | :-------------------------------------------- |
| `certificateId` | Number  | ✅         | Arianee NFT ID of the NFT.                    |
| `senderAddress` | String  | ✅         | Wallet address of the related message issuer. |
| `bool`          | Boolean | ✅         | `true` or `false` - Apply flag.               |

**Output**

`promise` returns `object`: The receipt of the blockchain transaction.

**Example**

```javascript
// Change optin flag for a specific sender 
wallet.methods.setMessageAuthorizationFor(12345,'0x5f89d20c4a88FC2479b08522d5adD0b605001E3e',false).then((data)  => {
})
```

***

## Read NFT send rights

Read optin/optout for a specific NFT ID.

> ⛔ Limitation
>
> Only return optin status of issuer only.

**Method**

```javascript
ArianeeWallets.methods.getMessageSenders({certificateId:CertificateId, query:ConsolidatedCertificateRequest})
```

| Parameter    | Type   | Mandatory | Description                                           |
| :----------- | :----- | :-------- | :---------------------------------------------------- |
| `parameters` | Object | ✅         | `certificateId` and `ConsolidatedCertificateRequest`. |

**Output**

`promise` returns `object`: `address` and `isIssuerAuthorized`.

**Example**

```javascript
// Read optin flag for a specific sender
wallet.methods.getMessageSenders(12345).then((data)  => {
})
```