Skip to content

Latest commit

 

History

History
223 lines (168 loc) · 6.69 KB

OneTimePasswordApi.md

File metadata and controls

223 lines (168 loc) · 6.69 KB

OneTimePasswordApi

All URIs are relative to https://api.thesmsworks.co.uk/v1

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

otpMessageidGet

OTPVerifyResponse otpMessageidGet(messageid)

Retrieve an OTP by it's message ID

Example

// Import classes:
import org.openapitools.client.ApiClient;
import org.openapitools.client.ApiException;
import org.openapitools.client.Configuration;
import org.openapitools.client.auth.*;
import org.openapitools.client.models.*;
import org.openapitools.client.api.OneTimePasswordApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("https://api.thesmsworks.co.uk/v1");
    
    // Configure API key authorization: JWT
    ApiKeyAuth JWT = (ApiKeyAuth) defaultClient.getAuthentication("JWT");
    JWT.setApiKey("YOUR API KEY");
    // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    //JWT.setApiKeyPrefix("Token");

    OneTimePasswordApi apiInstance = new OneTimePasswordApi(defaultClient);
    String messageid = "messageid_example"; // String | The ID of the OTP you would like returned
    try {
      OTPVerifyResponse result = apiInstance.otpMessageidGet(messageid);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling OneTimePasswordApi#otpMessageidGet");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

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

Return type

OTPVerifyResponse

Authorization

JWT

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Success -
404 Error -
0 Error -

otpSendPost

OTPResponse otpSendPost(otp)

Generates and sends a One-Time Password

Example

// Import classes:
import org.openapitools.client.ApiClient;
import org.openapitools.client.ApiException;
import org.openapitools.client.Configuration;
import org.openapitools.client.auth.*;
import org.openapitools.client.models.*;
import org.openapitools.client.api.OneTimePasswordApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("https://api.thesmsworks.co.uk/v1");
    
    // Configure API key authorization: JWT
    ApiKeyAuth JWT = (ApiKeyAuth) defaultClient.getAuthentication("JWT");
    JWT.setApiKey("YOUR API KEY");
    // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    //JWT.setApiKeyPrefix("Token");

    OneTimePasswordApi apiInstance = new OneTimePasswordApi(defaultClient);
    OTP otp = new OTP(); // OTP | OTP properties
    try {
      OTPResponse result = apiInstance.otpSendPost(otp);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling OneTimePasswordApi#otpSendPost");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

Name Type Description Notes
otp OTP OTP properties

Return type

OTPResponse

Authorization

JWT

HTTP request headers

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

HTTP response details

Status code Description Response headers
201 Success -
0 Error -

otpVerifyPost

OTPVerifyResponse otpVerifyPost(passcode)

Generates and sends a One-Time Password

Example

// Import classes:
import org.openapitools.client.ApiClient;
import org.openapitools.client.ApiException;
import org.openapitools.client.Configuration;
import org.openapitools.client.auth.*;
import org.openapitools.client.models.*;
import org.openapitools.client.api.OneTimePasswordApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("https://api.thesmsworks.co.uk/v1");
    
    // Configure API key authorization: JWT
    ApiKeyAuth JWT = (ApiKeyAuth) defaultClient.getAuthentication("JWT");
    JWT.setApiKey("YOUR API KEY");
    // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    //JWT.setApiKeyPrefix("Token");

    OneTimePasswordApi apiInstance = new OneTimePasswordApi(defaultClient);
    OTPVerify passcode = new OTPVerify(); // OTPVerify | One-Time Password
    try {
      OTPVerifyResponse result = apiInstance.otpVerifyPost(passcode);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling OneTimePasswordApi#otpVerifyPost");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

Name Type Description Notes
passcode OTPVerify One-Time Password

Return type

OTPVerifyResponse

Authorization

JWT

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Success -
404 Error -
0 Error -