Global Celular Gateway API Documentation
Send and receive text messages with just a few lines of code on Messaging, the trusted platform for cross-channel messaging.
Below are the endpoints for accessing Celular Gatewway. Learn how to integrate the API into your application.
Authorization:
- privateId *Specify privateId for site
(e.g., "Bearer example^com-SomeIdString").
Query Parameters:
- type Specify type of SMS
for Transactional OTP (e.g., type:"OTP").
for Promotional Bulk (e.g., type:"TMP").
for Informational personalized (e.g., type:"CXT").
Body Parameters:
- CC Specify which rates to show
(e.g., "US"|"IN"|"DE"). - cellId Specify array of contact number
(e.g., ["+91" + "99876543210"]). - :data Specify the mail OTP|TMP|CXT string
for Transactional OTP (e.g., OTP:"000000").
for Promotional Bulk (e.g., TMP:"sms-id-here").
for Informational personalized (e.g., CXT:"sms-here").
Route Parameters:
- :region *Please check location table here
(e.g., "WEST_3|ARAB_1|EAST_3|NORD_6").
Response based on params:
{
"success": true,
"info": "SMS OTP Sent!"
}This endpoint provides the text for sending celular sms.
<?php
function fetchData() {
// API configuration
$baseUrl = 'https://textpress.api.koirang.com/v1/:region';
$params = array(
'region' => 'YOUR_REGION' // Replace with actual region value
);
$headers = array(
'Content-Type: application/json',
'Authorization: Bearer <privateId>'
);
$queryParams = {"mailId":"example@domain.com","OTP":"000000"};
try {
// Build URL
$url = $baseUrl;
foreach (["region"] as $param) {
$url .= '/' . urlencode($params[$param]);
}
$url .= '?' . http_build_query($queryParams);
// Initialize cURL
$ch = curl_init();
// Set cURL options
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
if ('GET' === 'POST' || 'GET' === 'PUT') {
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode({"type":"OTP"}));
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');
}
// Execute request
$response = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
// Check for errors
if ($httpCode >= 400) {
throw new Exception("HTTP Error: " . $httpCode);
}
curl_close($ch);
return json_decode($response, true);
} catch (Exception $e) {
echo "Error: " . $e->getMessage();
return null;
}
}
// Example usage
$result = fetchData();
echo json_encode($result, JSON_PRETTY_PRINT);