SOLFIND
Web Lens
Portal home

admin.analytics.getFile method | Slack Developer Docs

https://docs.slack.dev/reference/methods/admin.analytics.getFile/ • 172 KB fetched
Open original page


admin.analytics.getFile method | Slack Developer Docs reference Skip to main content Guides Reference Samples Tools Changelog Dev Program MANAGE APPS * Reference * App manifest * Block Kit * Events * Interaction payloads * Methods * Overview * admin * admin.analytics.getFile * admin.analytics.messages.activity * admin.analytics.messages.metadata * admin.apps.activities.list * admin.apps.approve * admin.apps.approved.list * admin.apps.clearResolution * admin.apps.config.lookup * admin.apps.config.set * admin.apps.mcp.servers.list * admin.apps.mcp.servers.permissions.list * admin.apps.mcp.servers.permissions.set * admin.apps.permissions.add * admin.apps.permissions.list * admin.apps.permissions.remove * admin.apps.permissions.set * admin.apps.requests.cancel * admin.apps.requests.list * admin.apps.restrict * admin.apps.restricted.list * admin.apps.uninstall * admin.audit.anomaly.allow.getItem * admin.audit.anomaly.allow.updateItem * admin.auth.policy.assignEntities * admin.auth.policy.getEntities * admin.auth.policy.removeEntities * admin.barriers.create * admin.barriers.delete * admin.barriers.list * admin.barriers.update * admin.conversations.archive * admin.conversations.bulkArchive * admin.conversations.bulkDelete * admin.conversations.bulkMove * admin.conversations.bulkSetExcludeFromSlackAi * admin.conversations.bulkSetProperties * admin.conversations.convertToPrivate * admin.conversations.convertToPublic * admin.conversations.create * admin.conversations.createForObjects * admin.conversations.delete * admin.conversations.disconnectShared * admin.conversations.ekm.listOriginalConnectedChannelInfo * admin.conversations.getConversationPrefs * admin.conversations.getCustomRetention * admin.conversations.getTeams * admin.conversations.invite * admin.conversations.linkObjects * admin.conversations.lookup * admin.conversations.removeCustomRetention * admin.conversations.rename * admin.conversations.restrictAccess.addGroup * admin.conversations.restrictAccess.listGroups * admin.conversations.restrictAccess.removeGroup * admin.conversations.search * admin.conversations.setConversationPrefs * admin.conversations.setCustomRetention * admin.conversations.setTeams * admin.conversations.unarchive * admin.conversations.unlinkObjects * admin.emoji.add * admin.emoji.addAlias * admin.emoji.list * admin.emoji.remove * admin.emoji.rename * admin.functions.list * admin.functions.permissions.lookup * admin.functions.permissions.set * admin.inviteRequests.approve * admin.inviteRequests.approved.list * admin.inviteRequests.denied.list * admin.inviteRequests.deny * admin.inviteRequests.list * admin.roles.addAssignments * admin.roles.listAssignments * admin.roles.removeAssignments * admin.teams.admins.list * admin.teams.create * admin.teams.list * admin.teams.owners.list * admin.teams.settings.info * admin.teams.settings.setDefaultChannels * admin.teams.settings.setDescription * admin.teams.settings.setDiscoverability * admin.teams.settings.setIcon * admin.teams.settings.setName * admin.usergroups.addChannels * admin.usergroups.addTeams * admin.usergroups.listChannels * admin.usergroups.removeChannels * admin.usergroups.removeTeams * admin.users.assign * admin.users.getExpiration * admin.users.invite * admin.users.list * admin.users.remove * admin.users.session.clearSettings * admin.users.session.getSettings * admin.users.session.invalidate * admin.users.session.list * admin.users.session.reset * admin.users.session.resetBulk * admin.users.session.setSettings * admin.users.setAdmin * admin.users.setExpiration * admin.users.setOwner * admin.users.setRegular * admin.users.unsupportedVersions.export * admin.workflows.collaborators.add * admin.workflows.collaborators.remove * admin.workflows.permissions.lookup * admin.workflows.search * admin.workflows.triggers.types.permissions.lookup * admin.workflows.triggers.types.permissions.set * admin.workflows.unpublish * agents * api * apps * assistant * auth * blocks * bookmarks * bots * calls * canvases * chat * conversations * dialog * dnd * emoji * entity * files * functions * lists * migration * oauth * openid * pins * reactions * reminders * rtm * search * stars * team * tooling * usergroups * users * views * workflows * Objects * Scopes * Types * Slack Connect API * Views * * Audit Logs API * Legal Holds API * SCIM API * * Slack Status API * * Methods * admin * admin.analytics.getFile Copy as markdown On this page admin.analytics.getFile method Docs Call generator Facts ​ Description Retrieve analytics data for a given date, presented as a compressed JSON file Method Access * HTTP * Slack CLI * JavaScript * Python * Java GET https://slack.com/api/admin.analytics.getFile slack api admin.analytics.getFile app.client.admin.analytics.getFile app.client.admin_analytics_getFile app.client().adminAnalyticsGetFile Scopes User token: admin.analytics:read Content types application/x-www-form-urlencoded application/json Rate Limits Tier 2: 20+ per minute Arguments ​ Required arguments token string Required Authentication token bearing required scopes. Tokens should be passed as an HTTP Authorization header or alternatively, as a POST parameter. Example: xxxx-xxxxxxxxx-xxxx type string Required The type of analytics to retrieve. The options are currently limited to member (for Enterprise org member analytics) and public_channel (for public channel analytics). Example: member Optional arguments date Optional Date to retrieve the analytics data for, expressed as YYYY-MM-DD in UTC. Required unless metadata_only is set to true. Example: 2020-09-01 metadata_only boolean Optional Retrieve metadata for the type of analytics indicated. Can be used only with type set to public_channel analytics. See detail below . Omit the date parameter when using this argument. Default: false Example: true Usage info ​ This method returns member and conversation analytics data presented as new-line delimited JSON files, compressed with gzip . Each response contains a file with analytics data for a single day. As of February 2023, analytics data is available on a rolling 13-month basis. If you recently upgraded from a Free or Pro plan, you will only have access to data starting from when you upgraded (the 13 months of historical data will not immediately apply). Once you've been on a Business+, Select/Compliance, or plan for 13 months, the data will become available on a rolling 13-month basis. Historical data is not recomputed when a workspace and its accompanying member engagement data is added to or removed from an organization. Similarly, if a member is removed from a workspace, the data returned by the API will not update historical engagement data to reflect only the workspaces the member is currently a part of. This behavior differs from the Analytics Dashboard in Org and Team settings, which does consider historical changes in its calculation of 30 day and all time metrics. The date argument is required when requesting daily analytics data. It represents the date in UTC corresponding to the analytics data you're requesting. Omit this argument when setting metadata_only to true , as metadata cannot be filtered by date. When setting type to public_channel , you may also use the metadata_only boolean argument, which changes the response entirely to give you metadata about the public channels appearing in your conversation analytics. Omit the date parameter when using this mode. Practical usage example ​ To quickly decompress a file and view the JSON directly, use a cURL command like: curl "{%BASE_API_URL%}/api/admin.analytics.getFile" -d "date=2020-11-03&type=member" | gunzip -c > member_analytics_2020_11_03.json ...and you'll have a member_analytics_2020_11_03.json file in the current operating directory. In some organizations the decompressed size can be quite large. Take care that you have the disk or memory space you need to store and process these files. Here's an example for conversation analytics: curl "{%BASE_API_URL%}/api/admin.analytics.getFile" -d "date=2021-01-04&type=public_channel" | gunzip -c > public_channel_analytics_2021_01_04.json And another for channel metadata to accompany that conversation analytics request—note that we omit date . curl "{%BASE_API_URL%}/api/admin.analytics.getFile" -d "type=public_channel&metadata_only=true" | gunzip -c > public_channel_metadata_2021_01_04.json Response ​ A gzipped new-line delimited JSON file presented with a Content-type: application/gzip HTTP header. An example file name is Slack Corp Member Analytics 2020-08-01.json.gz "" Typical Web API error response is a JSON response with a Content-type: application/json HTTP header. { "ok" : false , "error" : "org_level_email_display_disabled" } This method is almost completely unlike other Web API methods you encounter. It doesn't return application/json with the traditional "ok": true response on success, though you'll find "ok": false on failure. Instead, it returns a single file, often very large, containing JSON objects that are separated by newlines and then compressed with application/gzip . To open the successful response and utilize the data, you must first store and decompress the response. Some tools may parse new line-separated JSON for you with ease, while other tools will require that you first split each new line separated "row" into its own separate JSON object before being deserialized. After decompression, the file returned in the response will look something like the following, depending on the type of analytics requested. Member analytics response ​ Here are 3 example lines of JSON you would find after decompressing a member analytics file. Each line provides information about a different user. { "enterprise_id" : "E5UBAR8CH" , "date" : "2020-10-05" , "user_id" : "W0POSID23ID" , "email_address" : "[email protected]" , "is_guest" : false , "is_billable_seat" : false , "is_active" : false , "is_active_ios" : false , "is_active_android" : false , "is_active_desktop" : false , "reactions_added_count" : 0 , "messages_posted_count" : 0 , "channel_messages_posted_count" : 0 , "files_added_count" : 0 , "is_active_apps" : true , "is_active_workflows" : true , "is_active_slack_connect" : true , "total_calls_count" : 15 , "slack_calls_count" : 12 , "slack_huddles_count" : 3 , "search_count" : 223 , "date_claimed" : 1584810430 } { "enterprise_id" : "E5UBAR8CH" , "date" : "2020-10-05" , "user_id" : "W1ZOSID3ZI2" , "email_address" : "[email protected]" , "is_guest" : false , "is_billable_seat" : true , "is_active" : true , "is_active_ios" : false , "is_active_android" : false , "is_active_desktop" : true , "reactions_added_count" : 23 , "messages_posted_count" : 123 , "channel_messages_posted_count" : 23 , "files_added_count" : 3 , "is_active_apps" : false , "is_active_workflows" : true , "is_active_slack_connect" : false , "total_calls_count" : 10 , "slack_calls_count" : 4 , "slack_huddles_count" : 5 , "search_count" : 1001 , "date_claimed" : 1584810520 } { "enterprise_id" : "E5UBAR8CH" , "date" : "2020-10-05" , "user_id" : "W3DOSZD23IP" , "email_address" : "[email protected]" , "is_guest" : false , "is_billable_seat" : true , "is_active" : true , "is_active_ios" : true , "is_active_android" : false , "is_active_desktop" : false , "reactions_added_count" : 521 , "messages_posted_count" : 5 , "channel_messages_posted_count" : 5 , "files_added_count" : 0 , "is_active_apps" : true , "is_active_workflows" : true , "is_active_slack_connect" : false , "total_calls_count" : 3 , "slack_calls_count" : 3 , "slack_huddles_count" : 0 , "search_count" : 32 , "date_claimed" : 1584810510 } To be extra helpful, here's one of those lines formatted a little prettier: { "enterprise_id" : "E5UBAR8CH" , "date" : "2020-10-05" , "user_id" : "W3DOSZD23IP" , "email_address" : "[email protected]" , "is_guest" : false , "is_billable_seat" : true , "is_active" : true , "is_active_ios" : true , "is_active_android" : false , "is_active_desktop" : false , "reactions_added_count" : 521 , "messages_posted_count" : 5 , "channel_messages_posted_count" : 5 , "files_added_count" : 0 , "is_active_apps" : true , "is_active_workflows" : true , "is_active_slack_connect" : false , "total_calls_count" : 10 , "slack_calls_count" : 3 , "slack_huddles_count" : 5 , "search_count" : 32 , "date_claimed" : 1584810510 } Public channel analytics response ​ This example shows 3 lines of decompressed public channel analytics. Each line provides information about activity in a single public channel. { "enterprise_id" : "EJB3MZFLM" , "team_id" : "EJB3MZFLM" , "originating_team" : { "team_id" : "T5J3Q04QZ" , "name" : "postmodernity" } , "channel_id" : "CNGL0KGG1" , "date_created" : 1555111593 , "date_last_active" : 1684820530 , "total_members_count" : 7 , "full_members_count" : 6 , "guest_member_count" : 1 , "messages_posted_count" : 223 , "messages_posted_by_members_count" : 80 , "members_who_viewed_count" : 225 , "members_who_posted_count" : 3 , "reactions_added_count" : 23 , "visibility" : "public" , "channel_type" : "single_workspace_channel" , "is_shared_externally" : false , "shared_with" : [ ] , "externally_shared_with_organizations" : [ ] , "date" : "2020-11-14" } { "enterprise_id" : "EJB3MZFLM" , "team_id" : "EJB3MZFLM" , "originating_team" : { "team_id" : "T3J3A04QB" , "name" : "modernity" } , "channel_id" : "CNGG2KB92" , "date_created" : 1358111593 , "date_last_active" : 1452719593 , "total_members_count" : 227 , "full_members_count" : 227 , "guest_member_count" : 0 , "messages_posted_count" : 1138 , "messages_posted_by_members_count" : 1137 , "members_who_viewed_count" : 226 , "members_who_posted_count" : 7 , "reactions_added_count" : 7212 , "visibility" : "public" , "channel_type" : "single_workspace_channel" , "is_shared_externally" : true , "shared_with" : [ ] , "externally_shared_with_organizations" : [ ] , "date" : "2020-11-14" } { "enterprise_id" : "EJB3MZFLM" , "team_id" : "EJB3MZFLM" , "originating_team" : { "team_id" : "EJB3MZFLM" , "name" : "arcane-enterprise" } , "channel_id" : "CNGZ5K595" , "date_created" : 1355111593 , "date_last_active" : 1452719593 , "total_members_count" : 5 , "full_members_count" : 4 , "guest_member_count" : 1 , "messages_posted_count" : 1 , "messages_posted_by_members_count" : 1 , "members_who_viewed_count" : 5 , "members_who_posted_count" : 1 , "reactions_added_count" : 1 , "visibility" : "public" , "channel_type" : "multi_workspace_channel" , "is_shared_externally" : true , "shared_with" : [ { "team_id" : "T5J3Q04QA" , "name" : "scifi" } , { "team_id" : "EJB3MZFLM" , "name" : "arcane-enterprise" } ] , "externally_shared_with_organizations" : [ { "name" : "Away Org" , "domain" : "away.enterprise.slack.com" } ] , "date" : "2020-11-14" } And here's just one line of that formatted in a friendly fashion: { "enterprise_id" : "EJB3MZFLM" , "team_id" : "EJB3MZFLM" , "originating_team" : { "team_id" : "EJB3MZFLM" , "name" : "arcane-enterprise" } , "channel_id" : "CNGZ5K595" , "date_created" : 1355111593 , "date_last_active" : 1452719593 , "total_members_count" : 5 , "full_members_count" : 4 , "guest_member_count" : 1 , "messages_posted_count" : 1 , "messages_posted_by_members_count" : 1 , "members_who_viewed_count" : 5 , "members_who_posted_count" : 1 , "reactions_added_count" : 1 , "visibility" : "public" , "channel_type" : "multi_workspace_channel" , "is_shared_externally" : false , "shared_with" : [ { "team_id" : "T5J3Q04QA" , "name" : "scifi" } , { "team_id" : "EJB3MZFLM" , "name" : "arcane-enterprise" } ] , "externally_shared_with_organizations" : [ { "name" : "Away Org" , "domain" : "away.enterprise.slack.com" } ] , "date" : "2020-11-14" } Public channel metadata response ​ Uncompressed, you'll find each public channel's metadata on a single line like so: { "channel_id" : "CNGL0K091" , "name" : "tomorrow" , "topic" : "I'd gladly pay you Tuesday for a hamburger today" , "description" : "What do you want to do tomorrow?" , "date" : "2020-11-14" } { "channel_id" : "CNGG2KB92" , "name" : "announcements" , "topic" : "What's new with what you do" , "description" : "Company announcements, edicts, and mandates" , "date" : "2020-11-14" } { "channel_id" : "CNGZ5K595" , "name" : "teds" , "topic" : "'No you meant the other ted' - @ted" , "description" : "A channel just for teds, by teds." , "date" : "2020-11-14" } And here's that last one printed pretty for you: { "channel_id" : "CNGZ5K595" , "name" : "teds" , "topic" : "'No you meant the other ted' - @ted" , "description" : "A channel just for teds, by teds." , "date" : "2020-11-14" } The response format changes depending on which type of analytics you're retrieving. Member analytics ​ Inaccurate billable seat count After July 10, 2023, is_billable_seat will only provide an accurate count for invoiced customers. Customers who purchased their plan via the Slack website and pay for it by credit card or self-serve invoicing should not use is_billable_seat to count their billable users. Field Description Example date The date this row of data is representative of 2020-09-13 enterprise_id Unique ID of the involved Enterprise organization E2AB3A10F user_id The canonical, organization-wide user ID this row concerns W1F83A9F9 email_address The email address of record for the same user [email protected] enterprise_employee_number This field is pulled from data synced via a SCIM API custom attribute 273849373 is_guest User is classified as a guest (not a full workspace member) on the date in the API request false is_billable_seat User is classified as a billable monthly active user ( included in the bill ) for invoiced customers on the date in the API request. Customers who purchased their plan via the Slack website and pay for it by credit card or self-serve invoicing should not use this to count their billable users true is_active User has posted a message or read at least

Links found on this page

  1. Skip to main content [direct]
  2. Guides [direct]
  3. Reference [direct]
  4. Samples [direct]
  5. Tools [direct]
  6. Changelog [direct]
  7. Dev Program [direct]
  8. MANAGE APPS [direct]
  9. Reference [direct]
  10. App manifest [direct]
  11. Block Kit [direct]
  12. Events [direct]
  13. Interaction payloads [direct]
  14. Methods [direct]
  15. admin [direct]
  16. admin.analytics.messages.activity [direct]
  17. admin.analytics.messages.metadata [direct]
  18. admin.apps.activities.list [direct]
  19. admin.apps.approve [direct]
  20. admin.apps.approved.list [direct]
  21. admin.apps.clearResolution [direct]
  22. admin.apps.config.lookup [direct]
  23. admin.apps.config.set [direct]
  24. admin.apps.mcp.servers.list [direct]
  25. admin.apps.mcp.servers.permissions.list [direct]
  26. admin.apps.mcp.servers.permissions.set [direct]
  27. admin.apps.permissions.add [direct]
  28. admin.apps.permissions.list [direct]
  29. admin.apps.permissions.remove [direct]
  30. admin.apps.permissions.set [direct]
  31. admin.apps.requests.cancel [direct]
  32. admin.apps.requests.list [direct]
  33. admin.apps.restrict [direct]
  34. admin.apps.restricted.list [direct]
  35. admin.apps.uninstall [direct]
  36. admin.audit.anomaly.allow.getItem [direct]
  37. admin.audit.anomaly.allow.updateItem [direct]
  38. admin.auth.policy.assignEntities [direct]
  39. admin.auth.policy.getEntities [direct]
  40. admin.auth.policy.removeEntities [direct]
  41. admin.barriers.create [direct]
  42. admin.barriers.delete [direct]
  43. admin.barriers.list [direct]
  44. admin.barriers.update [direct]
  45. admin.conversations.archive [direct]
  46. admin.conversations.bulkArchive [direct]
  47. admin.conversations.bulkDelete [direct]
  48. admin.conversations.bulkMove [direct]
  49. admin.conversations.bulkSetExcludeFromSlackAi [direct]
  50. admin.conversations.bulkSetProperties [direct]
  51. admin.conversations.convertToPrivate [direct]
  52. admin.conversations.convertToPublic [direct]
  53. admin.conversations.create [direct]
  54. admin.conversations.createForObjects [direct]
  55. admin.conversations.delete [direct]
  56. admin.conversations.disconnectShared [direct]
  57. admin.conversations.ekm.listOriginalConnectedChannelInfo [direct]
  58. admin.conversations.getConversationPrefs [direct]
  59. admin.conversations.getCustomRetention [direct]
  60. admin.conversations.getTeams [direct]
  61. admin.conversations.invite [direct]
  62. admin.conversations.linkObjects [direct]
  63. admin.conversations.lookup [direct]
  64. admin.conversations.removeCustomRetention [direct]
  65. admin.conversations.rename [direct]
  66. admin.conversations.restrictAccess.addGroup [direct]
  67. admin.conversations.restrictAccess.listGroups [direct]
  68. admin.conversations.restrictAccess.removeGroup [direct]
  69. admin.conversations.search [direct]
  70. admin.conversations.setConversationPrefs [direct]
  71. admin.conversations.setCustomRetention [direct]
  72. admin.conversations.setTeams [direct]
  73. admin.conversations.unarchive [direct]
  74. admin.conversations.unlinkObjects [direct]
  75. admin.emoji.add [direct]
  76. admin.emoji.addAlias [direct]
  77. admin.emoji.list [direct]
  78. admin.emoji.remove [direct]
  79. admin.emoji.rename [direct]
  80. admin.functions.list [direct]