Integrate SMS into your website, mobile application, SaaS platform, or business system using the Textplate REST API. Send OTPs, alerts, appointment reminders, notifications, and other transactional SMS programmatically.
POST https://api.textplate.in/v1/send-sms
Send SMS requests to the Textplate API using the endpoint above. Include API authentication and the required parameters in each POST request.
Authorization: Bearer YOUR_API_TOKEN
Textplate API requests use Bearer token authentication. Add your API token to the Authorization header of every request. Find your API token in the API Keys section of your Textplate account.
"mobileNumber", "templateId", "otpValue", "expiryValue", "detailValue"
i) The mobileNumber parameter specifies the recipient's mobile number. Use the Indian mobile number format with the +91 country code. You can send SMS to multiple mobile numbers by providing comma-separated numbers.
Example: "mobileNumber" : "+919100091000"
Example: "mobileNumber" : "+919100091000, +918100081000, +917100071000, +916100061000, ..."
ii) The templateId parameter identifies the built-in DLT SMS template used for the message. Select the appropriate template ID from the templates available in your Textplate account.
Example: "templateId" : "106db76a751b36cc5cbf132bc5a8edd30a1531ea"
iii) For OTP templates, use otpValue and expiryValue parameters to provide the OTP and its expiry information. The otpValue parameter accepts a numeric OTP with a maximum length of 10 digits. The expiryValue parameter accepts the OTP expiry information with a maximum length of 15 characters.
Example: "otpValue" : "910910"
Example: "expiryValue" : "10 minutes"
iv) For non-OTP templates, use detailValue parameter to provide the dynamic information required by the template. The detailValue parameter supports a maximum length of 30 characters.
Example: "detailValue" : "ABC Detail"
var fetch = require("request");
var url = "https://api.textplate.in/v1/send-sms";
var head = {
"Authorization" : "Bearer YOUR_API_TOKEN" // Copy from Textplate API keys
};
var form = {
"mobileNumber" : "YOUR_MOBILE_NUMBER", // +91XXXXXXXXXX, multiple allowed with comma (,)
"templateId" : "YOUR_TEMPLATE_ID", // Select from Textplate approved templates
"otpValue" : "YOUR_OTP_VALUE", // OTP templates only, max 10 digits
"expiryValue" : "YOUR_EXPIRY_VALUE", // OTP templates only, max 15 chars
"detailValue" : "YOUR_DETAIL_VALUE" // Non-OTP templates, max 30 chars
};
var option = {
method : "POST",
url : url,
headers : head,
formData : form
};
fetch(option, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
Textplate returns a response after processing your API request. Use the response to determine whether the SMS request was accepted and handle the result in your application.
Create a Textplate account today and get started with 7 days of free access and 20 SMS credits, with no upfront payment or commitment required. Explore the dashboard, test SMS delivery, try built-in DLT templates, and integrate SMS into a website, application, or business system.
7 days free access • 20 SMS credits included • No payment required
Contact: 303 R.P. Business Park, Hyderabad, IN - 500008 • Email: support@textplate.in