Skip to main content

Validate a Phone Validation

Endpoint​

POST https://api.verifik.co/v2/phone-validations/{id}/validate

This service validates a phone validation by providing the verification code. The system will check the code against the stored verification code and update the validation status accordingly.

Headers​

Content-Type​

Type: String
Required: Required
Value: application/json

Authorization​

Type: String
Required: Required
Value: Bearer {YOUR_ACCESS_TOKEN}

Path Parameters​

id​

Type: String
Required: Yes

The unique identifier of the phone validation record you want to validate.

Body Parameters​

verificationCode​

Type: String
Required: Yes

The verification code received via SMS.

Request​

import axios from 'axios';

const options = {
method: 'POST',
url: 'https://api.verifik.co/v2/phone-validations/phone_validation_123456789/validate',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer <your_token>'
},
data: {
verificationCode: '123456'
}
};

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

Response​

{
"success": true,
"data": {
"_id": "phone_validation_123456789",
"client": "client_123456789",
"project": "project_123456789",
"projectFlow": "flow_123456789",
"status": "validated",
"countryCode": "+1",
"phone": "1234567890",
"type": "validation",
"validationMethod": "verificationCode",
"verificationCode": "123456",
"expiresAt": "2024-01-15T11:30:00Z",
"attempts": 1,
"maxAttempts": 3,
"createdAt": "2024-01-15T10:30:00Z",
"updatedAt": "2024-01-15T10:32:00Z",
"validatedAt": "2024-01-15T10:32:00Z"
},
"signature": {
"dateTime": "April 11, 2023 12:25 PM",
"message": "Certified by Verifik.co"
}
}

Features​

  • Code Validation: Validates 6-digit OTP codes sent via SMS
  • Attempt Control: Tracks validation attempts and maximum limits
  • Expiration: Handles expired codes with appropriate responses
  • Status Update: Updates validation status after successful verification
  • Timestamps: Records when validation was completed
  • Country Codes: Maintains country code information during validation
  • Multiple Languages: Support for JavaScript, Python, PHP and Swift
  • Error Handling: Detailed error responses for different scenarios