Class: ExportoAPI::AuthResource
- Defined in:
- lib/exporto_api/resources/auth_resource.rb
Instance Attribute Summary
Attributes inherited from Resource
Instance Method Summary collapse
Methods inherited from Resource
Constructor Details
This class inherits a constructor from ExportoAPI::Resource
Instance Method Details
#token(scope: nil) ⇒ Object
5 6 7 8 9 10 |
# File 'lib/exporto_api/resources/auth_resource.rb', line 5 def token(scope: nil) body = {"grant_type" => "client_credentials"} body["scope"] = scope unless scope.nil? Objects::TokenResponse.new(post_request("auth/token", body: body)) end |