Home › Send SMS
Send SMS with Variables — FarazSMS SMS web service
POST https://api.iranpayamak.com/ws/v1/sms/keywords
Purpose: Bulk personalized send; variables (e.g. the contact's name) sit inside `%...%` in the text.
Send a message containing variable keywords. The keywords (attributes) must be wrapped inside % signs within the text (E.g: Hello %first_name%)
Authentication
This endpoint requires the Api-Key header — get the key from the FarazSMS panel. The header name is case-sensitive and the key must never travel in a query string.
Request fields
text(string) — requiredline_number(string) — requiredrecipients(array) — requirednumber_format(string) — optional
Notes for this endpoint
- Wrap variables in % inside the text (e.g. Hi %first_name%).
- Values come from contact/phonebook attributes.
- No +98; set number_format correctly.
Example body
{
"text": "test %var1% text",
"line_number": "50002178584000",
"recipients": [
{
"mobile": "09120000000",
"var1": "value1"
},
{
"mobile": "09130000000",
"var1": "value2"
}
],
"number_format": "english"
}
Responses
201— SMS request is enqueued successfully.
Related endpoints in Send SMS
POST /ws/v1/sms/pattern— Send Pattern-Based SMSPOST /ws/v1/sms/simple— Send Simple SMSPOST /ws/v1/lbs— Create New LBS RequestGET /ws/v1/lbs— Get LBS Requests ListPUT /ws/v1/lbs/{lbsId}— Edit LBS RequestGET /ws/v1/lbs/{lbsId}— Show Single LBS Request DetailsPATCH /ws/v1/lbs/{lbsId}/cancel— Cancel LBS RequestPOST /ws/v1/sms/bank— Send to Number Bank