Slack.Web.Conversations.RequestSharedInvite (SlackKit v1.0.0-alpha.0)

View Source

Summary

Functions

Approves a request to add an external user to a channel and sends them a Slack Connect invite

Denies a request to invite an external user to a channel

Lists requests to add external users to channels with ability to filter.

Functions

approve(invite_id, optional_params \\ %{})

Approves a request to add an external user to a channel and sends them a Slack Connect invite

API reference

Rate limit: Tier 2: 20+ per minute
Scopes:

View on docs.slack.dev ↗

Required Params

  • invite_id - ID of the requested shared channel invite to approve.

Optional Params

  • channel_id - Optional channel_id to which external user will be invited to. Will override the value on the requested invite.
  • is_external_limited - Optional boolean on whether the invited team will have post-only permissions in the channel. Will override the value on the requested invite.
  • message - Object describing the text to send along with the invite. If this object is specified, both text and is_override are required properties. If is_override is set to true, text will override the original invitation message. Otherwise, text will be appended to the original invitation message. The total length of the message cannot exceed 560 characters. If is_override is set to false, the length of text and the user specified message on the invite request in total must be less than 560 characters. ex: {"text": "hello", "is_override": true}

Errors the API can return:

  • channel_not_found - The provided channel was not found or the channel is no longer visible to the user who requested the invite.
  • invite_already_approved - This invite was already approved.
  • invite_already_denied - This invite was already denied.
  • invite_expired - This invite is expired.
  • invite_not_found - We couldn't find a Slack Connect channel invite with the ID provided.
  • message_too_long - If the passed in approve message is greater than 560 characters.
  • no_external_invite_permission - Channel manager has restricted external invites for a given channel.
  • restricted_action - A team preference prevents the invite from being approved.
  • team_not_found - Can not find the team who requested the invite.
  • user_not_found - Can not find the user who requested the invite.

See the Common Errors guide for errors returned by every Web API method.

deny(invite_id, optional_params \\ %{})

Denies a request to invite an external user to a channel

API reference

Rate limit: Tier 2: 20+ per minute
Scopes:

View on docs.slack.dev ↗

Required Params

  • invite_id - ID of the requested shared channel invite to deny.

Optional Params

  • message - Optional message explaining why the request to invite was denied.

Errors the API can return:

  • channel_not_found - We could not find the channel where the request was made.
  • invite_already_approved - This invite was already approved.
  • invite_already_denied - This invite was already denied.
  • invite_expired - This invite is expired.
  • invite_not_found - We couldn't find a Slack Connect channel invite with the ID provided.
  • message_too_long - If the passed in deny message is greater than 560 characters.
  • restricted_action - A team preference prevents the invite from being denied.
  • team_not_found - We could not find the team which made the invite request.
  • user_not_found - We could not find the user who made the invite request.

See the Common Errors guide for errors returned by every Web API method.

list(optional_params \\ %{})

Lists requests to add external users to channels with ability to filter.

API reference

Rate limit: Tier 2: 20+ per minute
Scopes:

View on docs.slack.dev ↗

Optional Params

  • cursor - Paginate through collections of data by setting the cursor parameter to a next_cursor attribute returned by a previous request's response_metadata. See pagination for more detail. ex: bG9nX2lkOjc5NjQ1NA==
  • include_approved - When true approved invitation requests will be returned, otherwise they will be excluded
  • include_denied - When true denied invitation requests will be returned, otherwise they will be excluded
  • include_expired - When true expired invitation requests will be returned, otherwise they will be excluded
  • invite_ids - An optional list of invitation ids to look up
  • limit - The number of items to return. Must be between 1 - 1000 (inclusive).
  • user_id - Optional filter to return invitation requests for the inviting user.

Errors the API can return:

  • invalid_cursor - The provided cursor is not valid.
  • not_implemented - its not implemented! TODO: remove me
  • restricted_action - A team preference prevents the user from listing invitation requests.

See the Common Errors guide for errors returned by every Web API method.