Skip to main content

Get Recipients Count

This API allows you to retrieve the count of recipients based on various filters such as birth year, province, county, city

📍 Endpoint

GET {base_url}/api/send/banks/counts

🧾 Headers

KeyValue
AuthorizationYOUR_TOKEN_HERE
Content-Typeapplication/json

📝 Parameters

ParameterTypeRequiredDescription
birth_year_fromintegerNoThe minimum birth year of the recipients (default: 1300)
birth_year_tointegerNoThe maximum birth year of the recipients (default: 1410)
province_idintegerYesThe ID of the province to filter recipients
county_idintegerYesThe ID of the county to filter recipients
city_idintegerYesThe ID of the city to filter recipients
gender_idintegerNoThe ID of the gender to filter recipients (1 for male, 2 for female)
number_prefixstringNoThe prefix of the phone numbers to filter recipients

✅ Success Response

{
"data": {
"mci_count": 256171,
"irancell_count": 134380,
"other_count": 10425
},
"meta": {
"status": true,
"message": "count",
"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": "گزینه انتخاب شده county id صحیح نمی باشد",
"message_parameters": [],
"message_code": "400-2",
"errors": {
"county_id": [
"گزینه انتخاب شده county id صحیح نمی باشد"
]
}
}
}

🧪 Example Request

curl --location '{base_url}/api/send/banks/counts' \
--header 'Content-Type: application/json' \
--header 'Authorization: API TOKEN' '