All URIs are relative to http://localhost/api/v1
Method | HTTP request | Description |
---|---|---|
create_token | POST /auth/token | |
delete_token | DELETE /auth/token | |
me | GET /auth/me |
TokenResponse create_token(credential)
Creates a new token
# load the gem
require 'triglav_client'
api_instance = TriglavClient::AuthApi.new
credential = TriglavClient::Credential.new # Credential |
begin
result = api_instance.create_token(credential)
p result
rescue TriglavClient::ApiError => e
puts "Exception when calling AuthApi->create_token: #{e}"
end
Name | Type | Description | Notes |
---|---|---|---|
credential | Credential |
No authorization required
- Content-Type: application/json
- Accept: application/json
delete_token
Deletes (Expires) a token of header
# load the gem
require 'triglav_client'
# setup authorization
TriglavClient.configure do |config|
# Configure API key authorization: api_key
config.api_key['Authorization'] = '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['Authorization'] = 'Bearer'
end
api_instance = TriglavClient::AuthApi.new
begin
api_instance.delete_token
rescue TriglavClient::ApiError => e
puts "Exception when calling AuthApi->delete_token: #{e}"
end
This endpoint does not need any parameter.
nil (empty response body)
- Content-Type: application/json
- Accept: application/json
UserResponse me
Returns a user property of the access_token
# load the gem
require 'triglav_client'
# setup authorization
TriglavClient.configure do |config|
# Configure API key authorization: api_key
config.api_key['Authorization'] = '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['Authorization'] = 'Bearer'
end
api_instance = TriglavClient::AuthApi.new
begin
result = api_instance.me
p result
rescue TriglavClient::ApiError => e
puts "Exception when calling AuthApi->me: #{e}"
end
This endpoint does not need any parameter.
- Content-Type: application/json
- Accept: application/json