SMS Templates
SMS templates allow you to send plain text messages via SMPP.
Creating an SMS Template
curl -X POST https://api.transformify.mk/api/v1/templates/sms \
-H "X-API-Key: your-api-key" \
-H "Content-Type: application/json" \
-d '{
"name": "Order Confirmation SMS",
"description": "Sent when order is placed",
"templateContent": "Your order #{{orderId}} is confirmed. Total: ${{total}}. Track at: {{trackingUrl}}",
"smsSenderId": 42
}'
Parameters
| Field | Type | Required | Description |
|---|---|---|---|
| name | string | Yes | Template name |
| description | string | No | Template description (max 500 chars) |
| templateContent | string | Yes | Message text (max 1600 chars) |
| smsSenderId | integer | No | An approved SMS Sender ID belonging to your company |
Choosing an SMS Sender
Use GET /api/v1/sms-senders to list your approved SMS senders. The smsSenderId you set on the template will be used as the sender for all campaigns created from it.
Response
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "Order Confirmation SMS",
"description": "Sent when order is placed",
"messageType": 1,
"channelType": "Smpp",
"templateContent": "Your order #{{orderId}} is confirmed. Total: ${{total}}. Track at: {{trackingUrl}}",
"smsSenderId": 42,
"createdAt": "2024-01-15T10:30:00Z",
"updatedAt": "2024-01-15T10:30:00Z"
}
Limitations
| Constraint | Value |
|---|---|
| Maximum length | 1600 characters |
| Supported content | Text only (no media) |
| Character encoding | GSM-7 or Unicode |
Template Examples
OTP/Verification
{
"name": "OTP Code",
"templateContent": "Your verification code is {{code}}. Valid for {{expiry}} minutes. Do not share."
}
Order Confirmation
{
"name": "Order Placed",
"templateContent": "Thanks for your order #{{orderId}}! Total: ${{total}}. Delivery: {{deliveryDate}}."
}
Appointment Reminder
{
"name": "Appointment Reminder",
"templateContent": "Reminder: Appointment on {{date}} at {{time}}. Reply YES to confirm or call {{phone}} to reschedule."
}
Delivery Update
{
"name": "Out for Delivery",
"templateContent": "Your package is out for delivery! Expected arrival: {{timeWindow}}. Track: {{url}}"
}
Alert/Notification
{
"name": "Account Alert",
"templateContent": "Alert: {{action}} on your account at {{time}}. If not you, call {{phone}} immediately."
}
Using SMS Templates
Send Single Message
curl -X POST https://api.transformify.mk/api/v1/sms/promotional \
-H "X-API-Key: your-api-key" \
-H "Content-Type: application/json" \
-d '{
"templateId": "sms-template-id",
"recipients": [
{ "phoneNumber": "38970123456" }
],
"placeholders": {
"orderId": "12345",
"total": "99.99",
"deliveryDate": "Tomorrow"
}
}'
Send Bulk SMS
curl -X POST https://api.transformify.mk/api/v1/sms/promotional \
-H "X-API-Key: your-api-key" \
-H "Content-Type: application/json" \
-d '{
"templateId": "sms-template-id",
"recipients": [
{ "phoneNumber": "38970111111" },
{ "phoneNumber": "38970222222" },
{ "phoneNumber": "38970333333" }
],
"placeholders": {
"message": "Flash sale today! 20% off everything."
}
}'
SMS vs Viber
| Factor | SMS | Viber |
|---|---|---|
| Reach | Universal | Viber users only |
| Content | Text only | Rich media |
| Cost | Higher | Lower |
| Delivery | Works offline | Requires internet |
| Interactivity | Limited | Buttons, surveys |
When to use SMS:
- OTP/verification codes (reliability critical)
- Users without Viber
- Simple notifications
- Fallback for failed Viber messages
When to use Viber:
- Marketing with images
- Interactive content
- Cost optimization
- Rich notifications
Best Practices
- Keep it short - Aim for under 160 characters when possible
- Avoid Unicode - Use standard characters to reduce costs
- Include opt-out - Add "Reply STOP to unsubscribe" for marketing
- Identify yourself - Start with your brand name
- Be clear - SMS has no formatting, so be concise
- Test segment count - Preview messages to check length