> ## Documentation Index
> Fetch the complete documentation index at: https://docs.stateset.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Messages

> This endpoint gets a message.

### Body

<ParamField body="id" type="string">
  This is the id of the message.
</ParamField>

### Response

<ResponseField name="id" type="string">
  This is the id of the message.
</ResponseField>

<ResponseField name="body" type="string">
  This is the body of the message.
</ResponseField>

<ResponseField name="created_at" type="datetime">
  This is the date and time when the message was created.
</ResponseField>

<ResponseField name="date" type="date">
  This is the date when the message was sent.
</ResponseField>

<ResponseField name="deliveredReceipt" type="boolean">
  This indicates if the message has been delivered.
</ResponseField>

<ResponseField name="from" type="string">
  This is the sender of the message.
</ResponseField>

<ResponseField name="fromMe" type="boolean">
  This indicates if the message was sent by the user.
</ResponseField>

<ResponseField name="is_public" type="boolean">
  This indicates if the message is public or private.
</ResponseField>

<ResponseField name="messageNumber" type="integer">
  This is the unique number assigned to the message.
</ResponseField>

<ResponseField name="sentReceipt" type="boolean">
  This indicates if the message has been sent.
</ResponseField>

<ResponseField name="time" type="time">
  This is the time when the message was sent.
</ResponseField>

<ResponseField name="timestamp" type="datetime">
  This is the timestamp of the message.
</ResponseField>

<ResponseField name="to" type="string">
  This is the recipient of the message.
</ResponseField>

<ResponseField name="user_id" type="string">
  This is the unique identifier for the user associated with the message.
</ResponseField>

<ResponseField name="username" type="string">
  This is the username of the user associated with the message.
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl --location --request GET 'https://api.stateset.com/v1/messages/:id' \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Token <token>' \
  --data-raw '{
      "id": "rt_1NXWPnCo6bFb1KQto6C8OWvE",
  }'
  ```

  ```graphQL GraphQL theme={null}

  query MyMessages {
    message {
      id
      body
      created_at
      date
      deliveredReceipt
      from
      fromMe
      is_public
      messageNumber
      sentReceipt
      time
      timestamp
      to
      user_id
      username
    }
  }


  ```

  ```js Node.js theme={null}
  const messages = await stateset.messages.retrieve({
    'rt_1NXWPnCo6bFb1KQto6C8OWvE'
  });
  ```

  ```py Python theme={null}
  messages = stateset.messages.retrieve({
    'rt_1NXWPnCo6bFb1KQto6C8OWvE'
  })
  ```

  ```go Golang  theme={null}
  messages, err := stateset.Messages.Retrieve(
    'rt_1NXWPnCo6bFb1KQto6C8OWvE'
  )
  ```

  ```ruby Ruby theme={null}
  messages = Stateset::Messages.retrieve(
    'rt_1NXWPnCo6bFb1KQto6C8OWvE'
  )
  ```

  ```java Java theme={null}
  Message messages = Stateset.Messages.retrieve(
    'rt_1NXWPnCo6bFb1KQto6C8OWvE'
  );
  ```

  ```csharp C# theme={null}
  Message messages = Stateset.Messages.Retrieve(
    'rt_1NXWPnCo6bFb1KQto6C8OWvE'
  );
  ```

  ```php PHP theme={null}
  $messages = Stateset\Messages::retrieve(
    'rt_1NXWPnCo6bFb1KQto6C8OWvE'
  );
  ```

  ```http HTTP theme={null}
  GET /v1/messages HTTP/1.1
  Host: api.stateset.com
  Content-Type: application/json
  ```
</RequestExample>

<ResponseExample>
  ```json Response theme={null}

  {
      "data": {
          "message": {
              "id": "rt_1NXWPnCo6bFb1KQto6C8OWvE",
              "body": "Hello World",
              "created_at": "2021-01-01T00:00:00.000000Z",
              "date": "2021-01-01",
              "deliveredReceipt": true,
              "from": "user1",
              "fromMe": true,
              "is_public": true,
              "messageNumber": 1,
              "sentReceipt": true,
              "time": "00:00:00",
              "timestamp": "2021-01-01T00:00:00.000000Z",
              "to": "user2",
              "user_id": "rt_1NXWPnCo6bFb1KQto6C8OWvE",
              "username": "user1"
          }
      }
  }


  ```
</ResponseExample>

### Messages

| Field            | Type     | Description                                                |
| ---------------- | -------- | ---------------------------------------------------------- |
| id               | String   | Unique identifier for the message                          |
| body             | String   | The content or text of the message                         |
| created\_at      | DateTime | The date and time when the message was created             |
| date             | Date     | The date when the message was sent                         |
| deliveredReceipt | Boolean  | Indicates if the message has been delivered                |
| from             | String   | Sender of the message                                      |
| fromMe           | Boolean  | Indicates if the message was sent by the user              |
| is\_public       | Boolean  | Indicates if the message is public or private              |
| messageNumber    | Integer  | Unique number assigned to the message                      |
| sentReceipt      | Boolean  | Indicates if the message has been sent                     |
| time             | Time     | The time when the message was sent                         |
| timestamp        | DateTime | The timestamp of the message                               |
| to               | String   | Recipient of the message                                   |
| user\_id         | String   | Unique identifier for the user associated with the message |
| username         | String   | Username of the user associated with the message           |
