module Slack::Web::Api::Endpoints::Oauth
Public Instance Methods
oauth_access(options = {})
click to toggle source
Exchanges a temporary OAuth verifier code for an access token.
@option options [Object] :client_id
Issued when you created your application.
@option options [Object] :client_secret
Issued when you created your application.
@option options [Object] :code
The code param returned via the OAuth callback.
@option options [Object] :redirect_uri
This must match the originally submitted URI (if one was sent).
@option options [Object] :single_channel
Request the user to add your app only to a single channel. Only valid with a legacy workspace app.
@see api.slack.com/methods/oauth.access @see github.com/slack-ruby/slack-api-ref/blob/master/methods/oauth/oauth.access.json
# File lib/slack/web/api/endpoints/oauth.rb, line 24 def oauth_access(options = {}) post('oauth.access', options) end
oauth_token(options = {})
click to toggle source
Exchanges a temporary OAuth verifier code for a workspace token.
@option options [Object] :client_id
Issued when you created your application.
@option options [Object] :client_secret
Issued when you created your application.
@option options [Object] :code
The code param returned via the OAuth callback.
@option options [Object] :redirect_uri
This must match the originally submitted URI (if one was sent).
@option options [Object] :single_channel
Request the user to add your app only to a single channel.
@see api.slack.com/methods/oauth.token @see github.com/slack-ruby/slack-api-ref/blob/master/methods/oauth/oauth.token.json
# File lib/slack/web/api/endpoints/oauth.rb, line 43 def oauth_token(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.token', options) end