class SunshineConversationsClient::OAuthEndpointsApi
Attributes
Public Class Methods
# File lib/sunshine-conversations-client/api/o_auth_endpoints_api.rb, line 16 def initialize(api_client = ApiClient.default) @api_client = api_client end
Public Instance Methods
Get Token This endpoint is used to exchange an authorization code for an access token. It should only be used in server-to-server calls. @param inline_object [InlineObject] @param [Hash] opts the optional parameters @return [Object]
# File lib/sunshine-conversations-client/api/o_auth_endpoints_api.rb, line 98 def get_token(inline_object, opts = {}) data, _status_code, _headers = get_token_with_http_info(inline_object, opts) data end
Get Token This endpoint is used to exchange an authorization code for an access token. It should only be used in server-to-server calls. @param inline_object [InlineObject] @param [Hash] opts the optional parameters @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
# File lib/sunshine-conversations-client/api/o_auth_endpoints_api.rb, line 108 def get_token_with_http_info(inline_object, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: OAuthEndpointsApi.get_token ...' end # verify the required parameter 'inline_object' is set if @api_client.config.client_side_validation && inline_object.nil? fail ArgumentError, "Missing the required parameter 'inline_object' when calling OAuthEndpointsApi.get_token" end # resource path local_var_path = '/oauth/token' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[: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 = opts[:form_params] || {} # http body (model) post_body = opts[:body] || @api_client.object_to_http_body(inline_object) # return_type return_type = opts[:return_type] || 'Object' # auth_names auth_names = opts[:auth_names] || [] new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: OAuthEndpointsApi#get_token\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Revoke Access This endpoint is used to revoke your integration’s access to the user’s Sunshine Conversations app. Revoking access means your integration will no longer be able to interact with the app, and any webhooks the integration had previously configured will be removed. Calling this endpoint is equivalent to the user removing your integration manually in the Sunshine Conversations web app. Your integration’s `removeUrl` (if configured) will also be called when an integration is removed in this way. @param [Hash] opts the optional parameters @return [Object]
# File lib/sunshine-conversations-client/api/o_auth_endpoints_api.rb, line 161 def revoke_access(opts = {}) data, _status_code, _headers = revoke_access_with_http_info(opts) data end
Revoke Access This endpoint is used to revoke your integration’s access to the user’s Sunshine Conversations app. Revoking access means your integration will no longer be able to interact with the app, and any webhooks the integration had previously configured will be removed. Calling this endpoint is equivalent to the user removing your integration manually in the Sunshine Conversations web app. Your integration’s `removeUrl` (if configured) will also be called when an integration is removed in this way. @param [Hash] opts the optional parameters @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
# File lib/sunshine-conversations-client/api/o_auth_endpoints_api.rb, line 170 def revoke_access_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: OAuthEndpointsApi.revoke_access ...' end # resource path local_var_path = '/oauth/authorization' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] || 'Object' # auth_names auth_names = opts[:auth_names] || ['basicAuth', 'bearerAuth'] new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: OAuthEndpointsApi#revoke_access\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end