Skip to content

Latest commit

 

History

History
297 lines (231 loc) · 8.54 KB

File metadata and controls

297 lines (231 loc) · 8.54 KB

SMSWorks.Api.Api.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 (string messageid)

Retrieve an OTP by it's message ID

Example

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);
            }
        }
    }
}

Using the OtpMessageidGetWithHttpInfo variant

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);
}

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 -

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

OtpSendPost

OTPResponse OtpSendPost (OTP otp)

Generate and send a One-Time Password

Example

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);
            }
        }
    }
}

Using the OtpSendPostWithHttpInfo variant

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);
}

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 -

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

OtpVerifyPost

OTPVerifyResponse OtpVerifyPost (OTPVerify passcode)

Verify a One-Time Password

Example

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);
            }
        }
    }
}

Using the OtpVerifyPostWithHttpInfo variant

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);
}

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 -

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