Get Verification Result API

Developer Guide

Get Verification Result

Verify that an OTP sent by the Send SMS Verification API is valid.

Request

GET

https://api.fraudlabspro.com/v2/verification/result

Parameter Type Description
key string (required) FraudLabs Pro API key.
tran_id string (required) The unique ID that was returned by the Send Verification SMS API that triggered the OTP sms.
otp string (required) The OTP that was sent to the recipient’s phone.
format string (optional) Returns the API response in json (default) or xml format. Valid values: json | xml

Response

Parameter Type Description
result string Indicates if the input parameters matched a valid OTP. Y if a valid OTP is found and N if no valid OTP found.

Sample Codes

Sample Code

require_once

'lib/FraudLabsPro.php'

;

// Configures FraudLabs Pro API key

FraudLabsPro

\

Configuration

::

apiKey

(

'YOUR_API_KEY'

)

;

// Get SMS Verification result

FraudLabsPro

\

SMSVerification

::

verifysms

(

[

'tran_id'

=>

'UNIQUE_TRANS_ID'

,

'otp'

=>

'OTP_RECEIVED'

,

]

)

;

import

com

.

fraudlabspro

.

*

;

import

java

.

util

.

Hashtable

;

public

class

FLP

{

public

static

void

main

(

String

[

]

args

)

{

// Configures FraudLabs Pro API key

FraudLabsPro

.

APIKEY

=

"YOUR_API_KEY"

;

// Get Verification Result API

SMSVerification

verification

=

new

SMSVerification

(

)

;

// Sets transaction ID and otp details for verification purpose

Hashtable

data

=

new

Hashtable

<

>

(

)

;

data

.

put

(

"tran_id"

,

"UNIQUE_TRANS_ID"

)

;

data

.

put

(

"otp"

,

"OTP_RECEIVED"

)

;

String

result

=

verification

.

verifySMS

(

data

)

;

}

}

Imports

FraudLabsPro

.

FraudLabsPro

Imports

Newtonsoft

.

Json

Module

Program

Sub

Main

(

)

'Configure FraudLabs Pro API KEY

FraudLabsProConfig

.

APIKey

=

"YOUR_API_KEY"

'Get Verification Result API

Dim

VerifySMS

As

New

SMSVerification

'Sets SMS details for authentication purpose

Dim

SMSPara

As

New

SMSVerificationPara

With

{

.

TransactionID

=

"UNIQUE_TRANS_ID"

,

.

OTP

=

"OTP_RECEIVED"

}

Dim

result

=

VerifySMS

.

VerifySMS

(

SMSPara

)

Console

.

WriteLine

(

"result: "

&

result

(

"result"

)

.

ToString

)

End

Sub

End

Module

using

FraudLabsPro

.

FraudLabsPro

;

using

System

.

Collections

;

using

Newtonsoft

.

Json

;

using

Newtonsoft

.

Json

.

Linq

;

// Configure FraudLabs Pro API KEY

FraudLabsProConfig

.

APIKey

=

"YOUR_API_KEY"

;

// Get Verification Result API

SMSVerification

VerifySMS

=

new

(

)

;

// Sets SMS details for authentication purpose

SMSVerificationPara

SMSPara

=

new

(

)

{

TransactionID

=

"UNIQUE_TRANS_ID"

,

OTP

=

"OTP_RECEIVED"

}

;

JObject

result

=

VerifySMS

.

VerifySMS

(

SMSPara

)

;

Console

.

WriteLine

(

"result: "

+

result

[

"result"

]

)

;

# Import SDK to use the function

from

libs

.

smsverification

import

SMSVerification

# Configure your API key

api_key

=

'YOUR_API_KEY'

verify_sms_variables

=

{

'key'

:

api_key

,

'tran_id'

:

'UNIQUE_TRANS_ID'

,

'otp'

:

'OTP_RECEIVED'

,

}

print

(

SMSVerification

.

verify_sms

(

verify_sms_variables

)

)

$

curl

https://api.fraudlabspro.com/v2/verification/result?key

=

Enter_License_Key

&

format

=

json

&

tran_id

=

Enter_Transaction_ID

&

otp

=

Enter_OTP_Received

require

'fraudlabspro_ruby'

FraudlabsproRuby

::

Configuration

.

api_key

=

'YOUR_API_KEY'

result

=

FraudlabsproRuby

::

Api

::

SMSVerification

.

verifySMS

(

tran_id

:

'UNIQUE_TRANS_ID'

,

otp

:

'OTP_RECEIVED'

)

const

{

SMSVerification

}

=

require

(

"fraudlabspro-nodejs"

)

;

var

sms

=

new

SMSVerification

(

'YOUR API KEY'

)

;

params

=

{

tran_id

:

'UNIQUE_TRANS_ID'

,

otp

:

'OTP_RECEIVED'

,

}

;

sms

.

verifyOTP

(

params

,

(

err

,

data

)

=>

{

if

(

!

err

)

{

console

.

log

(

data

)

;

}

}

)

;

use

fraudlabspro

::

sms

::

SMSVerification

;

fn

main

(

)

->

Result

<

(

)

,

Box

<

dyn

std

::

error

::

Error

>>

{

let

sms

=

SMSVerification

::

new

(

"YOUR_API_KEY"

)

;

let

res

=

sms

.

verify_sms

(

Some

(

"TRANSACTION_ID"

.

into

(

)

)

,

Some

(

"OTP_RECEIVED"

.

into

(

)

)

,

None

)

?

;

println!

(

"{}"

,

res

)

;

Ok

(

(

)

)

}

package

main

import

(

"github.com/fraudlabspro/fraudlabspro-go/fraudlabspro"

"fmt"

)

func

main

(

)

{

apikey

:=

"YOUR_API_KEY"

config

,

err

:=

fraudlabspro

.

OpenConfiguration

(

apikey

)

if

err

!=

nil

{

fmt

.

Print

(

err

)

return

}

sms

,

err

:=

fraudlabspro

.

OpenSmsVerification

(

config

)

if

err

!=

nil

{

fmt

.

Print

(

err

)

return

}

params

:=

make

(

map

[

string

]

string

)

params

[

"tran_id"

]

=

"XXXXXXXXXXXXXXXXXXXX"

// replace with the actual transaction ID returned by the SendSms function

params

[

"otp"

]

=

"000000"

// replace with the actual OTP received by the recipient mobile phone

res

,

err

:=

sms

.

VerifySms

(

params

)

if

err

!=

nil

{

fmt

.

Print

(

err

)

return

}

fmt

.

Printf

(

"%+v\n"

,

res

)

}

object

TestVerifySMS

{

@JvmStatic

fun

main

(

args

:

Array

<

String

>

)

{

// Configures FraudLabs Pro API key

FraudLabsPro

.

APIKEY

=

"YOUR_API_KEY"

// Get Verification Result API

val

verification

=

SMSVerification

(

)

// Sets transaction ID and otp details for verification purpose

val

data

=

java

.

util

.

Hashtable

<

String

?

,

String

?

>

(

)

data

[

"tran_id"

]

=

"UNIQUE_TRANS_ID"

data

[

"otp"

]

=

"OTP_RECEIVED"

val

result

=

verification

.

verifySMS

(

data

)

print

(

result

)

}

}

import

com

.

fraudlabspro

.

_

import

java

.

util

object

TestVerifySMS

{

def

main

(

args

:

Array

[

String

]

)

:

Unit

=

{

// Configures FraudLabs Pro API key

FraudLabsPro

.

APIKEY

=

"YOUR_API_KEY"

// Get Verification Result API

val

verification

=

new

SMSVerification

// Sets transaction ID and otp details for verification purpose

val

data

=

new

util

.

Hashtable

[

String

,

String

]

data

.

put

(

"tran_id"

,

"OTP_RECEIVED"

)

data

.

put

(

"otp"

,

"100038"

)

val

result

=

verification

.

verifySMS

(

data

)

println

(

result

)

}

}