Class: ZohoCrm::GrantToken::GetService
- Inherits:
-
BaseService
- Object
- BaseService
- ZohoCrm::GrantToken::GetService
- Defined in:
- lib/zoho_crm/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
15 16 17 18 19 |
# File 'lib/zoho_crm/grant_token/get_service.rb', line 15 def initialize(grant_token:, client_id: nil, client_secret: nil) @grant_token = grant_token @client_id = client_id.presence || ZohoCrm::BaseService.client_id @client_secret = client_secret.presence || ZohoCrm::BaseService.client_secret end |
Instance Attribute Details
#client_id ⇒ Object (readonly)
Returns the value of attribute client_id.
4 5 6 |
# File 'lib/zoho_crm/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_crm/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_crm/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/crm/developer/docs/api/v7/access-refresh.html
Examples
service = ZohoCrm::GrantToken::GetService.call(grant_token: '', client_id: '', client_secret: '')
service.refresh_token # => '1000.xxxx.yyyy'
service.expires_in # => 3600
POST /oauth/v2/token
32 33 34 |
# File 'lib/zoho_crm/grant_token/get_service.rb', line 32 def call connection.post('oauth/v2/token', params.to_param) end |