All URIs are relative to https://api.thesmsworks.co.uk/v1
| Method | HTTP request | Description |
|---|---|---|
| otp_messageid_get | GET /otp/{messageid} | |
| otp_send_post | POST /otp/send | |
| otp_verify_post | POST /otp/verify |
otp_messageid_get(messageid)
Retrieve an OTP by it's message ID
require 'time'
require 'openapi_client'
# setup authorization
OpenapiClient.configure do |config|
# Configure API key authorization: JWT
config.api_key['JWT'] = '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['JWT'] = 'Bearer'
end
api_instance = OpenapiClient::OneTimePasswordApi.new
messageid = 'messageid_example' # String | The ID of the OTP you would like returned
begin
result = api_instance.otp_messageid_get(messageid)
p result
rescue OpenapiClient::ApiError => e
puts "Error when calling OneTimePasswordApi->otp_messageid_get: #{e}"
endThis returns an Array which contains the response data, status code and headers.
<Array(, Integer, Hash)> otp_messageid_get_with_http_info(messageid)
begin
data, status_code, headers = api_instance.otp_messageid_get_with_http_info(messageid)
p status_code # => 2xx
p headers # => { ... }
p data # => <OTPVerifyResponse>
rescue OpenapiClient::ApiError => e
puts "Error when calling OneTimePasswordApi->otp_messageid_get_with_http_info: #{e}"
end| Name | Type | Description | Notes |
|---|---|---|---|
| messageid | String | The ID of the OTP you would like returned |
- Content-Type: Not defined
- Accept: application/json;charset=UTF-8
otp_send_post(otp)
Generates and sends a One-Time Password
require 'time'
require 'openapi_client'
# setup authorization
OpenapiClient.configure do |config|
# Configure API key authorization: JWT
config.api_key['JWT'] = '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['JWT'] = 'Bearer'
end
api_instance = OpenapiClient::OneTimePasswordApi.new
otp = OpenapiClient::OTP.new # OTP | OTP properties
begin
result = api_instance.otp_send_post(otp)
p result
rescue OpenapiClient::ApiError => e
puts "Error when calling OneTimePasswordApi->otp_send_post: #{e}"
endThis returns an Array which contains the response data, status code and headers.
<Array(, Integer, Hash)> otp_send_post_with_http_info(otp)
begin
data, status_code, headers = api_instance.otp_send_post_with_http_info(otp)
p status_code # => 2xx
p headers # => { ... }
p data # => <OTPResponse>
rescue OpenapiClient::ApiError => e
puts "Error when calling OneTimePasswordApi->otp_send_post_with_http_info: #{e}"
end| Name | Type | Description | Notes |
|---|---|---|---|
| otp | OTP | OTP properties |
- Content-Type: application/json
- Accept: application/json;charset=UTF-8
otp_verify_post(passcode)
Generates and sends a One-Time Password
require 'time'
require 'openapi_client'
# setup authorization
OpenapiClient.configure do |config|
# Configure API key authorization: JWT
config.api_key['JWT'] = '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['JWT'] = 'Bearer'
end
api_instance = OpenapiClient::OneTimePasswordApi.new
passcode = OpenapiClient::OTPVerify.new # OTPVerify | One-Time Password
begin
result = api_instance.otp_verify_post(passcode)
p result
rescue OpenapiClient::ApiError => e
puts "Error when calling OneTimePasswordApi->otp_verify_post: #{e}"
endThis returns an Array which contains the response data, status code and headers.
<Array(, Integer, Hash)> otp_verify_post_with_http_info(passcode)
begin
data, status_code, headers = api_instance.otp_verify_post_with_http_info(passcode)
p status_code # => 2xx
p headers # => { ... }
p data # => <OTPVerifyResponse>
rescue OpenapiClient::ApiError => e
puts "Error when calling OneTimePasswordApi->otp_verify_post_with_http_info: #{e}"
end| Name | Type | Description | Notes |
|---|---|---|---|
| passcode | OTPVerify | One-Time Password |
- Content-Type: application/json
- Accept: application/json;charset=UTF-8