Class: ZohoSign::GrantToken::GetService
- Inherits:
-
BaseService
- Object
- BaseService
- ZohoSign::GrantToken::GetService
- Defined in:
- lib/zoho_sign/grant_token/get_service.rb
Instance Attribute Summary collapse
-
#client_id ⇒ Object
readonly
Returns the value of attribute client_id.
-
#client_secret ⇒ Object
readonly
Returns the value of attribute client_secret.
-
#grant_token ⇒ Object
readonly
Returns the value of attribute grant_token.
Instance Method Summary collapse
-
#call ⇒ Object
Get refresh token from grant token.
-
#initialize(grant_token:, client_id: nil, client_secret: nil) ⇒ GetService
constructor
A new instance of GetService.
Constructor Details
#initialize(grant_token:, client_id: nil, client_secret: nil) ⇒ GetService
13 14 15 16 17 |
# File 'lib/zoho_sign/grant_token/get_service.rb', line 13 def initialize(grant_token:, client_id: nil, client_secret: nil) @grant_token = grant_token @client_id = client_id.presence || ZohoSign::BaseService.client_id @client_secret = client_secret.presence || ZohoSign::BaseService.client_secret end |
Instance Attribute Details
#client_id ⇒ Object (readonly)
Returns the value of attribute client_id.
4 5 6 |
# File 'lib/zoho_sign/grant_token/get_service.rb', line 4 def client_id @client_id end |
#client_secret ⇒ Object (readonly)
Returns the value of attribute client_secret.
4 5 6 |
# File 'lib/zoho_sign/grant_token/get_service.rb', line 4 def client_secret @client_secret end |
#grant_token ⇒ Object (readonly)
Returns the value of attribute grant_token.
4 5 6 |
# File 'lib/zoho_sign/grant_token/get_service.rb', line 4 def grant_token @grant_token end |
Instance Method Details
#call ⇒ Object
Get refresh token from grant token.
www.zoho.com/accounts/protocol/oauth/web-apps/access-token.html
Examples
service = ZohoSign::GrantToken::GetService.call(grant_token: '', client_id: '', client_secret: '')
service.refresh_token # => '1000.xxxx.yyyy'
service.expires_in # => 3600
POST /oauth/v2/token
30 31 32 |
# File 'lib/zoho_sign/grant_token/get_service.rb', line 30 def call connection.post('oauth/v2/token', params.to_param) end |