post_slack: Call a Slack API Method

View source: R/generics.R

post_slackR Documentation

Call a Slack API Method

Description

Safely call a Slack API method, with automatic pagination.

Usage

post_slack(
  slack_method,
  token = Sys.getenv("SLACK_API_TOKEN"),
  max_results = Inf,
  max_calls = Inf,
  limit = 1000L,
  ...,
  rate_limit
)

Arguments

slack_method

Character. The Slack API method to call, such as "conversations.history".

token

Character. Your Slack API token.

max_results

Integer. The maximum number of results to return (total). Note: The actual maximum will be max_results rounded up to a multiple of limit. Default: Inf

max_calls

Integer. The maximum number of separate API calls to make while constructing the response. Default: Inf

limit

Integer. The number of results to fetch per call. Default: 1000L

...

Additional arguments to pass to the body of the method call. Note: if you pass an explicit limit, this may cause conflicts. We recommend using max_results and max_calls.

rate_limit

Integer. The maximum number of calls to make to this function per minute. If NULL, calls will not be rate-limited. If unset, calls will be limited per the rate limit guides in the Slack api method documentation, if known. Note: If a limit is set for this method in any call in this session, that rate limit will be respected until rate_limit is set to NULL. Default: None.

Value

A list with an additional class corresponding to slack_method.

Examples

## Not run: 
post_slack(
  slack_method = "conversations.history",
  channel = "general",
  token = "my_api_token"
)

## End(Not run)

yonicd/slackcalls documentation built on March 12, 2023, 4:38 p.m.