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.
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.util.HashMap;
import java.util.Map;
import com.fasterxml.jackson.databind.ObjectMapper;
public class ApiClient {
private static final String BASE_URL = "https://textpress.api.koirang.com/v1/:region";
private static final String PRIVATE_ID = "<privateId>";
public static void main(String[] args) {
try {
String result = fetchData();
System.out.println(result);
} catch (Exception e) {
e.printStackTrace();
}
}
private static String fetchData() throws Exception {
// Create HTTP client
HttpClient client = HttpClient.newHttpClient();
ObjectMapper mapper = new ObjectMapper();
// Build URL
Map<String, String> params = new HashMap<>();
params.put("region", "YOUR_REGION"); // Replace with actual region value
StringBuilder urlBuilder = new StringBuilder(BASE_URL);
["region"].forEach(param ->
urlBuilder.append("/").append(params.get(param))
);
// Add query parameters
Map<String, String> queryParams = {"mailId":"example@domain.com","OTP":"000000"};
urlBuilder.append("?");
queryParams.forEach((key, value) ->
urlBuilder.append(key).append("=").append(value).append("&")
);
// Create request
HttpRequest.Builder requestBuilder = HttpRequest.newBuilder()
.uri(URI.create(urlBuilder.toString()))
.header("Content-Type", "application/json")
.header("Authorization", "Bearer " + PRIVATE_ID);
if ("GET".equals("POST") || "GET".equals("PUT")) {
requestBuilder.method("GET",
HttpRequest.BodyPublishers.ofString(
mapper.writeValueAsString({"type":"OTP"})
)
);
} else {
requestBuilder.method("GET", HttpRequest.BodyPublishers.noBody());
}
// Send request
HttpResponse<String> response = client.send(
requestBuilder.build(),
HttpResponse.BodyHandlers.ofString()
);
if (response.statusCode() >= 400) {
throw new RuntimeException("HTTP error! status: " + response.statusCode());
}
return response.body();
}
}