Skip to content

Latest commit

 

History

History
420 lines (291 loc) · 10.1 KB

ManagementApi.md

File metadata and controls

420 lines (291 loc) · 10.1 KB

OpenapiClient::ManagementApi

All URIs are relative to https://api.affixapi.com

Method HTTP request Description
client GET /2023-03-01/management/client Client
disconnect POST /2023-03-01/management/disconnect Disconnect token
introspect GET /2023-03-01/management/introspect Inspect token
token POST /2023-03-01/management/token Create token
tokens GET /2023-03-01/management/tokens Tokens
update_client POST /2023-03-01/management/client Update client

client

client

Client

View client attributes

Examples

require 'time'
require 'openapi_client'
# setup authorization
OpenapiClient.configure do |config|
  # Configure API key authorization: basic
  config.api_key['basic'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  # config.api_key_prefix['basic'] = 'Bearer'
end

api_instance = OpenapiClient::ManagementApi.new

begin
  # Client
  result = api_instance.client
  p result
rescue OpenapiClient::ApiError => e
  puts "Error when calling ManagementApi->client: #{e}"
end

Using the client_with_http_info variant

This returns an Array which contains the response data, status code and headers.

<Array(, Integer, Hash)> client_with_http_info

begin
  # Client
  data, status_code, headers = api_instance.client_with_http_info
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <ClientResponse>
rescue OpenapiClient::ApiError => e
  puts "Error when calling ManagementApi->client_with_http_info: #{e}"
end

Parameters

This endpoint does not need any parameter.

Return type

ClientResponse

Authorization

basic

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

disconnect

disconnect

Disconnect token

Disconnect the token. A disconnected token will no longer return data. Data requests with a disconnected token will return a 403 Forbidden

Examples

require 'time'
require 'openapi_client'
# setup authorization
OpenapiClient.configure do |config|
  # Configure API key authorization: access-token
  config.api_key['access-token'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  # config.api_key_prefix['access-token'] = 'Bearer'
end

api_instance = OpenapiClient::ManagementApi.new

begin
  # Disconnect token
  result = api_instance.disconnect
  p result
rescue OpenapiClient::ApiError => e
  puts "Error when calling ManagementApi->disconnect: #{e}"
end

Using the disconnect_with_http_info variant

This returns an Array which contains the response data, status code and headers.

<Array(, Integer, Hash)> disconnect_with_http_info

begin
  # Disconnect token
  data, status_code, headers = api_instance.disconnect_with_http_info
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <DisconnectResponse>
rescue OpenapiClient::ApiError => e
  puts "Error when calling ManagementApi->disconnect_with_http_info: #{e}"
end

Parameters

This endpoint does not need any parameter.

Return type

DisconnectResponse

Authorization

access-token

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

introspect

introspect

Inspect token

Retrieve data about the token, such as scopes, mode, provider, and if it is active

Examples

require 'time'
require 'openapi_client'
# setup authorization
OpenapiClient.configure do |config|
  # Configure API key authorization: access-token
  config.api_key['access-token'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  # config.api_key_prefix['access-token'] = 'Bearer'
end

api_instance = OpenapiClient::ManagementApi.new

begin
  # Inspect token
  result = api_instance.introspect
  p result
rescue OpenapiClient::ApiError => e
  puts "Error when calling ManagementApi->introspect: #{e}"
end

Using the introspect_with_http_info variant

This returns an Array which contains the response data, status code and headers.

<Array(, Integer, Hash)> introspect_with_http_info

begin
  # Inspect token
  data, status_code, headers = api_instance.introspect_with_http_info
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <IntrospectResponse>
rescue OpenapiClient::ApiError => e
  puts "Error when calling ManagementApi->introspect_with_http_info: #{e}"
end

Parameters

This endpoint does not need any parameter.

Return type

IntrospectResponse

Authorization

access-token

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

token

token(token_request)

Create token

Exchange an authorization_code for an access_token after receiving on from the redirect_uri you specifiy after a successful user connection

Examples

require 'time'
require 'openapi_client'

api_instance = OpenapiClient::ManagementApi.new
token_request = OpenapiClient::TokenRequest.new({client_id: '00000000-00000000-00000000-00000000', client_secret: 'ffffffff-ffffffff-ffffffff-ffffffff', grant_type: 'authorization_code', code: 'Y2xpZW50IzkzMTU4MGQwLWYwYjctNGJiOC1iYmZmLWI4MTNlYzMxNTVjYXxjb2RlIzE1MmIwYjk3LTg2ZWMtNDZlNC1hZDUyLWY5ZTAxNzE2MDIwNAo=', redirect_uri: 'https://example.com'}) # TokenRequest | 

begin
  # Create token
  result = api_instance.token(token_request)
  p result
rescue OpenapiClient::ApiError => e
  puts "Error when calling ManagementApi->token: #{e}"
end

Using the token_with_http_info variant

This returns an Array which contains the response data, status code and headers.

<Array(, Integer, Hash)> token_with_http_info(token_request)

begin
  # Create token
  data, status_code, headers = api_instance.token_with_http_info(token_request)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <TokenResponse>
rescue OpenapiClient::ApiError => e
  puts "Error when calling ManagementApi->token_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
token_request TokenRequest

Return type

TokenResponse

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

tokens

Array<Object> tokens

Tokens

View tokens and token status for respective client

Examples

require 'time'
require 'openapi_client'
# setup authorization
OpenapiClient.configure do |config|
  # Configure API key authorization: basic
  config.api_key['basic'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  # config.api_key_prefix['basic'] = 'Bearer'
end

api_instance = OpenapiClient::ManagementApi.new

begin
  # Tokens
  result = api_instance.tokens
  p result
rescue OpenapiClient::ApiError => e
  puts "Error when calling ManagementApi->tokens: #{e}"
end

Using the tokens_with_http_info variant

This returns an Array which contains the response data, status code and headers.

<Array(Array<Object>, Integer, Hash)> tokens_with_http_info

begin
  # Tokens
  data, status_code, headers = api_instance.tokens_with_http_info
  p status_code # => 2xx
  p headers # => { ... }
  p data # => Array&lt;Object&gt;
rescue OpenapiClient::ApiError => e
  puts "Error when calling ManagementApi->tokens_with_http_info: #{e}"
end

Parameters

This endpoint does not need any parameter.

Return type

Array<Object>

Authorization

basic

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

update_client

update_client(client_request)

Update client

Update attributes of the client. Update the name, client_secret, or webhook_uri of the client

Examples

require 'time'
require 'openapi_client'
# setup authorization
OpenapiClient.configure do |config|
  # Configure API key authorization: basic
  config.api_key['basic'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  # config.api_key_prefix['basic'] = 'Bearer'
end

api_instance = OpenapiClient::ManagementApi.new
client_request = OpenapiClient::ClientRequest.new({client_secret: ['client_secret_example'], redirect_uris: ['redirect_uris_example'], name: 'Your App'}) # ClientRequest | 

begin
  # Update client
  result = api_instance.update_client(client_request)
  p result
rescue OpenapiClient::ApiError => e
  puts "Error when calling ManagementApi->update_client: #{e}"
end

Using the update_client_with_http_info variant

This returns an Array which contains the response data, status code and headers.

<Array(, Integer, Hash)> update_client_with_http_info(client_request)

begin
  # Update client
  data, status_code, headers = api_instance.update_client_with_http_info(client_request)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <ClientResponse>
rescue OpenapiClient::ApiError => e
  puts "Error when calling ManagementApi->update_client_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
client_request ClientRequest

Return type

ClientResponse

Authorization

basic

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json