Welcome to Chinguisoft's SMS Validation API!
Use this guide to quickly integrate the API into your applications.
The Chinguisoft SMS Validation API simplifies phone number validation for your application by sending a secure SMS to the provided number. This SMS includes a unique, randomly generated validation code and a brief explanatory message tailored to the recipient's language preference (Arabic or French).
ar
) or French (fr
).validation_key
and Validation-token
for authorization.To create an application:
Every request must include:
If you do not have a Validation-token, or to Increase your balance, please contact us here.
Method: POST
URL: https://chinguisoft.com/api/sms/validation/{validation_key}
Validation-token: your_validation_token Content-Type: application/json
{ "phone": "44800028", "lang": "ar" }
2
, 3
, or 4
and contain 8 digits.ar
: Arabicfr
: French{ "code": 654321, "balance": 95 }
{ "errors": { "phone": [ "The phone field is required.", "The phone format is invalid." ], "lang": [ "The lang field is required.", "The selected lang is invalid." ] } }
{ "message": "Too many requests, please slow down." }
validation_key
or Validation-token
.
{ "error": "Unauthorized" }
{ "error": "Payment Required: please contact us", "balance": 2 }
{ "error": "Service Unavailable: working on it" }
{ "sender": your_app_name (like Bankily) "sms": "رمزك هو 123456. لا تشاركه مع أي شخص. ستنتهي صلاحيته خلال 10 دقائق. إذا لم تطلب هذا الرمز، تجاهل هذه الرسالة." }
{ "sender": your_app_name (like Bankily) "sms": "Votre code est 123456. Ne le partagez avec personne. Il expirera dans 10 min. Si non demandé, ignorez ce message." }
If you need to customize the sms, please contact us here.
curl -X POST https://chinguisoft.com/api/sms/validation/your_validation_key \ -H "Validation-token: your_validation_token" \ -H "Content-Type: application/json" \ -d '{ "phone": "44800028", "lang": "ar" }'
import requests # Your unique validation key provided by Chinguisoft. validation_key = 'your_validation_key' # The API token required for authorization. token = 'your_validation_token' # The API endpoint for validation. url = f"https://chinguisoft.com/api/sms/validation/{validation_key}" # Headers for the request. headers = { 'Validation-token': token, 'Content-Type': 'application/json', } # Data payload for the request. data = { 'phone': '44800028', 'lang': 'ar' } # Make the POST request. response = requests.post(url, headers=headers, json=data) # Output the response body (validation result). print(response.text)
require 'vendor/autoload.php'; use GuzzleHttp\Client; // Your unique validation key provided by Chinguisoft. $validationKey = 'your_validation_key'; // The API token required for authorization. $token = 'your_validation_token'; // Initialize a new Guzzle HTTP client. $client = new Client(); // Make a POST request to the validation API. $response = $client->post("https://chinguisoft.com/api/sms/validation/$validationKey", [ 'headers' => [ // Include the API token in the request headers. 'Validation-token' => $token, // Specify that the request body is in JSON format. 'Content-Type' => 'application/json', ], 'json' => [ // Provide the phone number to validate. 'phone' => '44800028', // Specify the preferred language for the SMS. 'lang' => 'ar' ] ]); // Output the response body (validation result). echo $response->getBody();
import java.net.URI; import java.net.http.HttpClient; import java.net.http.HttpRequest; import java.net.http.HttpResponse; public class ValidationApiExample { public static void main(String[] args) { // Your validation key provided by Chinguisoft String validationKey = "your_validation_key"; // Your unique API token for authorization String token = "your_validation_token"; // The API endpoint to send requests to String apiUrl = "https://chinguisoft.com/api/sms/validation/" + validationKey; // The body of the POST request in JSON format String requestBody = "{\"phone\":\"44800028\", \"lang\":\"ar\"}"; // Create a new instance of HttpClient to send HTTP requests HttpClient client = HttpClient.newHttpClient(); // Build an HTTP POST request with headers and a body HttpRequest request = HttpRequest.newBuilder() .uri(URI.create(apiUrl)) // Set the API endpoint URL .header("Content-Type", "application/json") // Specify JSON content type .header("Validation-token", token) // Include the API token in the headers .POST(HttpRequest.BodyPublishers.ofString(requestBody)) // Add the JSON body to the POST request .build(); try { // Send the request and get the response HttpResponseresponse = client.send(request, HttpResponse.BodyHandlers.ofString()); // Print the status code of the response System.out.println("Response Code: " + response.statusCode()); // Print the response body (e.g., validation result) System.out.println("Response Body: " + response.body()); } catch (Exception e) { // Handle any exceptions that occur during the request e.printStackTrace(); } } }
// Import the Axios library, which simplifies HTTP requests const axios = require('axios'); // Your unique validation key provided by Chinguisoft const validationKey = 'your_validation_key'; // The API token required for authorization const token = 'your_validation_token'; // Request data containing the phone number and language preference const requestData = { phone: '44800028', // The phone number to validate lang: 'ar' // Language preference for the SMS }; // Send a POST request to the Chinguisoft validation API axios.post(`https://chinguisoft.com/api/sms/validation/${validationKey}`, requestData, { headers: { 'Validation-token': token, // Include the API token for authorization 'Content-Type': 'application/json' // Specify that the request body is in JSON format } }) .then(response => { // Handle a successful response console.log('Success:', response.data); // Log the response data }) .catch(error => { // Handle errors during the request if (error.response) { // Log the error response returned by the server console.log('Error:', error.response.data); } else { // Log any other errors, such as network issues console.error('Request failed:', error.message); } });
import 'dart:convert'; import 'package:http/http.dart' as http; void main() async { // Define your unique validation key provided by Chinguisoft final validationKey = 'your_validation_key'; // Define your unique API token required for authorization final token = 'your_validation_token'; // Construct the API endpoint URL with the validation key final url = Uri.parse('https://chinguisoft.com/api/sms/validation/\$validationKey'); // Set up the request headers, including the API token and content type final headers = { 'Validation-token': token, // Authorization header 'Content-Type': 'application/json', // Specify JSON content type }; // Define the body of the POST request as a JSON object final body = jsonEncode({ 'phone': '44800028', // The phone number to validate 'lang': 'ar', // The preferred language for the SMS }); try { // Send the POST request asynchronously final response = await http.post(url, headers: headers, body: body); // Check if the request was successful if (response.statusCode == 200) { // Print the response body if the request was successful print('Success: \${response.body}'); } else { // Print the error details if the request failed print('Error: \${response.statusCode} - \${response.body}'); } } catch (e) { // Handle exceptions, such as network errors print('Request failed: \$e'); } }
validation_key
and Validation-token
safe to prevent unauthorized use.503
gracefully and implement retries if needed.For questions, assistance, or to get your Validation Key, Validation token, or to Increase your balance, please contact us here.
Thank you for choosing Chinguisoft!