class PhoneComClient::OauthApi
Attributes
Public Class Methods
# File lib/phone_com_client/api/oauth_api.rb, line 19 def initialize(api_client = ApiClient.default) @api_client = api_client end
Public Instance Methods
To create an access token via the /oauth/access-token API, an API user may choose any one of the grant types it supports: Authorization Code Grant, Client Credential Grant, Password Credential Grant or Refresh Token Grant. To create an access token via the /oauth/access-token API, an API user may choose any one of the grant types it supports: Authorization Code Grant, Client Credential Grant, Password Credential Grant or Refresh Token Grant. For Authorization Code Grant, the input parameter 'code' is generated via the Create Authorization API. NOTE: The Create Access Token API now accepts requests in query string format as well as JSON body format. See OAuth for more details on how to obtain client id and client secret to create an access token at real time. @param [Hash] opts the optional parameters @option opts [CreateOauthParams] :data Oauth data @return [OauthAccessToken]
# File lib/phone_com_client/api/oauth_api.rb, line 27 def create_oauth_access_token(opts = {}) data, _status_code, _headers = create_oauth_access_token_with_http_info(opts) data end
To create an access token via the /oauth/access-token API, an API user may choose any one of the grant types it supports: Authorization Code Grant, Client Credential Grant, Password Credential Grant or Refresh Token Grant. To create an access token via the /oauth/access-token API, an API user may choose any one of the grant types it supports: Authorization Code Grant, Client Credential Grant, Password Credential Grant or Refresh Token Grant. For Authorization Code Grant, the input parameter 'code' is generated via the Create Authorization API. NOTE: The Create Access Token API now accepts requests in query string format as well as JSON body format. See OAuth for more details on how to obtain client id and client secret to create an access token at real time. @param [Hash] opts the optional parameters @option opts [CreateOauthParams] :data Oauth data @return [Array<(OauthAccessToken
, Fixnum, Hash)>] OauthAccessToken
data, response status code and response headers
# File lib/phone_com_client/api/oauth_api.rb, line 37 def create_oauth_access_token_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: OauthApi.create_oauth_access_token ...' end # resource path local_var_path = '/oauth/access-token' # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(opts[:'data']) auth_names = ['apiKey'] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'OauthAccessToken') if @api_client.config.debugging @api_client.config.logger.debug "API called: OauthApi#create_oauth_access_token\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Retrieve details of an access token, such as scope, expiration and extension ID. Retrieve details of an access token, such as scope, expiration and extension ID. Voip ID will be returned as well if scope contains account-owner scope. @param [Hash] opts the optional parameters @return [GetOauthAccessToken]
# File lib/phone_com_client/api/oauth_api.rb, line 151 def get_oauth_access_token(opts = {}) data, _status_code, _headers = get_oauth_access_token_with_http_info(opts) data end
Retrieve details of an access token, such as scope, expiration and extension ID. Retrieve details of an access token, such as scope, expiration and extension ID. Voip ID will be returned as well if scope contains account-owner scope. @param [Hash] opts the optional parameters @return [Array<(GetOauthAccessToken
, Fixnum, Hash)>] GetOauthAccessToken
data, response status code and response headers
# File lib/phone_com_client/api/oauth_api.rb, line 160 def get_oauth_access_token_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: OauthApi.get_oauth_access_token ...' end # resource path local_var_path = '/oauth/access-token' # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['apiKey'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'GetOauthAccessToken') if @api_client.config.debugging @api_client.config.logger.debug "API called: OauthApi#get_oauth_access_token\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end