All URIs are relative to https://api.sandbox.velopayments.com
Method | HTTP request | Description |
---|---|---|
logout | POST /v1/logout | Logout |
reset_password | POST /v1/password/reset | Reset password |
validate_access_token | POST /v1/validate | validate |
velo_auth | POST /v1/authenticate | Authentication endpoint |
logout
Logout
Given a valid access token in the header then log out the authenticated user or client
Will revoke the token
require 'time'
require 'velopayments'
# setup authorization
VeloPayments.configure do |config|
# Configure OAuth2 access token for authorization: OAuth2
config.access_token = 'YOUR ACCESS TOKEN'
end
api_instance = VeloPayments::LoginApi.new
begin
# Logout
api_instance.logout
rescue VeloPayments::ApiError => e
puts "Error when calling LoginApi->logout: #{e}"
end
This returns an Array which contains the response data (nil
in this case), status code and headers.
<Array(nil, Integer, Hash)> logout_with_http_info
begin
# Logout
data, status_code, headers = api_instance.logout_with_http_info
p status_code # => 2xx
p headers # => { ... }
p data # => nil
rescue VeloPayments::ApiError => e
puts "Error when calling LoginApi->logout_with_http_info: #{e}"
end
This endpoint does not need any parameter.
nil (empty response body)
- Content-Type: Not defined
- Accept: application/json
reset_password(reset_password_request)
Reset password
Reset password
An email with an embedded link will be sent to the receipient of the email address
The link will contain a token to be used for resetting the password
require 'time'
require 'velopayments'
api_instance = VeloPayments::LoginApi.new
reset_password_request = VeloPayments::ResetPasswordRequest.new({email: 'foo@example.com'}) # ResetPasswordRequest | An Email address to send the reset password link to
begin
# Reset password
api_instance.reset_password(reset_password_request)
rescue VeloPayments::ApiError => e
puts "Error when calling LoginApi->reset_password: #{e}"
end
This returns an Array which contains the response data (nil
in this case), status code and headers.
<Array(nil, Integer, Hash)> reset_password_with_http_info(reset_password_request)
begin
# Reset password
data, status_code, headers = api_instance.reset_password_with_http_info(reset_password_request)
p status_code # => 2xx
p headers # => { ... }
p data # => nil
rescue VeloPayments::ApiError => e
puts "Error when calling LoginApi->reset_password_with_http_info: #{e}"
end
Name | Type | Description | Notes |
---|---|---|---|
reset_password_request | ResetPasswordRequest | An Email address to send the reset password link to |
nil (empty response body)
No authorization required
- Content-Type: application/json
- Accept: application/json
validate_access_token(access_token_validation_request, opts)
validate
The second part of login involves validating using an MFA device
An access token with PRE_AUTH authorities is required
require 'time'
require 'velopayments'
# setup authorization
VeloPayments.configure do |config|
# Configure OAuth2 access token for authorization: OAuth2
config.access_token = 'YOUR ACCESS TOKEN'
end
api_instance = VeloPayments::LoginApi.new
access_token_validation_request = VeloPayments::AccessTokenValidationRequest.new({otp: '123456'}) # AccessTokenValidationRequest | An OTP from the user's registered MFA Device
opts = {
authorization: 'authorization_example' # String | Bearer token authorization leg of validate
}
begin
# validate
result = api_instance.validate_access_token(access_token_validation_request, opts)
p result
rescue VeloPayments::ApiError => e
puts "Error when calling LoginApi->validate_access_token: #{e}"
end
This returns an Array which contains the response data, status code and headers.
<Array(, Integer, Hash)> validate_access_token_with_http_info(access_token_validation_request, opts)
begin
# validate
data, status_code, headers = api_instance.validate_access_token_with_http_info(access_token_validation_request, opts)
p status_code # => 2xx
p headers # => { ... }
p data # => <AccessTokenResponse>
rescue VeloPayments::ApiError => e
puts "Error when calling LoginApi->validate_access_token_with_http_info: #{e}"
end
Name | Type | Description | Notes |
---|---|---|---|
access_token_validation_request | AccessTokenValidationRequest | An OTP from the user's registered MFA Device | |
authorization | String | Bearer token authorization leg of validate | [optional] |
- Content-Type: application/json
- Accept: application/json
velo_auth(opts)
Authentication endpoint
Use this endpoint to obtain an access token for calling Velo Payments APIs. Use HTTP Basic Auth. String value of Basic and a Base64 endcoded string comprising the API key (e.g. 44a9537d-d55d-4b47-8082-14061c2bcdd8) and API secret (e.g. c396b26b-137a-44fd-87f5-34631f8fd529) with a colon between them. E.g. Basic 44a9537d-d55d-4b47-8082-14061c2bcdd8:c396b26b-137a-44fd-87f5-34631f8fd529
require 'time'
require 'velopayments'
# setup authorization
VeloPayments.configure do |config|
# Configure HTTP basic authorization: basicAuth
config.username = 'YOUR USERNAME'
config.password = 'YOUR PASSWORD'
end
api_instance = VeloPayments::LoginApi.new
opts = {
grant_type: 'grant_type_example' # String | OAuth grant type. Should use 'client_credentials'
}
begin
# Authentication endpoint
result = api_instance.velo_auth(opts)
p result
rescue VeloPayments::ApiError => e
puts "Error when calling LoginApi->velo_auth: #{e}"
end
This returns an Array which contains the response data, status code and headers.
<Array(, Integer, Hash)> velo_auth_with_http_info(opts)
begin
# Authentication endpoint
data, status_code, headers = api_instance.velo_auth_with_http_info(opts)
p status_code # => 2xx
p headers # => { ... }
p data # => <AuthResponse>
rescue VeloPayments::ApiError => e
puts "Error when calling LoginApi->velo_auth_with_http_info: #{e}"
end
Name | Type | Description | Notes |
---|---|---|---|
grant_type | String | OAuth grant type. Should use 'client_credentials' | [optional][default to 'client_credentials'] |
- Content-Type: Not defined
- Accept: application/json