Skip to content

Latest commit

 

History

History
281 lines (194 loc) · 6.72 KB

File metadata and controls

281 lines (194 loc) · 6.72 KB

Zernio::APIKeysApi

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

Method HTTP request Description
create_api_key POST /v1/api-keys Create key
delete_api_key DELETE /v1/api-keys/{keyId} Delete key
list_api_keys GET /v1/api-keys List keys
verify_credential GET /v1/auth/verify Verify credential

create_api_key

create_api_key(create_api_key_request)

Create key

Creates a new API key with an optional expiry. The full key value is only returned once in the response.

Examples

require 'time'
require 'zernio-sdk'
# setup authorization
Zernio.configure do |config|
  # Configure Bearer authorization (JWT): bearerAuth
  config.access_token = 'YOUR_BEARER_TOKEN'
end

api_instance = Zernio::APIKeysApi.new
create_api_key_request = Zernio::CreateApiKeyRequest.new({name: 'name_example'}) # CreateApiKeyRequest | 

begin
  # Create key
  result = api_instance.create_api_key(create_api_key_request)
  p result
rescue Zernio::ApiError => e
  puts "Error when calling APIKeysApi->create_api_key: #{e}"
end

Using the create_api_key_with_http_info variant

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

<Array(, Integer, Hash)> create_api_key_with_http_info(create_api_key_request)

begin
  # Create key
  data, status_code, headers = api_instance.create_api_key_with_http_info(create_api_key_request)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <CreateApiKey201Response>
rescue Zernio::ApiError => e
  puts "Error when calling APIKeysApi->create_api_key_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
create_api_key_request CreateApiKeyRequest

Return type

CreateApiKey201Response

Authorization

bearerAuth

HTTP request headers

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

delete_api_key

delete_api_key(key_id)

Delete key

Permanently revokes and deletes an API key.

Examples

require 'time'
require 'zernio-sdk'
# setup authorization
Zernio.configure do |config|
  # Configure Bearer authorization (JWT): bearerAuth
  config.access_token = 'YOUR_BEARER_TOKEN'
end

api_instance = Zernio::APIKeysApi.new
key_id = 'key_id_example' # String | 

begin
  # Delete key
  result = api_instance.delete_api_key(key_id)
  p result
rescue Zernio::ApiError => e
  puts "Error when calling APIKeysApi->delete_api_key: #{e}"
end

Using the delete_api_key_with_http_info variant

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

<Array(, Integer, Hash)> delete_api_key_with_http_info(key_id)

begin
  # Delete key
  data, status_code, headers = api_instance.delete_api_key_with_http_info(key_id)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <DeleteAccountGroup200Response>
rescue Zernio::ApiError => e
  puts "Error when calling APIKeysApi->delete_api_key_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
key_id String

Return type

DeleteAccountGroup200Response

Authorization

bearerAuth

HTTP request headers

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

list_api_keys

list_api_keys

List keys

Returns all API keys for the authenticated user. Keys are returned with a preview only, not the full key value.

Examples

require 'time'
require 'zernio-sdk'
# setup authorization
Zernio.configure do |config|
  # Configure Bearer authorization (JWT): bearerAuth
  config.access_token = 'YOUR_BEARER_TOKEN'
end

api_instance = Zernio::APIKeysApi.new

begin
  # List keys
  result = api_instance.list_api_keys
  p result
rescue Zernio::ApiError => e
  puts "Error when calling APIKeysApi->list_api_keys: #{e}"
end

Using the list_api_keys_with_http_info variant

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

<Array(, Integer, Hash)> list_api_keys_with_http_info

begin
  # List keys
  data, status_code, headers = api_instance.list_api_keys_with_http_info
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <ListApiKeys200Response>
rescue Zernio::ApiError => e
  puts "Error when calling APIKeysApi->list_api_keys_with_http_info: #{e}"
end

Parameters

This endpoint does not need any parameter.

Return type

ListApiKeys200Response

Authorization

bearerAuth

HTTP request headers

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

verify_credential

verify_credential

Verify credential

Checks whether the bearer credential on this request is valid, without reading any data. Accepts an API key or an OAuth access token. Intended for clients that must validate a credential before use (for example an MCP server verifying an incoming token) so they do not have to call a data endpoint to do it.

Examples

require 'time'
require 'zernio-sdk'
# setup authorization
Zernio.configure do |config|
  # Configure Bearer authorization (JWT): bearerAuth
  config.access_token = 'YOUR_BEARER_TOKEN'
end

api_instance = Zernio::APIKeysApi.new

begin
  # Verify credential
  result = api_instance.verify_credential
  p result
rescue Zernio::ApiError => e
  puts "Error when calling APIKeysApi->verify_credential: #{e}"
end

Using the verify_credential_with_http_info variant

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

<Array(, Integer, Hash)> verify_credential_with_http_info

begin
  # Verify credential
  data, status_code, headers = api_instance.verify_credential_with_http_info
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <VerifyCredential200Response>
rescue Zernio::ApiError => e
  puts "Error when calling APIKeysApi->verify_credential_with_http_info: #{e}"
end

Parameters

This endpoint does not need any parameter.

Return type

VerifyCredential200Response

Authorization

bearerAuth

HTTP request headers

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