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 |
OTPVerifyResponse OtpMessageidGet (string messageid)
Retrieve an OTP by it's message ID
using System.Collections.Generic;
using System.Diagnostics;
using SMSWorks.Api.Api;
using SMSWorks.Api.Client;
using SMSWorks.Api.Model;
namespace Example
{
public class OtpMessageidGetExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "https://api.thesmsworks.co.uk/v1";
// Configure API key authorization: JWT
config.AddApiKey("Authorization", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// config.AddApiKeyPrefix("Authorization", "Bearer");
var apiInstance = new OneTimePasswordApi(config);
var messageid = "messageid_example"; // string | The ID of the OTP you would like returned
try
{
OTPVerifyResponse result = apiInstance.OtpMessageidGet(messageid);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling OneTimePasswordApi.OtpMessageidGet: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}This returns an ApiResponse object which contains the response data, status code and headers.
try
{
ApiResponse<OTPVerifyResponse> response = apiInstance.OtpMessageidGetWithHttpInfo(messageid);
Debug.Write("Status Code: " + response.StatusCode);
Debug.Write("Response Headers: " + response.Headers);
Debug.Write("Response Body: " + response.Data);
}
catch (ApiException e)
{
Debug.Print("Exception when calling OneTimePasswordApi.OtpMessageidGetWithHttpInfo: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}| 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
| Status code | Description | Response headers |
|---|---|---|
| 200 | Success | - |
| 404 | Error | - |
| 0 | Error | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
OTPResponse OtpSendPost (OTP otp)
Generate and send a One-Time Password
using System.Collections.Generic;
using System.Diagnostics;
using SMSWorks.Api.Api;
using SMSWorks.Api.Client;
using SMSWorks.Api.Model;
namespace Example
{
public class OtpSendPostExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "https://api.thesmsworks.co.uk/v1";
// Configure API key authorization: JWT
config.AddApiKey("Authorization", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// config.AddApiKeyPrefix("Authorization", "Bearer");
var apiInstance = new OneTimePasswordApi(config);
var otp = new OTP(); // OTP | OTP properties
try
{
OTPResponse result = apiInstance.OtpSendPost(otp);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling OneTimePasswordApi.OtpSendPost: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}This returns an ApiResponse object which contains the response data, status code and headers.
try
{
ApiResponse<OTPResponse> response = apiInstance.OtpSendPostWithHttpInfo(otp);
Debug.Write("Status Code: " + response.StatusCode);
Debug.Write("Response Headers: " + response.Headers);
Debug.Write("Response Body: " + response.Data);
}
catch (ApiException e)
{
Debug.Print("Exception when calling OneTimePasswordApi.OtpSendPostWithHttpInfo: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}| Name | Type | Description | Notes |
|---|---|---|---|
| otp | OTP | OTP properties |
- Content-Type: application/json
- Accept: application/json;charset=UTF-8
| Status code | Description | Response headers |
|---|---|---|
| 201 | Success | - |
| 0 | Error | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
OTPVerifyResponse OtpVerifyPost (OTPVerify passcode)
Verify a One-Time Password
using System.Collections.Generic;
using System.Diagnostics;
using SMSWorks.Api.Api;
using SMSWorks.Api.Client;
using SMSWorks.Api.Model;
namespace Example
{
public class OtpVerifyPostExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "https://api.thesmsworks.co.uk/v1";
// Configure API key authorization: JWT
config.AddApiKey("Authorization", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// config.AddApiKeyPrefix("Authorization", "Bearer");
var apiInstance = new OneTimePasswordApi(config);
var passcode = new OTPVerify(); // OTPVerify | One-Time Password
try
{
OTPVerifyResponse result = apiInstance.OtpVerifyPost(passcode);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling OneTimePasswordApi.OtpVerifyPost: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}This returns an ApiResponse object which contains the response data, status code and headers.
try
{
ApiResponse<OTPVerifyResponse> response = apiInstance.OtpVerifyPostWithHttpInfo(passcode);
Debug.Write("Status Code: " + response.StatusCode);
Debug.Write("Response Headers: " + response.Headers);
Debug.Write("Response Body: " + response.Data);
}
catch (ApiException e)
{
Debug.Print("Exception when calling OneTimePasswordApi.OtpVerifyPostWithHttpInfo: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}| Name | Type | Description | Notes |
|---|---|---|---|
| passcode | OTPVerify | One-Time Password |
- Content-Type: application/json
- Accept: application/json;charset=UTF-8
| Status code | Description | Response headers |
|---|---|---|
| 200 | Success | - |
| 404 | Error | - |
| 0 | Error | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]