Module: Slack::Web::Api::Endpoints::Oauth

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

Instance Method Summary collapse

Instance Method Details

#oauth_access(options = {}) ⇒ Object

This method allows you to exchange a temporary OAuth code for an API access token. This is used as part of the OAuth authentication flow.

Parameters:

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

    a customizable set of options

Options Hash (options):

  • :client_id (Object)

    Issued when you created your application.

  • :client_secret (Object)

    Issued when you created your application.

  • :code (Object)

    The code param returned via the OAuth callback.

  • :redirect_uri (Object)

    This must match the originally submitted URI (if one was sent).

See Also:


22
23
24
25
26
27
# File 'lib/slack/web/api/endpoints/oauth.rb', line 22

def oauth_access(options = {})
  throw ArgumentError.new('Required arguments :client_id missing') if options[:client_id].nil?
  throw ArgumentError.new('Required arguments :client_secret missing') if options[:client_secret].nil?
  throw ArgumentError.new('Required arguments :code missing') if options[:code].nil?
  post('oauth.access', options)
end