Developer Docs

Table of contents

2FA API

WWT 2FA API is a RESTful API for two-factor user authentication on a website or web application: you can use it to confirm a transaction, and user contact information, as a second factor in user authentication, and more.

WWT 2FA API provides a choice of channel for sending a one-time password (OTP) to a user: SMS or Viber. Connect the channel you need in your personal account on the “Settings” page of the “2FA” section and start working with the WWT 2FA API.

Please note: 2FA API is not available for use in DEMO account modes (modes in which your account data is not verified). 

Make sure that you have entered all the necessary data in your account settings in order to use the 2FA service.

Available HTTP Methods

  1. Send a one-time password;
  2. Resend the one-time code;
  3. Check the one-time Code;
  4. Cancel the authentication session;
  5. Check authentication status;
  6. Get a list of authentication sessions.
  7. Create message template;
  8. Delete a message template;
  9. Retrieve the list of templates.

Send One-time password

This API call is used to generate and send a one-time password to a user in an SMS or Viber message. Please note: authentication of recipients who are in the SMS or Viber stop list in your contact book is not possible using the corresponding method. (That is, if the recipient is in the SMS stop list, then when requesting authentication using the SMS method, the one-time password will not be sent, and you will receive an error in response).

To send One-time password make a request to this URL:

POST      https://one-api.wwt.world/api/2fa/authentications/otp

Be reliable. Use 2FA
Get Started

Request parameters

ParameterRequiresTypeDefaultDescription
channelYesstringNoA channel for sending a one-time password. Possible values: “SMS”, “Viber”.
senderYesstringNoSender’s name:from 3 to 11 characters for the sender’s alphanumeric name (Latin letters, symbols, numbers, spaces);3 to 15 characters for the sender’s numeric name.
recipientYesintegerNoThe phone number of the recipient of the one-time password. 9 to 15 digits without the + sign. 3 to 15 characters for the sender’s numeric name.
template_idYesstringNoUnique identifier of the template with the Approved status. It’s not allowed to specify the template ID in other statuses. The template ID must be from 1 to 9 digits.
code_digitsYesintegerNoThe length of the numeric code, from 3 to 9 digits.
code_lifetimeYesintegerNoThe password expiration time after which the password becomes invalid. An integer from 30 seconds to 300 seconds.
code_max_triesYesintegerNoThe number of password verification attempts.An integer from 1 to 5.
sender_altNostringNoUsed only for the Viber channel to alternatively send a one-time code in SMS (if it was not possible to send the code in a Viber message, for example, if the recipient is not a Viber user).The name or number of the SMS sender. String up to 15 characters:from 3 to 11 characters for the sender’s alphanumeric name (Latin letters, symbols, numbers, spaces);3 to 15 characters for the sender’s numeric name.

Request example

{ 

  "recipient": "61401629754", 
  "channel": "string", 
  "sender": "SENDER", 
  "sender_alt": "SENDER_ALT", 
  "template_id": "12", 
  "code_lifetime": 300, 
  "code_max_tries": 3, 
  "code_digits": 5 

} 

Response parameters

ParameterTypeDescription
idstringThe ID of the generated authentication.
recipientstringNumber of the recipient of the message with a one-time code.
statusstringAuthentication status. Possible values: pending (authentication session successfully created and pending).
channelstringAuthentication channel selected for sending the one-time code
senderstringSender name.
sender_altstring/nullSMS sender name.
message_textstringMessage text.
code_lifetimeintegerOTP expiration date.
code_max_triesintegerThe number of OTP check attempts.
code_digitsintegerThe number of digits in the OTP.
pricefloatAuthentication cost. At the time of creating the authentication, 0 is indicated.
currencystringThe three-letter code of the currency in which the value is indicated. Corresponds to the user’s account currency. 
country_codestringThe country code of the recipient of the one-time password according to the ISO 3166-1 alpha-2 standard.
expired_atstringDate and time when the authentication expires in ISO 8601 format.
created_atstringThe date and time of the authentication session were created in ISO 8601 format.
finished_atnullDate and time when the authentication session was closed. At the time of creating the authentication, the value “null” is indicated.

Response example

Response in case of successful request:

{
  "data": {
    "id": "bf4381c8-9d4a-4705-bd28-f89a830b7f96",
    "recipient": "380979965073",
    "status": "pending",
    "channel": "sms",
    "sender": "SENDER",
    "sender_alt": "SENDER_ALT",
    "message_text": "Your verification code: {code}",
    "code_lifetime": 300,
    "code_max_tries": 3,
    "code_digits": 5,
    "price": "0,02",
    "currency": "USD",
    "country_code": "UA",
    "expired_at": "2023-01-04 18:37:06",
    "created_at": "2023-01-04 17:37:06"
    "finished_at": "2023-01-04 17:37:06"
  }
}

Codes of errors

Code ErrorDescription
404 User channel not found This error can occur when the channel is specified incorrectly. Please ensure that you are using the correct channel and try again. 
404 Template not found This error can occur when the template identifier is specified incorrectly or the specified template is not present in the system. Please ensure that you are using the correct template identifier and try again. 
422 Invalid template status This error occurs when the provided template identifier in the request does not match the “Approved” status. 
402 Insufficient funds Insufficient funds to send OTP. Please top up your account. 
422 Exists on the stop list We’re unable to send message as the phone number of recipient is currently in stop list. 
422 User channel inactive The message sending method is disabled. Please enable method in your personal account and try again. 
422 This action is available for the account of your type only for your manager phone number. To send OTP code is not allowed in Demo account mode.  
422 Authentication limit with status pending This error can occur when total authentication limit with status “pending” is exceeded for your account. 
422 Total authentication limit This error can occur when total authentication limit is exceeded for your account. 
422Template is not availableThis error occurs when you try to create authentication using a template that is only available in the test mode of your account. Please choose a different template.

Resend the one-time code

Used to resend the one-time password to the recipient: a new one-time password is generated and sent in the message, and the previous one becomes invalid. When resending, already saved data is used to generate the OTP from the request https://one-api.wwt.world/api/2fa/authentications/otp 

This API call is available only if the current authentication is not completed before its expiration date (the authentication validity period is specified in each 2FA API response).

To resend the one-time code send request to this URL:

POST      https://one-api.wwt.world/api/2fa/authentications/otp/{id}/resend

Be reliable. Use 2FA
Get Started

Request parameters

ParameterRequiresTypeDefaultDescription
idYesstringNoAuthentication ID received in response to https://one-api.wwt.world/api/2fa/authentications/otp The maximum length is 36 characters.

Response parameters

ParameterTypeDescription
idstringThe ID of the generated authentication.
recipientstringNumber of the recipient of the message with a one-time code.
statusstringAuthentication status. Possible values: pending (authentication session successfully created and pending).
channelstringAuthentication channel selected for sending the one-time code
senderstringSender name.
sender_altstring/nullSMS sender name.
message_textstringMessage text.
code_lifetimeintegerOTP expiration date.
code_max_triesintegerThe number of OTP check attempts.
code_digitsintegerThe number of digits in the OTP.
pricefloatAuthentication cost. At the time of creating the authentication, 0 is indicated.
currencystringThe three-letter code of the currency in which the value is indicated. Corresponds to the user’s account currency. 
country_codestringThe country code of the recipient of the one-time password according to the ISO 3166-1 alpha-2 standard.
expired_atstringDate and time when the authentication expires in ISO 8601 format.
created_atstringThe date and time of the authentication session were created in ISO 8601 format.
finished_atnullDate and time when the authentication session was closed. At the time of creating the authentication, the value “null” is indicated.

Response example

Response in case of successful request:

{
  "data": {
    "id": "bf4381c8-9d4a-4705-bd28-f89a830b7f96",
    "recipient": "380979965073",
    "status": "pending",
    "channel": "sms",
    "sender": "SENDER",
    "sender_alt": "SENDER_ALT",
    "message_text": "Your verification code: {code}",
    "code_lifetime": 300,
    "code_max_tries": 3,
    "code_digits": 5,
    "price": "0,02",
    "currency": "USD",
    "country_code": "UA",
    "expired_at": "2023-01-04 18:37:06",
    "created_at": "2023-01-04 17:37:06"
    "finished_at": "2023-01-04 17:37:06"
  }
}

Codes of errors

CodeErrorDescription
422 Authentication failed status This error can occur when attempting to resend the OTP code for an authentication session that has already been completed with a ‘failed’ status. Resending the OTP code is only possible when the authentication session is in the ‘pending’ status. 
422 Authentication canceled status This error can occur when attempting to resend the OTP code for an authentication session that has already been completed with a ‘canceled’ status. Resending the OTP code is only possible when the authentication session is in the ‘pending’ status. 
422 Authentication expired  This error can occur when attempting to resend the OTP code for an authentication session that has already been completed with an ‘expired’ status. Resending the OTP code is only possible when the authentication session is in the ‘pending’ status 
404 Authentication not found This error can occur when the authentication identifier is specified incorrectly or the specified authentication is not present in the system. Please ensure that you are using the correct authentication identifier and try again. 

Check one-time Code

The API call is used to verify that the one-time password you received from the user matches the one sent by WWT.

To Check one-time Code send request to this URL:

POST      https://one-api.wwt.world/api/2fa/authentications/otp/{id}/verify

Request parameters

ParameterRequiresTypeDefaultDescription
idYesstringNoAuthentication ID received in response to https://one-api.wwt.world/api/2fa/authentications/otp The maximum length is 36 characters.
access_code YesintegerNoThe one-time password received by the user through the specified channel or alternative channel (optional) in the generation request that needs to be validated.An integer from 3 to 9 digits.

Response parameters

An example of a response if the code is incorrect:

{
  "errors": [
    {
      "message": "The code does not match the expected value"
    }
  ]
}

If the one-time code is correct:

ParameterTypeDescription
idstringThe ID of the generated authentication.
recipientstringNumber of the recipient of the message with a one-time password.
statusstringAuthentication status. Possible values: verified (the code was successfully verified, and the session was closed with a successful result).
channelstringChannel for authentication.
senderstringSender name.
sender_altstringSMS sender name.
message_textstringMessage text.
code_lifetimeintegerOTP expiration date.
code_max_triesintegerThe number of OTP check attempts.
code_digitsintegerThe number of digits in the OTP.
pricefloatAuthentication cost (excluding the cost of sent messages).
currencystringThe three-letter code of the currency in which the value is indicated. Corresponds to the user’s account currency.
country_codestringReceiver’s country code according to ISO 3166-1 alpha-2.
expired_atstringDate and time when the authentication session expires in ISO 8601 format.
created_atstringThe date and time of the authentication session were created in ISO 8601 format.
finished_atstringDate and time when the authentication session was closed in ISO 8601 format.

Response example

{
  "data": {
    "id": "bf4381c8-9d4a-4705-bd28-f89a830b7f96",
    "recipient": "380979965073",
    "status": "pending",
    "channel": "sms",
    "sender": "SENDER",
    "sender_alt": "SENDER_ALT",
    "message_text": "Your verification code: {code}",
    "code_lifetime": 300,
    "code_max_tries": 3,
    "code_digits": 5,
    "price": "0,02",
    "currency": "USD",
    "country_code": "UA",
    "expired_at": "2023-01-04 18:37:06",
    "created_at": "2023-01-04 17:37:06"
    "finished_at": "2023-01-04 17:37:06"
  }
}

Codes of errors

CodeErrorDescription
404 Authentication not found This error can occur when the authentication identifier is specified incorrectly or the specified authentication is not present in the system. Please ensure that you are using the correct authentication identifier and try again. 
404 The code does not match the expected value The error occurs when the provided code does not match the value that was sent to the recipient’s number. 
422 Access code expired Your OTP password has expired. OTP password is no longer valid. 
422 Authentication verifying attempts limit This error can occur when attempts limit is exceeded for authentication session. 

Cancel the authentication session

Used to cancel the authentication process. In this case, authentication must be in the Pending status.

To cancel the authentication session send request to this URL:

POST      https://one-api.wwt.world/api/2fa/authentications/{id}/cancel

Request parameters

ParametersRequiresTypeDefaultDescription
idYesstringNoAuthentication ID received in response to https://one-api.wwt.world/api/2fa/authentications/otp The maximum length is 36 characters.

Response parameters

ParameterTypeDescription
idstringThe ID of the generated authentication.
recipientstringNumber of the recipient of the message with the OTP code.
statusstringAuthentication status. Possible values: canceled.
channelstringChannel for authentication.
senderstringSender’s name.
sender_altstringAlternate SMS sender name
message_textstringMessage text.
code_lifetimeintegerOTP expiration date.
code_max_triesintegerThe number of OTP check attempts.
code_digitsintegerThe number of digits in the OTP.
pricefloatAuthentication session cost. If authentication is canceled, the cost will be 0.
currencystringThe three-letter code of the currency in which the cost is indicated. 
country_codestringReceiver’s country code according to ISO 3166-1 alpha-2.
expired_atstringDate and time when the authentication session expires in ISO 8601 format.
created_atstringThe date and time of the authentication session was created in ISO 8601 format.
finished_atstringDate and time when the authentication session was closed in ISO 8601 format. 

Response example

Response in case of successful request:

{
  "data": {
    "id": "bf4381c8-9d4a-4705-bd28-f89a830b7f96",
    "recipient": "380979965073",
    "status": "canceled",
    "channel": "sms",
    "sender": "SENDER",
    "sender_alt": "SENDER_ALT",
    "message_text": "Your verification code: {code}",
    "code_lifetime": 300,
    "code_max_tries": 3,
    "code_digits": 5,
    "price": "0,02",
    "currency": "USD",
    "country_code": "UA",
    "expired_at": "2023-01-04 18:37:06",
    "created_at": "2023-01-04 17:37:06"
    "finished_at": "2023-01-04 17:37:06"
  }
}

Possible errors

CodeError Description
404 Authentication not found This error can occur when the authentication identifier is specified incorrectly or the specified authentication is not present in the system. Please ensure that you are using the correct authentication identifier and try again. 
422 Authentication failed status This error can occur when attempting to cancel an authentication session that is already completed with a “failed” status. It is only possible to cancel an authentication session while it is in the “pending” status. 
422 Authentication expired This error can occur when attempting to cancel an authentication session that is already completed with an “expired” status. It is only possible to cancel an authentication session while it is in the “pending” status. 

Check authentication status

Use to get information about the current authentication status by specifying its identifier.

To check authentication status send request to this URL:

GET     https://one-api.wwt.world/api/2fa/authentications/{id}

Be reliable. Use 2FA
Get Started

Request parameters

ParameterRequiresTypeDefaultDescription
idYesstringNoAuthentication ID received in response to https://one-api.wwt.world/api/2fa/authentications/otp. The maximum length is 36 characters.

Response parameters

ParameterTypeDescription
idstringAuthentication ID created at the request of the user.
recipientstringOTP message recipient number (specified by the user in the authentication request)
statusstringAuthentication status. Possible values:pending – authentication has been created and is in the pending state;verified – authentication successful (code successfully verified);expired – authentication has expired;failed – authentication failed;canceled – authentication has been canceled.
channelstringAuthentication channel. Possible values: SMS, Viber.
senderstringThe name of the sender (specified by the user in the authentication request).
sender_altstringAlternative sender name for sending SMS (specified by the user in the authentication request).
code_lifetimeintegerOTP expiration date (specified by the user in the authentication request).
code_max_triesintegerNumber of OTP verification attempts (specified by the user in the authentication request).
code_digitsintegerThe number of digits in the OTP (specified by the user in the authentication request).
pricestringAuthentication cost (excluding the cost of sent messages). The amount must be displayed with 7 decimal places.
currencystringThe three-letter code of the currency in which the value is indicated.
country_codestringReceiver’s country code according to ISO 3166-1 alpha-2.
expired_atstringThe expiration date of the authentication session.
created_atstringThe date and time of the authentication were created in ISO 8601 format.
finished_atstringDate and time when authentication was closed in ISO 8601 format.
messagesarrayArray of message objects:
messages[]idstringThe unique ID of the message.
messages[]recipientstringThe recipient’s phone number.
messages[]statusstringMessage status. Possible values:delivered – the message was sent;accepted – message accepted for sending;undelivered – the message was not delivered.
messages[]channelstringThe channel for sending the message. Possible values: SMS or Viber.
messages[]senderstringThe name of the sender of the message.
messages[]textstringMessage text.
messages[]pricefloatMessage cost.
messages[]currencystringThe three-letter code of the currency in which the value is indicated.
messages[]sent_atstringThe date and time of the message were sent in ISO 8601 format.
messages[]created_atstringThe date and time the message was created in ISO 8601 format.

Response example

Response in case of successful request:

{

  "data": {

      "id": "ea5db413-e368-4952-b745-cc2030210c49", 
      "recipient": "380501403813", 
      "status": "verified", 
      "channel": "sms", 
      "sender": "testsms", 
      "sender_alt": "string", 
      "message_text": "Your WWT 2FA confirmation code is {code}. Do not share this with anyone else.", 
      "code_lifetime": 30, 
      "code_max_tries": 5, 
      "code_digits": 6, 
      "price": 50.25, 
      "currency": "EUR", 
      "country_code": "FR", 
      "expired_at": "2022-04-28 14:21:16", 
      "created_at": "2022-04-28 14:21:16", 
      "updated_at": "2022-04-28 14:21:16", 
      "finished_at": "2022-04-28 14:21:16", 

      "messages": [

        { 
          "id": "1ed32701-5d4f-6cfa-ba06-9db3aa8bab68", 
          "recipient": "61401629754", 
          "status": "accepted", 
          "channel": "sms", 
          "sender": "SENDER", 
          "price": 0.0642918, 
          "currency": "EUR", 
          "sent_at": "2022-04-18 11:00:30", 
          "created_at": "2022-04-18 10:55:35" 

        } 

      ] 

  } 

} 

Possible errors

CodeErrorDescription
404 Authentication not found This error can occur when the authentication identifier is specified incorrectly or the specified authentication is not present in the system. Please ensure that you are using the correct authentication identifier and try again. 

Get a list of authentication sessions

Use to get a list of authentications for a period.

To get a list of authentication sessions make a request to this URL:

GET     https://one-api.wwt.world/api/2fa/authentications

Be reliable. Use 2FA
Get Started

Request parameters

ParameterRequiresTypeDefaultDescription
page[offset]Nointeger0Get auths starting at offset.
page[limit]Nointeger10The number of authentications in the response. Possible values are from 10 to 500.
filter[from]YesstringPeriod start date (date and time when the authentication session was created) in ISO 8601 format.
filter[to]YesstringEnd date of the period (date and time when the authentication was created) in ISO 8601 format.
filter[ids]NostringAuthentication ID. The maximum number is 3.
filter[status]NostringPossible values: “pending”, “verified”, “expired”, “failed”, “canceled”.
filter[channel]NostringPossible values: “SMS”, “Viber”.
filter[recipient]NostringThe phone number to which you want to send the OTP code. 9 to 15 digits.
filter[country_code]NostringBeneficiary country code according to ISO 3166-1 alpha-2
wayNostringascSort options: asc, desc
sortNostringcreated_atSort by: id, status, channel, recipient, created_at, finished_at, country_code.

Response parameters

ParameterTypeDescription
listarrayAn array of authentication objects.
list[]idstringThe ID of the generated authentication.
list[]recipientstringNumber of the recipient of the message with the OTP code.
list[]statusstringAuthentication status. Possible values:pending – authentication has been created and is in the pending state;verified – authentication successful (one-time password successfully verified);expired – authentication has expired;failed – authentication failed;canceled – authentication has been canceled.
list[]channelstringChannel for authentication.
list[]senderstringSender’s name.
list[]sender_altstringAlternative sender name for SMS.
list[]code_lifetimeintegerThe expiration date of the one-time password.
list[]code_max_triesintegerThe number of attempts to verify the one-time password.
list[]code_digitsintegerThe number of digits in the one-time password.
list[]pricefloatAuthentication session cost. 
list[]currencystringThe three-letter code of the currency in which the authentication cost is indicated.
list[]country_codestringReceiver’s country code according to ISO 3166-1 alpha-2.
list[]expired_atstringThe expiration date of the authentication in ISO 8601 format.
list[]created_atstringThe date and time of the authentication was created in ISO 8601 format.
list[]finished_atstringDate and time when authentication was closed in ISO 8601 format.
list[]messagesarrayArray of message objects:
list[]messages[]idstringThe unique ID of the message.
list[]messages[]recipientstringThe recipient’s phone number.
list[]messages[]statusstringMessage status. Possible values:delivered – the message was sent;accepted – message accepted for sending;undelivered – the message was not delivered.
list[]messages[]senderstringThe name of the sender of the message.
list[]messages[]textstringMessage text.
list[]messages[]pricefloatMessage cost.
list[]messages[]currencystringCurrency of the account in which the cost is indicated. Corresponds to the user’s account currency.
list[]messages[]sent_atstringThe date and time of the message was sent in ISO 8601 format.
list[]messages[]created_atstringThe date and time the message was created in ISO 8601 format.
totalintegerThe total number of authentications.

Response example

Response in case of successful request:

{
  "data": {
    "list": [
      {
      "id": "ea5db413-e368-4952-b745-cc2030210c49",
      "recipient": "380501403813",
      "status": "verified",
      "channel": "sms",
      "sender": "testsms",
      "sender_alt": "string",
      "message_text": "Your WWT 2FA confirmation code is {code}. Do not share this with anyone else.",
      "code_lifetime": 30,
      "code_max_tries": 5,
      "code_digits": 6,
      "price": 50.25,
      "currency": "EUR",
      "country_code": "FR",
      "expired_at": "2022-04-28 14:21:16",
      "created_at": "2022-04-28 14:21:16",
      "updated_at": "2022-04-28 14:21:16",
      "finished_at": "2022-04-28 14:21:16",
      "messages": [
        {
          "id": "1ed32701-5d4f-6cfa-ba06-9db3aa8bab68",
          "recipient": "61401629754",
          "status": "accepted",
          "channel": "sms",
          "sender": "SENDER",
          "price": 0.0642918,
          "currency": "EUR",
          "sent_at": "2022-04-18 11:00:30",
          "created_at": "2022-04-18 10:55:35"
        }
      ]
    },
    "total": 100
  }
}

Create a message template

This method creates a new message template used for sending the OTP code.  

Please note that after creating the template, it is moderated. This template will be available for sending messages with the OTP code only after moderation. Once it’s ready, its status will be changed from Requested to Approved.

To create a message template make a request to this URL:

POST  https://one-api.wwt.world/api/2fa/authentications/templates 

Request parameters

ParameterRequires Type Default Description 
name Yes string  Name of the template.  A string of 3 to 50 characters.
countriesYesstringTwo-letter country code(s) for which the created template must apply. Sending messages with the OTP code will only be possible if the recipient’s number belongs to the country you specify for the template.
text Yes string  Text of the message template.  A string of 9 to 70 characters for any encoding (Cyrillic, Latin).  The text must contain one variable for the OTP code – {code2fa}, which will be automatically replaced with the OTP code when the message is sent.

Request example

{   

   "name": "template name",   

   "countries": ["UA","PT","AD","IT"],   

   "text": "test code is {code2fa}" 

}

Response parameters 

ParameterType Description 
template_id string Unique, automatically generated by a system identifier of the template within the 2FA service.
name string Name of the template.
text string The text of the template message.
countriesstringList of countries for which the template is created.
status string Status of the template. After template creation, the status of the template will always be “requested.”
updated_at string Date and time of the last change of the template in ISO 8601 format.

Response example

Response in case of successful request:

{

"data": {

     "template_id": 515,

     "name": "template name",

     "text": "test code is {code2fa}",

     "countries": [

             "AD",

             "IT",

             "PT",

             "UA"

           ],

     "status": "requested",

     "updated_at": "2023-06-30 14:52:58"

    }

}

Possible errors

CodeErrorDescription
422The number of requests to create a template is limited to 10. Please wait for the manager approve before making a new request.You can have no more than 10 templates with the current status “Requested”. If you already have 10 templates with this status, you need to delete one of them to create a new template. Additionally, if any of the existing templates transitions to the “Approved” or “Rejected” status, it also frees up space for creating a new template.
422The variable {code2fa} is required in the textThis error occurs when the message template text does not contain the required variable {code2fa} or the variable syntax is incorrect. This variable is intended for inserting the actual OTP code into the message text.
422The {code2fa} variable must occur only once in the textThis error occurs when multiple occurrences of the {code2fa} variable are found in the message template text. Please check the entire template text and remove any additional occurrences of the variable.
422This action is not available for the account of your typeCreating a message template for sending OTP codes is not allowed in Demo and Test account mode.
422User has a template with the identical name!The template with the specified name in the parameter ‘name’ already exists. Please use names that are distinct from your existing templates.

Delete a message template

This method deletes the message template for sending the OTP code based on its unique identifier.

To delete a message template make a request to this URL:

DELETE    https://one-api.wwt.world/api/2fa/authentications/templates/{template_id}

Request parameters

ParameterRequires Type Default Description 
template_id Yesstring No The ID of the message template that you want to delete. From 1 to 9 digits.

Response parameters

If the request is successful, it returns the answer –- Successfully removed.

Codes of errors

CodeErrorDescription
422 Default template is not available for deletion This error occurs when attempting to delete a template that is set as the default template. The default template cannot be deleted. 
404 Template not found This error can occur when the template identifier is specified incorrectly or the specified template is not present in the system. Please ensure that you are using the correct template identifier and try again. 

Retrieve the list of templates

This method returns a list of message templates for sending OTR code, allowing you to filter them by various parameters.

To retrieve the list of templates make a request to this URL:

GET   https://one-api.wwt.world/api/2fa/authentications/templates

Request parameters

ParameterRequires Type Default Description 
page[offset] Нет integer Get 2FA templates starting with offset. 
page[limit] Нет integer 10 The number of 2FA templates in the response. 
filter[ids] Нет array($string)  The list of template IDs.  
filter[status] Нет string  Possible values: requested, rejected, approved. 
way Нет string asc Sort options: asc, desc 
sort Нет string updated_at Sorting by template_id, status, name, updated_at. 

Response parameters

ParameterType Description 
template_id string Unique identifier of the template.
name string The name of the template.
text string The text of the message
countriesstringList of countries for which the template is created.
status string The status of the template. Possible values:  
  • Requested – the template was created successfully and is waiting for approval. You cannot use the template in this status to send the code to the OTR.
  • Rejected – the template has been rejected. You cannot use the template to send the code to the OTP.
  • Approved – the template has been approved and is available for sending messages with the OTP code.
updated_at string Date and time when the template was created or last modified. The display format is ISO 8601: yyyy-mm-dd hh:mm:ss.
total integer A total number of templates that meet the search conditions.

Example of response

Response in case of a successful request:

{

   "data": [

      {

         "template_id": "49",

         "name": "string",

         "countries": [

            "AD",

            "IT",

            "PT",

            "UA"

         ],

         "text": "Your WWT 2FA confirmation code is {code2fa}.",

         "status": "approved",

         "updated_at": "2022-04-18 10:55:35"

      }

   ],

   "total": 1,

   }

}

2FA errors:

One API errors responses:

    1.1. Access code expired

    1.2. Access code not found

    1.3. Authentication canceled status

    1.4. Authentication expired

    1.5. Authentication failed status

    1.6. Authentication invalid status

    1.7. Authentication limit with status pending

    1.8. Total authentication limit

    1.9. Authentication verifying attempts limit

    1.10. Authentication not found

    1.11. Authentication price not found

    1.12. Insufficient funds

    1.13. Recipient exists on the stop list

    1.14. Authentication channel inactive

    1.15. Authentication channel not found

    1.16. Template not found 

    1.17. Default template is not available for deletion 

    1.18. User has a template with the identical name! 

    1.19. This action is not available for the account of your type.

    1.20. The {code2fa} variable must occur only once in the text 

    1.21. The variable {code2fa} is required in the text 

    1.22. The number of requests to create a template is limited to 10. Please wait for the manager approve before making a new request. 

{
  "errors": [
    {
      "message": "ERROR_MESSAGE_1"
    }
  ]
}

2. OneAPI validation errors:

{
  "message": "The given data was invalid.",
  "errors": {
    "<FIELD_1>": [
      "<VALIDATION_ERROR_1>"
    ], ...

    "<FIELD_N>": [
      "<VALIDATION_ERROR_N>"
    ]
  }
}

3. OneAPI to 2FA integration errors:

    3.1. Raw error 2FA Service response is empty.

    3.2. Raw error 2FA Service response has an incorrect content.

    3.3. Error 2FA Service response is empty.

    3.4. Error 2FA Service response structure is incorrect.

    3.5. 2FA Service getting error response error.

    3.6. 2FA Service getting successful response error.

    3.7. 2FA Service getting response error.

    3.8. 2FA Service error.

    3.9. 2FA Service getting error response error.

    3.10. 2FA Service getting successful response error.

    3.11. 2FA Service getting response error.

{
  "message": "<ERROR_MESSAGE>",
  "errors": [
    ...
  ]
}