Module: Cotoha::Endpoint::AccessToken

Included in:
Cotoha::Endpoint
Defined in:
lib/cotoha/endpoint/access_token.rb

Instance Method Summary collapse

Instance Method Details

#create_access_token(**params) ⇒ Object



4
5
6
7
8
9
10
# File 'lib/cotoha/endpoint/access_token.rb', line 4

def create_access_token(**params)
  params = {grantType: 'client_credentials', clientId: @client_id, clientSecret: @client_secret}.merge(params)
  response = post('/v1/oauth/accesstokens', **params)
  response.tap do |res|
    @token = res['access_token']
  end
end