Understand Slack data exports

After you’ve exported your Slack data, you’ll receive a .zip file containing message history in JSON format, and links to uploaded files.

Depending on which type of export you have access to, the .zip file will include the following:

  Standard Exports Compliance Exports
channels.json

dms.json  

groups.json  

integration_logs.json

mpims.json  

users.json

Folders for every channel

Note: For more information about the different types of exports available, visit Guide to Slack data exports

 

Slack messages

When you unzip the export file, you’ll find a folder for each channel. Within each folder, messages posted in the channel will be contained in separate JSON files, organized by date.

This is what a very simple message would look like:

{
   "type": "message",
   "channel": "C2147483705",
   "user": "U2147483697",
   "text": "Hello world",
   "ts": "1355517523.000005"
}

 And here’s how to read it:

  • The “type” value indicates that it is a message.
  • The ID following the “channel” value tells you which public channel, private channel or direct message the message was posted in.
  • The ID following the “user” value tells you which member sent the message.
  • The “text” value contains the actual message.
  • The ID following “ts” is the unique (per-channel) timestamp, showing you when the message was posted.

Messages can also include an “attachments” value which would contain a list of attachment objects.

Tip: To translate the alphanumeric code references for channels and users, you will need to reference the respective channels.json and users.json files that are included in the export.

Message edits

If a message was edited after it was posted, it'll include an “edited” value followed by the user ID of the member who made the change and the timestamp when it happened. Here’s an example:

 {
    "type": "message",
    "user": "U06NKBGN8",
    "text": "test:edited",
    "edited": {
        "user": "U06NKBGN8",
        "ts": "1458672560.000000"
    },
    "ts": "1458672049.000002" 
},
{
    "type": "message",
    "message": {
        "type": "message",
        "user": "U06NKBGN8",
        "text": "test:edited",
        "edited": {
            "user": "U06NKBGN8",
            "ts": "1458672560.000000"
        },
        "ts": "1458672049.000002"
    },
    "subtype": "message_changed",
    "hidden": true,
    "channel": "C0AJZ3BT4",
    "ts": "1458672560.000003",
    "original": {
        "type": "message",
        "user": "U06NKBGN8",
        "text": "test:original",
        "ts": "1458672049.000002"
    },
    "edited_by": "U06NKBGN8
}

 

Message subtypes

In addition to messages that members post in Slack, there are message subtypes: messages that are posted by apps and integrations like Trello, or messages you see when a member joins or leaves a channel.

Screen_Shot_2016-06-06_at_2.13.13_PM.png

Here is a full list of message subtypes:

Type Description
bot_message A message was posted by an app or integration
me_message A /me message was sent
message_changed A message was changed
message_deleted A message was deleted
channel_join A team member joined a channel
channel_leave A team member left a channel
channel_topic A channel topic was updated
channel_purpose A channel purpose was updated
channel_name A channel was renamed
channel_archive A channel was archived
Channel_unarchive A channel was unarchived
group_join A team member joined a group
group_leave A team member left a group
group_topic A group topic was updated
group_purpose A group purpose was updated
group_name A group was renamed
group_archive A group was archived
group_unarchive A group was unarchived
file_share A file was shared into a channel
file_comment A comment was added to a file
file_mention A file was mentioned in a channel
pinned_item An item was pinned in a channel
unpinned_item An item was unpinned from a channel

 

Hidden subtypes

Some message subtypes have special hidden properties — these include messages that need to be part of the history of a channel, but are not necessarily displayed to other members. Message edit or deletion logs are a good example of hidden subtypes.

 {
   "type": "message",
   "subtype": "message_deleted",
   "hidden": true,
   "channel": "C024BE91L",
   "ts": "1358878755.000001",
   "deleted_ts": "1358878749.000002",
   "event_ts": "1358878755.000002"
}

 

Stars, pins, and reactions

Messages can also have several extra properties to show whether anyone has starred, pinned, or reacted to the message.

{
   "type": "message",
   "channel": "C2147483705",
   "user": "U2147483697",
   "text": "Hello world",
   "ts": "1355517523.000005",
   "is_starred": true,
   "pinned_to": ["C024BE7LT", ...],
   "reactions": [
       {
           "name": "astonished",
           "count": 3,
           "users": [ "U1", "U2", "U3" ]
       },
       {
           "name": "facepalm",
           "count": 1034,
           "users": [ "U1", "U2", "U3", "U4", "U5" ]
       }

⭐️   If you see “is_starred” and true, a member has starred the message. You won’t see this value if the message hasn’t been starred.

📌  If a message has been pinned somewhere, you’ll see the IDs of the locations beside “pinned_to”.

👍🏼  If “reactions” is present, it will list all reactions that have been added to the message (“name”), the number of members who reacted (“count”), and a list of members who reacted (“users”).

Note: The users in the "reactions" value might not always list all the users that have reacted to a message, however, "count" will show the actual number of members who did.

Related Articles

Recently Viewed Articles