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": "geolocation",
"from_number": "+98BANK",
"message": "تست",
"params": [
{
"province_id": 1,
"county_id": 2,
"city_id": 5,
"pre": "912",
"gender" : 2,
"from_age" : 1354,
"to_age": 1364,
"operator": [
{
"start": 0,
"size": 10,
"id": 1
},
{
"start": 0,
"size": 20,
"id": 2
}
]
}
],
"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
province_idintegerNOID 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
preintegerNOPrefix number to filter recipients (e.g., 938)
genderintegerNOGender of recipients (1 for male, 2 for female)
from_ageintegerNOMinimum birth year of recipients (e.g., 1330), must be between 1300 to 1410
to_ageintegerNOMaximum birth year of recipients (e.g., 1401), must be between 1300 to 1410
operatorarrayNOArray of target operators
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 --globoff '{base_url}/api/send' \
--header 'Content-Type: application/json' \
--header 'Authorization: API TOKEN' \
--data '{
"sending_type": "geolocation",
"from_number": "+98BANK",
"message": "تست",
"params": [
{
"province_id": 1,
"county_id": 2,
"city_id": 5,
"pre": "912",
"gender" : 2,
"from_age" : 1354,
"to_age": 1364,
"operator": [
{
"start": 0,
"size": 10,
"id": 1
},
{
"start": 0,
"size": 20,
"id": 2
}
]
}
],
"other_recipients": [
"+989121111111",
"+989351111111"
]
}'