### 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'

=&gt;

'UNIQUE\_TRANS\_ID'

,

'otp'

=&gt;

'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

&lt;

&gt;

(

)

;

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: "

&amp;

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

&amp;

format

=

json

&amp;

tran\_id

=

Enter\_Transaction\_ID

&amp;

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

)

=&gt;

\{

if

(

\!

err

)

\{

console

.

log

(

data

)

;

\}

\}

)

;

use

fraudlabspro

::

sms

::

SMSVerification

;

fn

main

(

)

-&gt;

Result

&lt;

(

)

,

Box

&lt;

dyn

std

::

error

::

Error

&gt;&gt;

\{

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

&lt;

String

&gt;

)

\{

// 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

&lt;

String

?

,

String

?

&gt;

(

)

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

)

\}

\}