# Message

## Send t**ext message**

| Name                                          | Parameters Description                                                                                                                                                                          | Response       |
| --------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------- |
| `sendTextMessage(roomId,body,txnId,callback)` | <ul><li><code>roomId</code>: room id</li><li><code>body</code>: message content string</li><li><code>txnId</code> (optional)：transaction id</li><li><code>callback</code> (optional):</li></ul> | <p>N/A<br></p> |

## **Send image**

| Name                                               | Parameters Description                                                                                                                                                                                                                    | Response       |
| -------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------- |
| `sendImageMessage(roomId,url,info,txnId,callback)` | <ul><li><code>roomId</code>: room id</li><li><code>url</code>: image url</li><li><code>info</code> (optional): image information</li><li><code>txnId</code> (optional)：transaction id</li><li><code>callback</code> (optional):</li></ul> | <p><br>N/A</p> |

## **Send notice**

| Name                                     | Parameters Description                                                                                                                                                                      | Response       |
| ---------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------- |
| `sendNotice(roomId,body,txnId,callback)` | <ul><li><code>roomId</code>: room id</li><li><code>body</code>: notice text string</li><li><code>txnId</code> (optional)：transaction id</li><li><code>callback</code> (optional)：</li></ul> | <p><br>N/A</p> |

## Get history message

| Name                                                   | Parameters Description                                                                                                                                                                                                                                                                                                                                     | Response                                  |                                                                                                                                                                            |
| ------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `createMessagesRequest(roomId, fromToken, limit, dir)` | <ul><li><code>roomId</code>: room id</li><li><code>fromToken</code>: Pagination identifier, pass an empty string for the first time, and pass the 'end' field returned from the previous call for subsequent calls.</li><li><code>limit</code> : number of events per page returned by the backend API.</li><li><code>dir</code> : direction, value is "b" | "f", where b: back, f: forward.</li></ul> | <p><br><code>end</code>: pagination identifier, if not returned, indicates completion of retrieval.<br><code>chunk</code>: retrieved event data, returned as an array.</p> |
|                                                        |                                                                                                                                                                                                                                                                                                                                                            |                                           |                                                                                                                                                                            |


---

# 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://sending-network.gitbook.io/sending.network/sdk-documentation/javascript-client-sdk/message.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.
