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.
using System;
using System.Net.Http;
using System.Text;
using System.Text.Json;
using System.Threading.Tasks;
public class ApiClient
{
private static readonly string BaseUrl = "https://textpress.api.koirang.com/v1/:region";
private static readonly string PrivateId = "<privateId>";
static async Task Main(string[] args)
{
try
{
var result = await FetchDataAsync();
Console.WriteLine(JsonSerializer.Serialize(result, new JsonSerializerOptions
{
WriteIndented = true
}));
}
catch (Exception ex)
{
Console.WriteLine($"Error: {ex.Message}");
}
}
private static async Task<object> FetchDataAsync()
{
using var client = new HttpClient();
// Build URL
var parameters = new Dictionary<string, string>
{
{ "region", "YOUR_REGION" } // Replace with actual region value
};
var urlBuilder = new StringBuilder(BaseUrl);
foreach (var param in ["region"])
{
urlBuilder.Append($"/{Uri.EscapeDataString(parameters[param])}");
}
// Add query parameters
var queryParams = {"mailId":"example@domain.com","OTP":"000000"};
urlBuilder.Append("?");
foreach (var param in queryParams)
{
urlBuilder.Append($"{param.Key}={Uri.EscapeDataString(param.Value)}&");
}
// Set headers
client.DefaultRequestHeaders.Add("Authorization", $"Bearer {PrivateId}");
// Create request
var request = new HttpRequestMessage(new HttpMethod("GET"), urlBuilder.ToString());
if ("GET" == "POST" || "GET" == "PUT")
{
var content = JsonSerializer.Serialize({"type":"OTP"});
request.Content = new StringContent(content, Encoding.UTF8, "application/json");
}
// Send request
var response = await client.SendAsync(request);
if (!response.IsSuccessStatusCode)
{
throw new HttpRequestException($"HTTP error! status: {response.StatusCode}");
}
var responseContent = await response.Content.ReadAsStringAsync();
return JsonSerializer.Deserialize<object>(responseContent);
}
}