Ottieni messaggi in sospeso
Guida all'integrazione dell'app mobile
Ottieni messaggi in sospeso
Restituisce un batch di messaggi dalla coda in uscita pronti per essere inviati. L'API richiede atomicamente i messaggi restituiti (stato -> processing).
Parametri di query
| Campo | Tipo | Descrizione | |
|---|---|---|---|
| limit | integer | opzionale | Numero massimo di messaggi da restituire (1-100, predefinito 50). |
| channel | string | opzionale | Filtra per canale: sms o whatsapp. Ometti per tutti. |
I messaggi assegnati a questo dispositivo vengono restituiti per primi, seguiti dai messaggi non assegnati.
Esempio di richiesta
cURL
curl "https://api.rcszilla.com/?endpoint=pending_messages&limit=10&channel=sms" \ -H "Authorization: Bearer YOUR-DEVICE-TOKEN"
Risposta
JSON200 OK
{
"success": true,
"count": 2,
"messages": [
{
"id": 101,
"user_id": 1,
"contact_id": 55,
"campaign_id": null,
"device_id": 7,
"sim_slot": 0,
"channel": "sms",
"phone": "+40712345678",
"message": "Hello from SMS Manager!",
"priority": 1,
"scheduled_at": null,
"created_at": "2026-04-29 10:00:00"
},
{
"id": 102,
"user_id": 1,
"contact_id": 56,
"campaign_id": 3,
"device_id": null,
"sim_slot": 1,
"channel": "sms",
"phone": "+40799999999",
"message": "Campaign message body here.",
"priority": 1,
"scheduled_at": null,
"created_at": "2026-04-29 10:00:05"
}
]
}
Message Fields
| Campo | Tipo | Descrizione |
|---|---|---|
| id | integer | Unique queue item ID. Pass to all mark_* endpoints. |
| channel | string | sms or whatsapp |
| phone | string | Recipient phone number. |
| message | string | Message body text. |
| sim_slot | integer | 0 = SIM 1, 1 = SIM 2, null = any. |
| device_id | integer|null | Device this message is assigned to (null = any device). |
| campaign_id | integer|null | Campaign this message belongs to, or null for direct messages. |
| priority | integer | Lower number = higher priority. Sorted ascending. |
| scheduled_at | datetime|null | Only returned when scheduled_at �NOW(). |
Prefer using
poll instead �it returns pending messages together with commands and config in a single request, reducing round trips.