Skip to main content

Send Country SMS

This API allows you to send messages to all numbers in a specific province or county or city.

📍 Endpoint

POST {base_url}/api/send

🧾 Headers

KeyValue
AuthorizationYOUR_TOKEN_HERE
Content-Typeapplication/json

📤 Request Body

{
"sending_type": "country",
"from_number": "+98BANK",
"message": "تست",
"params": [
{
"bank": "all",
"pre": 938,
"province_id": 89,
"county_id": 212,
"city_id": 82,
"gender": 0,
"age_from": 1300,
"age_to": 1401,
"mci": {
"start": 10,
"size": 100
},
"irancell": {
"start": 1,
"size": 2
},
"other": {
"start": 2,
"size": 3
}
}
],
"other_recipients": [
"+989121111111",
"+989351111111"
]
}

📝 Parameters

ParameterTypeRequiredDescription
sending_typestringYesType of sending, must be "country" for this endpoint
from_numberstringYesSender's phone number in E.164 format (e.g., +98BANK)
messagestringYesMessage content to be sent to the recipients
paramsarrayYesArray of objects containing parameters for sending
bankstringYesBank number status "all" for all numbers or "white" for none blacklist
preintegerYesPrefix number to filter recipients (e.g., 938), must be between 2 to 6 digits
province_idintegerYesID of the province to target recipients, must be a valid ID from IPPanel
county_idintegerNOID of the county to target recipients, must be a valid ID from IPPanel
city_idintegerNOID of the city to target recipients, must be a valid ID from IPPanel
genderintegerYesGender of recipients (0 for all,1 for male, 2 for female)
age_fromintegerYesMinimum birth year of recipients (e.g., 1330), must be between 1300 to 1410
age_tointegerYesMaximum birth year of recipients (e.g., 1401), must be between 1300 to 1410
mciobjectYesMCI number range to filter recipients, with start and size
irancellobjectYesIrancell number range to filter recipients, with start and size
otherobjectYesOther number range to filter recipients, with start and size
other_recipientsarrayNoAdditional recipients to include, specified as an array of phone numbers in E.164 format

📝 Notes

  • The from_number must be a valid sender number assigned to your account.
  • The send_time is optional; if not provided, the message will be sent immediately.
  • The other_recipients array is optional and an array of phone numbers that will receive the message in addition to the province or county or city recipients.

✅ Success Response

{
"data": {
"message_outbox_ids": [
1123594208
]
},
"meta": {
"status": true,
"message": "انجام شد",
"message_parameters": [],
"message_code": "200-1"
}
}

❌ Error Response — Invalid or Expired Token (401)

{
"data": null,
"meta": {
"status": false,
"message": "اطلاعات وارد شده صحیح نمی باشد",
"message_parameters": [],
"message_code": "400-1",
"errors": {}
}
}

❌ Error Response — Invalid Request (422)

{
"data": null,
"meta": {
"status": false,
"message": "تکمیل گزینه پیام الزامی است",
"message_parameters": [],
"message_code": "400-2",
"errors": {
"message": [
"تکمیل گزینه پیام الزامی است"
]
}
}
}

🧪 Example Request

curl --location '{base_url}/api/send' \
--header 'Content-Type: application/json' \
--header 'Authorization: API TOKEN' \
--data '{
"sending_type": "country",
"from_number": "+98BANK",
"message": "تست",
"params": [
{
"bank": "all",
"pre": 938,
"province_id": 89,
"county_id": 212,
"city_id": 82,
"gender": 0,
"age_from": 1300,
"age_to": 1401,
"mci": {
"start": 10,
"size": 100
},
"irancell": {
"start": 1,
"size": 2
},
"other": {
"start": 2,
"size": 3
}
}
],
"other_recipients": [
"+989121111111",
"+989351111111"
]
}`