Search code examples
slackslack-api

Is the message ts the ID of the message?


I am trying to build an app that syncs a forum with slack. Posting on either site will reflect on the site, but I need the ID of messages in Slack. The Slack Documentation says that

the text property is the text spoken, and ts is the unique (per-channel) timestamp.

Does this mean that the ts field is effectively the ID for that channel?


Solution

  • Yes, the timestamp (ts) is the ID of a message within a channel.

    The complete ID of a message over multiple Slack workspaces is:

    • Slack workspace ID -> channel ID -> message timestamp

    You can verify by looking for example on the API method chat.delete for deleting a message. There you also need to give the channel ID and the timestamp to identify the message to be deleted. (Plus the token, which is linked 1:1 to the slack team).