---
schema_version: "1"
id: 2e8eac79b466028f40117434cf1eb912214005473c42c4e09aa852d34be31411
title: Work with Message Context
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/salesforce-slack-sdk/apex-slack-sdk/guides/apex_ref/apex_ref_message_context.md
canonical_url: https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/apex_ref_message_context.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 2bf9e3cc0de8a2910d77190b8bc07173bc2d9da0cc2a25041e55e9db7fe77f9b
products:
  - Apex SDK for Slack (Beta)
---
# Work with Message Context

Use the `MessageContext` class to work with messages.

## MessageContext Class

Contains information about messages.

### MessageContext Methods

`MessageContext` has the following methods.

#### getTs()

Gets the timestamp of the message.

**Signature**

```java
public String getTs()
```

**Return Value**

Type: String

#### getUserId()

Gets the ID of the user who initiated the shortcut.

**Signature**

```java
public String getUserId()
```

**Return Value**

Type: String

#### getText()

The text of the message.

**Signature**

```java
public string getText()
```

**Return Value**

Type: String
