Înregistrați / Actualizați dispozitivul
Ghid de integrare aplicație mobilă
Înregistrați / Actualizați dispozitivul
Actualizează metadatele dispozitivului (numere de telefon, token FCM, flag dual-SIM) pe server. Apelați aceasta la fiecare lansare a aplicației pentru a menține panoul sincronizat.
Corp cerere
| Câmp | Tip | Descriere | |
|---|---|---|---|
| phone_number | string | opțional | SIM 1 phone number. Kept unchanged if omitted. |
| phone_number2 | string | opțional | SIM 2 phone number. Kept unchanged if omitted. |
| is_dual_sim | boolean | opțional | Dual-SIM flag. |
| fcm_token | string | opțional | Firebase Cloud Messaging token. Kept unchanged if omitted. |
Exemplu cerere
cURL
curl -X POST "https://api.rcszilla.com/?endpoint=register_device" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR-DEVICE-TOKEN" \
-d '{
"phone_number": "+40712345678",
"is_dual_sim": true,
"phone_number2": "+40798765432"
}'
Răspuns
JSON200 OK
{
"success": true,
"message": "Device registered.",
"device": {
"id": 7,
"name": "My Pixel 7",
"phone_number": "+40712345678",
"phone_number2": "+40798765432",
"is_dual_sim": "1",
"status": "active"
}
}