Class: FinchAPI::Resources::AccessTokens
- Inherits:
-
Object
- Object
- FinchAPI::Resources::AccessTokens
- Defined in:
- lib/finch_api/resources/access_tokens.rb
Instance Method Summary collapse
-
#create(code: , client_id: nil, client_secret: nil, redirect_uri: nil, request_options: {}) ⇒ FinchAPI::CreateAccessTokenResponse
Exchange the authorization code for an access token.
-
#initialize(client:) ⇒ AccessTokens
constructor
private
A new instance of AccessTokens.
Constructor Details
#initialize(client:) ⇒ AccessTokens
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of AccessTokens.
33 34 35 |
# File 'lib/finch_api/resources/access_tokens.rb', line 33 def initialize(client:) @client = client end |
Instance Method Details
#create(code: , client_id: nil, client_secret: nil, redirect_uri: nil, request_options: {}) ⇒ FinchAPI::CreateAccessTokenResponse
Exchange the authorization code for an access token
19 20 21 22 23 24 25 26 27 28 |
# File 'lib/finch_api/resources/access_tokens.rb', line 19 def create(params) parsed, = FinchAPI::AccessTokenCreateParams.dump_request(params) @client.request( method: :post, path: "auth/token", body: parsed, model: FinchAPI::CreateAccessTokenResponse, options: ) end |