ultracart_api 4.0.32.rc → 4.0.33.rc

Sign up to get free protection for your applications and to get access to all the features.
data/docs/OauthApi.md CHANGED
@@ -21,23 +21,15 @@ The final leg in the OAuth process which exchanges the specified access token fo
21
21
  ```ruby
22
22
  require 'time'
23
23
  require 'ultracart_api'
24
- # setup authorization
25
- UltracartClient.configure do |config|
26
- # Configure API key authorization: ultraCartBrowserApiKey
27
- config.api_key['ultraCartBrowserApiKey'] = 'YOUR API KEY'
28
- # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
29
- # config.api_key_prefix['ultraCartBrowserApiKey'] = 'Bearer'
30
-
31
- # Configure OAuth2 access token for authorization: ultraCartOauth
32
- config.access_token = 'YOUR ACCESS TOKEN'
33
-
34
- # Configure API key authorization: ultraCartSimpleApiKey
35
- config.api_key['ultraCartSimpleApiKey'] = 'YOUR API KEY'
36
- # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
37
- # config.api_key_prefix['ultraCartSimpleApiKey'] = 'Bearer'
38
- end
24
+ require 'json'
25
+ require 'yaml'
26
+ require_relative '../constants' # https://github.com/UltraCart/sdk_samples/blob/master/ruby/constants.rb
27
+
28
+ # This example is based on our samples_sdk project, but still contains auto-generated content from our sdk generators.
29
+ # As such, this might not be the best way to use this object.
30
+ # Please see https://github.com/UltraCart/sdk_samples for working examples.
39
31
 
40
- api_instance = UltracartClient::OauthApi.new
32
+ api = UltracartClient::OauthApi.new_using_api_key(Constants::API_KEY, Constants::VERIFY_SSL, Constants::DEBUG_MODE)
41
33
  client_id = 'client_id_example' # String | The OAuth application client_id.
42
34
  grant_type = 'grant_type_example' # String | Type of grant
43
35
  opts = {
@@ -110,23 +102,15 @@ Revokes the OAuth application associated with the specified client_id and token.
110
102
  ```ruby
111
103
  require 'time'
112
104
  require 'ultracart_api'
113
- # setup authorization
114
- UltracartClient.configure do |config|
115
- # Configure API key authorization: ultraCartBrowserApiKey
116
- config.api_key['ultraCartBrowserApiKey'] = 'YOUR API KEY'
117
- # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
118
- # config.api_key_prefix['ultraCartBrowserApiKey'] = 'Bearer'
119
-
120
- # Configure OAuth2 access token for authorization: ultraCartOauth
121
- config.access_token = 'YOUR ACCESS TOKEN'
122
-
123
- # Configure API key authorization: ultraCartSimpleApiKey
124
- config.api_key['ultraCartSimpleApiKey'] = 'YOUR API KEY'
125
- # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
126
- # config.api_key_prefix['ultraCartSimpleApiKey'] = 'Bearer'
127
- end
105
+ require 'json'
106
+ require 'yaml'
107
+ require_relative '../constants' # https://github.com/UltraCart/sdk_samples/blob/master/ruby/constants.rb
108
+
109
+ # This example is based on our samples_sdk project, but still contains auto-generated content from our sdk generators.
110
+ # As such, this might not be the best way to use this object.
111
+ # Please see https://github.com/UltraCart/sdk_samples for working examples.
128
112
 
129
- api_instance = UltracartClient::OauthApi.new
113
+ api = UltracartClient::OauthApi.new_using_api_key(Constants::API_KEY, Constants::VERIFY_SSL, Constants::DEBUG_MODE)
130
114
  client_id = 'client_id_example' # String | The OAuth application client_id.
131
115
  token = 'token_example' # String | The OAuth access token that is to be revoked..
132
116