Skip to main content

API Key Access via Phone

Endpoint​

https://api.verifik.co/v2/projects/phone-login

Methods used for logging in with an already generated account in Verifik. This procedure is important because all queries require an Access Token, which is only generated upon login to the Verifik page.

These services create an OTP (One Time Password) request necessary to validate that the phone or email belongs to a Verifik client.

Headers​

NameValue
Content-Typeapplication/json

Parameters​

NameTypeRequiredDescription
countryCodestringYesCountry code for the phone number
phonenumberYesPhone number
typestringYesType of request. Use "login" for authentication

Request​

import axios from 'axios';

const options = {
method: 'POST',
url: 'https://api.verifik.co/v2/projects/phone-login',
headers: {
'Content-Type': 'application/json'
},
data: {
countryCode: '+1',
phone: 1234566663,
type: 'login'
}
};

try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}

Response​

{
"data": {
"client": "613375a1eab2fe08527f81e2",
"project": "6266193db77ccc8111730c90",
"projectFlow": "658ed28b0990f300134d7b78",
"status": "sent",
"countryCode": "+1",
"phone": "1234566663",
"phoneGateway": "whatsapp",
"otp": "$2a$10$fdoxDgtv6J7E4nnZoCORSOiUbpCGOOE5JWghrvAUNZIoX5h81zJLq",
"expiresAt": "2024-05-29T03:51:26.000Z",
"phoneData": {
"title": "Verifik Client"
},
"type": "login",
"redirectUrl": "https://verifik.co",
"requires2FA": false,
"language": "en",
"_id": "6656a3e6eb43abfd7146abb6",
"updatedAt": "2024-05-29T03:41:27.009Z",
"createdAt": "2024-05-29T03:41:27.009Z",
"__v": 0,
"new": true,
"providerConfirmation": {}
},
"signature": {
"dateTime": "May 29, 2024 3:41 AM",
"message": "Certified by Verifik.co"
},
"id": "Y0628"
}

OTP Confirmation​

Endpoint​

https://api.verifik.co/v2/projects/phone-login/confirm

The OTP confirmation services aim to generate a "login" to the Verifik account by validating that the sent OTP matches the one sent to the phone. As a response, the access token is obtained, which the user can use for queries.

Parameters​

NameTypeRequiredDescription
countryCodestringYesCountry code for the phone number
phonenumberYesPhone number
otpstringYesOne Time Password received via phone

Request​

import axios from 'axios';

const options = {
method: 'POST',
url: 'https://api.verifik.co/v2/projects/phone-login/confirm',
headers: {
'Content-Type': 'application/json'
},
data: {
countryCode: '+1',
phone: 1234566663,
otp: '123456'
}
};

try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}

Response​

{
"data": {
"accessToken": "eyJhbGcpXVCJ9.eyJjbGllbnR...JZCIYiUzNjEaIWxYShWeBaRs",
"tokenType": "bearer"
}
}

Features​

  • Phone Authentication: Login using phone number with OTP verification
  • OTP Generation: Secure one-time password sent via WhatsApp/SMS
  • Token Generation: Access token valid for 30 days upon successful authentication
  • Structured Response: Organized data format for easy integration
  • Multiple Programming Languages: Support for JavaScript, Python, PHP, and Swift
  • Error Handling: Comprehensive error responses for various scenarios

Note: A token generated by this means will be valid for 30 days from the time the successful response is received. Verifik is not responsible for handling the Access Token. It is recommended to be very careful in determining who or what uses it to avoid potential consumption issues.