Skip to content

Latest commit

 

History

History
188 lines (128 loc) · 4.72 KB

TokensessionApi.md

File metadata and controls

188 lines (128 loc) · 4.72 KB

TripletexRubyClient::TokensessionApi

All URIs are relative to https://tripletex.no/v2

Method HTTP request Description
create PUT /token/session/:create Create session token.
delete DELETE /token/session/{token} Delete session token.
who_am_i GET /token/session/>whoAmI Find information about the current user.

create

ResponseWrapperSessionToken create(consumer_token, employee_token, expiration_date)

Create session token.

Example

# load the gem
require 'tripletex_ruby_client'

api_instance = TripletexRubyClient::TokensessionApi.new

consumer_token = 'consumer_token_example' # String | Token of the API consumer

employee_token = 'employee_token_example' # String | The employees token

expiration_date = 'expiration_date_example' # String | Expiration date for the combined token


begin
  #Create session token.
  result = api_instance.create(consumer_token, employee_token, expiration_date)
  p result
rescue TripletexRubyClient::ApiError => e
  puts "Exception when calling TokensessionApi->create: #{e}"
end

Parameters

Name Type Description Notes
consumer_token String Token of the API consumer
employee_token String The employees token
expiration_date String Expiration date for the combined token

Return type

ResponseWrapperSessionToken

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

delete

delete(token)

Delete session token.

Example

# load the gem
require 'tripletex_ruby_client'
# setup authorization
# # Setup authorization - as autogenerated by swagger-codegen
# TripletexRubyClient.configure do |config|
#   # Configure HTTP basic authorization: tokenAuthScheme
#   config.username = 'YOUR USERNAME'
#   config.password = 'YOUR PASSWORD'
# end
# Setup authorization
# 
TripletexRubyClient.configure do |config|
  # Configure HTTP basic authorization: tokenAuthScheme
  config.consumer_token = ENV["TT_CONSUMER_TOKEN"]
  config.employee_token = ENV["TT_EMPLOYEE_TOKEN"]
  config.host = Rails.env.production? ? 'https://tripletex.no' : 'https://api.tripletex.io'
  config.token_expiration_time = Rails.env.production? ? 1.month : 1.day
end
api_instance = TripletexRubyClient::TokensessionApi.new

token = 'token_example' # String | The login token string to delete


begin
  #Delete session token.
  api_instance.delete(token)
rescue TripletexRubyClient::ApiError => e
  puts "Exception when calling TokensessionApi->delete: #{e}"
end

Parameters

Name Type Description Notes
token String The login token string to delete

Return type

nil (empty response body)

Authorization

tokenAuthScheme

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

who_am_i

ResponseWrapperLoggedInUserInfoDTO who_am_i(opts)

Find information about the current user.

Example

# load the gem
require 'tripletex_ruby_client'
# setup authorization
# # Setup authorization - as autogenerated by swagger-codegen
# TripletexRubyClient.configure do |config|
#   # Configure HTTP basic authorization: tokenAuthScheme
#   config.username = 'YOUR USERNAME'
#   config.password = 'YOUR PASSWORD'
# end
# Setup authorization
# 
TripletexRubyClient.configure do |config|
  # Configure HTTP basic authorization: tokenAuthScheme
  config.consumer_token = ENV["TT_CONSUMER_TOKEN"]
  config.employee_token = ENV["TT_EMPLOYEE_TOKEN"]
  config.host = Rails.env.production? ? 'https://tripletex.no' : 'https://api.tripletex.io'
  config.token_expiration_time = Rails.env.production? ? 1.month : 1.day
end
api_instance = TripletexRubyClient::TokensessionApi.new

opts = { 
  fields: 'fields_example' # String | Fields filter pattern
}

begin
  #Find information about the current user.
  result = api_instance.who_am_i(opts)
  p result
rescue TripletexRubyClient::ApiError => e
  puts "Exception when calling TokensessionApi->who_am_i: #{e}"
end

Parameters

Name Type Description Notes
fields String Fields filter pattern [optional]

Return type

ResponseWrapperLoggedInUserInfoDTO

Authorization

tokenAuthScheme

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined