Skip to content

Latest commit

 

History

History
196 lines (130 loc) · 5.61 KB

OneTimePasswordApi.md

File metadata and controls

196 lines (130 loc) · 5.61 KB

OpenAPI\Client\OneTimePasswordApi

All URIs are relative to https://api.thesmsworks.co.uk/v1, except if the operation defines another base path.

Method HTTP request Description
otpMessageidGet() GET /otp/{messageid}
otpSendPost() POST /otp/send
otpVerifyPost() POST /otp/verify

otpMessageidGet()

otpMessageidGet($messageid): \OpenAPI\Client\Model\OTPVerifyResponse

Retrieve an OTP by it's message ID

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure API key authorization: JWT
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKey('Authorization', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer');


$apiInstance = new OpenAPI\Client\Api\OneTimePasswordApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$messageid = 'messageid_example'; // string | The ID of the OTP you would like returned

try {
    $result = $apiInstance->otpMessageidGet($messageid);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling OneTimePasswordApi->otpMessageidGet: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
messageid string The ID of the OTP you would like returned

Return type

\OpenAPI\Client\Model\OTPVerifyResponse

Authorization

JWT

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json;charset=UTF-8

[Back to top] [Back to API list] [Back to Model list] [Back to README]

otpSendPost()

otpSendPost($otp): \OpenAPI\Client\Model\OTPResponse

Generates and sends a One-Time Password

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure API key authorization: JWT
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKey('Authorization', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer');


$apiInstance = new OpenAPI\Client\Api\OneTimePasswordApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$otp = new \OpenAPI\Client\Model\OTP(); // \OpenAPI\Client\Model\OTP | OTP properties

try {
    $result = $apiInstance->otpSendPost($otp);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling OneTimePasswordApi->otpSendPost: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
otp \OpenAPI\Client\Model\OTP OTP properties

Return type

\OpenAPI\Client\Model\OTPResponse

Authorization

JWT

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json;charset=UTF-8

[Back to top] [Back to API list] [Back to Model list] [Back to README]

otpVerifyPost()

otpVerifyPost($passcode): \OpenAPI\Client\Model\OTPVerifyResponse

Generates and sends a One-Time Password

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure API key authorization: JWT
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKey('Authorization', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer');


$apiInstance = new OpenAPI\Client\Api\OneTimePasswordApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$passcode = new \OpenAPI\Client\Model\OTPVerify(); // \OpenAPI\Client\Model\OTPVerify | One-Time Password

try {
    $result = $apiInstance->otpVerifyPost($passcode);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling OneTimePasswordApi->otpVerifyPost: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
passcode \OpenAPI\Client\Model\OTPVerify One-Time Password

Return type

\OpenAPI\Client\Model\OTPVerifyResponse

Authorization

JWT

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json;charset=UTF-8

[Back to top] [Back to API list] [Back to Model list] [Back to README]