Module: Slack::Web::Api::Endpoints::AdminAnalyticsMessages

Included in:
Slack::Web::Api::Endpoints
Defined in:
lib/slack/web/api/endpoints/admin_analytics_messages.rb

Instance Method Summary collapse

Instance Method Details

#admin_analytics_messages_activity(options = {}) ⇒ Object

Retrieves activity metrics for messages from a given channel.

Parameters:

  • options (Hash) (defaults to: {})

    a customizable set of options

Options Hash (options):

  • :channel (channel)

    Channel ID for channel of the message activity to query.

  • :oldest_ts (string)

    Oldest timestamp to include in the results. Defaults to 7 days before current time. If not passed while still passing the latest_ts parameter, defaults to 7 days before latest_ts.

  • :latest_ts (string)

    Most recent timestamp to include in results. Defaults to current time. If not passed while still passing the oldest_ts parameter, defaults to 7 days after oldest_ts.

  • :cursor (string)

    Paginate through collections of data by setting the cursor parameter to a next_cursor attribute returned by a previous request's response_metadata. Default value fetches the first "page" of the collection.

  • :limit (integer)

    Maximum number of entries to return. The maximum limit is 100.

Raises:

  • (ArgumentError)

See Also:



24
25
26
27
28
29
30
31
32
33
34
# File 'lib/slack/web/api/endpoints/admin_analytics_messages.rb', line 24

def admin_analytics_messages_activity(options = {})
  raise ArgumentError, 'Required arguments :channel missing' if options[:channel].nil?
  options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
  if block_given?
    Pagination::Cursor.new(self, :admin_analytics_messages_activity, options).each do |page|
      yield page
    end
  else
    post('admin.analytics.messages.activity', options)
  end
end

#admin_analytics_messages_metadata(options = {}) ⇒ Object

Retrieves metadata for a list of messages from a given channel.

Parameters:

  • options (Hash) (defaults to: {})

    a customizable set of options

Options Hash (options):

  • :channel (channel)

    Channel ID for channel containing the messages to query.

  • :oldest_ts (string)

    Oldest timestamp to include in the results.

  • :latest_ts (string)

    Most recent timestamp to include in the results. If not passed, defaults to current time.

  • :cursor (string)

    Paginate through collections of data by setting the cursor parameter to a next_cursor attribute returned by a previous request's response_metadata. Default value fetches the first "page" of the collection. See pagination for more details.

Raises:

  • (ArgumentError)

See Also:



49
50
51
52
53
54
55
56
57
58
59
# File 'lib/slack/web/api/endpoints/admin_analytics_messages.rb', line 49

def (options = {})
  raise ArgumentError, 'Required arguments :channel missing' if options[:channel].nil?
  options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
  if block_given?
    Pagination::Cursor.new(self, :admin_analytics_messages_metadata, options).each do |page|
      yield page
    end
  else
    post('admin.analytics.messages.metadata', options)
  end
end