Skip to main content

Phone number verification

Phone number verification is a two-step process consisting of sending verification code via SMS message to the user and verifying that the code which user entered is valid.

If the code is not confirmed in 2min., expect to receive a call with the same code, which is valid for 3 more minutes. After that expect another call with a new code which is valid for 5min. By confirming the second code in 5min. period it is successfully confirmed.

1. Sending SMS message with verification code

Call endpoint which will send an SMS message containing verification code to the user

Sending request

Send a HTTP Post request to: https://ivs.idenfy.com/fraud/send-sms

The request must contain basic auth headers where username is api key and password is api secret.

note

API key and API secret can be retrieved by contacting iDenfy sales team:


The request must contain JSON with parameters:

KeyRequiredTypeConstraintsDefaultExplanation
phone_numberYesStringE.164 format-Phone number with country code, to which will be sent the verification code via SMS message
sender_nameNoString- Max length 11iDenfyName or number which will be displayed as sender number/name

Receiving response

KeyTypeExplanation
request_idStringYou will need this for the verification step

Examples

Example request

{
"phone_number": "+12025550163",
"sender_name": "The Sender"
}

Example response

{
"request_id": "3d50e1584e0946e789e0185c009aaadf"
}

Example sent SMS message

The Sender code: 1234. Valid for 5 minutes. 

2. Verifying user-entered code

After the verification code was sent, the user can enter the code he got, and we can verify if it is valid

Sending request

Send a HTTP Post request to: https://ivs.idenfy.com/fraud/verify-sms

The request must contain basic auth headers where username is api key and password is api secret.

note

API key and API secret can be retrieved by contacting iDenfy sales team:


The request must contain JSON with parameters:

KeyRequiredTypeConstraintsExplanation
request_idYesString- Min Length 32
- Max Length 40
request_id which was returned from SMS message sending endpoint
received_codeYesString- Length 4Numerical verification code which was entered by user

Receiving response

KeyTypeExplanation
is_verifiedBoolIf true, the received_code was valid, if false, the received_code was invalid, already validated, or the wrong received_code was provided too many times

Examples

Example request

{
"request_id": "3d50e1584e0946e789e0185c009aaadf",
"received_code": "1234"
}

Example response

{
"is_verified": true
}