OTP (One Time Password)

It is a pin or dynamic password, is a password that is valid for only one login session or transaction, on a computer system or other digital device.

One-Time Passwords help growing startups and agile enterprises enhance customer experience and realize new business outcomes at scale. With the most comprehensive suite of communication channels, a global platform, and expert support, you can abstract the complexity of communications and innovate faster.

Request OTP

It is part of ANTS account security offerings, the OTP API makes it simple to add user verification to various application and use cases. It supports codes sent via SMS.

Sequence Diagram

Sequence Diagram (API RequestOTP)

You can start creating HTTP request as this following:

Name

Description

HTTP Headers

Content-Type: application/json

Authorization: (Basic Auth) Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==

HTTP Methods

POST

Request body should be indicated with these following parameters

Parameters

type

description

otcId

String

OTP to verify log in and view OTP application configuration

mobile

String

The destination phone number for your SMS message

notifyUrl

(optional)

String

Defending URL on callback server to get Delivery report according to Send Callback link

Example: notifyUrl=https//www.example.com

notifyContentType

(optional)

String

Preferred Delivery report content type of delivery report to application/json Example: notifyContentType=application/json

callbackData

(optional)

String

Specifies the value to return. When specified, notifyUrl will also return this callbackData.

Request JSON

{
 	"otcId": "0DC8E7AD-0168-440C-AF10-BF556B164D83",
 	"mobile": "66123456789",
  "notifyUrl": "https://testSendOTP",
  "notifyContentType": "application/json",
  "callbackData":"OTP Data"
}

ResendOTP

It is part of ANTS account security offerings, the OTP API makes it simple to add user verification to various application and use cases. It supports codes sent via SMS again.

Sequence Diagram

You can start creating HTTP request as this following:

Name

Description

HTTP Headers

Content-Type: application/json

Authorization: (Basic Auth) Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==

HTTP Methods

POST

Request body should be indicated with these following parameters

Parameters

type

description

otcId

String

OTP to verify log in and view OTP application configuration

Request JSON

{
 	"otcId": "0DC8E7AD-0168-440C-AF10-BF556B164D83",
}

Verify OTP

Use to verify set of password and verify owner of the account.

Sequence Diagram

Sequence Diagram (API VerifyOTP)

You can start using HTTP request as following details:

Name

Description

HTTP Headers

Content-Type: application/json

Authorization: (Basic Auth) Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==

HTTP Methods

POST

Request body should be indicated with these following parameter

Parameters

type

description

otpId

String

The OTP ID which uniquely identifies the request

otpCode

String

OTP code

The request JSON will look like:

{
    "otpId": "0c342e74-a9c7-4bbd-8da4-b36a49bbc0d6",
   	"otpCode": "79895"
    "notifyUrl": "https://testSendOTP",
    "notifyContentType": "application/json",
    "callbackData":"OTP Data"
}

Response Status

While using our API you may encounter certain status and error codes that you need to understand or troubleshoot.

Each code with the descriptions will guild you to take action steps you need to take in case you are looking for a resolution of the problem.

Status Code

Beside HTTP status code standard, there will be also API response status.

{
	  "error": {
		"message": "Invalid OTP Config",
		"description": ""
             }
}

Status Code

Code

Message EN

Message TH

0000

Success

สำเร็จ

9999

Exception

ผิดพลาด

9998

Authentication failed

username or password ผิดพลาด

9996

Bad Request

คำสั่งไม่ถูกต้อง

9995

Credit not enough

เครดิตหมด

0301

Invalid OTP Config

ตั้งค่า OTP ไม่ถูกต้อง

0302

Number Prefix Missing

ไม่มีคำนำหน้า

0303

No Data Available OTP

ไม่พบข้อมูล OTP

0304

Over Limit Usage

กรอกข้อมูลเกินจำนวนครั้งที่กำหนด

0305

OTP Code Expired

OTP Code หมดอายุ

0306

OTP Code Confirmed

OTP Code ยืนยันตัวตนไปแล้ว

0307

Invalid Number

หมายเลขไม่ถูกต้อง

Last updated

Was this helpful?