الأجهزة
الجهاز هاتف Android يعمل عليه تطبيق SMSFabric ومقترن بمؤسستك. يبلّغ كل جهاز عن شرائحه، وتُرسل الرسائل من جهاز وشريحة. انظر إرسال الرسائل لمعرفة كيف يُختار الجهاز.
كائن الجهاز
Section titled “كائن الجهاز”| الحقل | النوع | الوصف |
|---|---|---|
id |
string | dev_… |
name |
string | الاسم الذي اخترته للهاتف. |
status |
string | online أو offline أو disabled. يُعد الهاتف متصلا ما دام أبلغ خلال آخر دقيقتين. |
enabled |
boolean | false إذا عطلته أنت أو SMSFabric. الهواتف المعطلة لا تستلم رسائل. |
poolId |
string أو null | المجموعة التي ينتمي إليها. |
model وmanufacturer وos وosVersion وappVersion |
string أو null | يبلّغ عنها التطبيق. |
battery |
number أو null | من 0 إلى 100. |
charging |
boolean أو null | |
signal |
number أو null | من 0 إلى 4 أشرطة. |
network |
string أو null | wifi أو lte أو 5g أو 3g أو 2g أو none. |
lastSeenAt |
string أو null | آخر إبلاغ. |
createdAt |
string | وقت الإقران. |
sims |
SIM[] | شرائحه مرتبة حسب المنفذ. |
كائن الشريحة:
| الحقل | النوع | الوصف |
|---|---|---|
id |
string | sim_… |
slot |
integer | المنفذ الفعلي، بدءا من 0. |
subscriptionId |
integer | معرّف الاشتراك في Android. |
iccidLast4 |
string أو null | آخر 4 أرقام من ICCID. |
carrier |
string أو null | اسم شركة الاتصالات. |
number |
string أو null | رقم الشريحة إذا كان الهاتف يعرفه. |
isEsim |
boolean | |
enabled |
boolean | الشرائح المعطلة لا تُستخدم أبدا. |
dailyLimit |
integer أو null | الحد الأقصى للرسائل يوميا من هذه الشريحة. null تعني بلا حد. |
label |
string أو null | تسميتك. |
isDefault |
boolean | شريحة الإرسال الافتراضية للمؤسسة. |
إنشاء رمز إقران
Section titled “إنشاء رمز إقران”/v1/devices/pairing-tokensdevices:manageينشئ رمزا لمرة واحدة لإقران هاتف، صالحا 10 دقائق. اعرض qrPayload كرمز QR يمسحه التطبيق، أو أدخل الرمز يدويا. يدعم Idempotency-Key. يُسجل في التدقيق باسم device.pairing_token_created. انظر إقران هاتف.
curl -X POST https://api.smsfabric.com/v1/devices/pairing-tokens \ -H "X-Api-Key: $SMSFABRIC_API_KEY"{ "token": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "qrPayload": "smsfabric://pair?server=https%3A%2F%2Fapi.smsfabric.com&token=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "expiresAt": "2026-11-19T10:25:00.000Z"}عرض الأجهزة
Section titled “عرض الأجهزة”/v1/devicesdevices:readيعيد كل الهواتف المقترنة من الأقدم إلى الأحدث في صفحة واحدة (nextCursor: null).
curl https://api.smsfabric.com/v1/devices \ -H "X-Api-Key: $SMSFABRIC_API_KEY"{ "data": [ { "id": "dev_m4p7s2v5y8b1e4h7k0n3q6t9", "name": "Pixel 8 · front desk", "status": "online", "enabled": true, "poolId": "pool_c6f9j2m5p8s1v4y7b0e3h6k9", "model": "Pixel 8", "manufacturer": "Google", "os": "android", "osVersion": "15", "battery": 86, "charging": true, "signal": 4, "network": "wifi", "appVersion": "1.4.0", "lastSeenAt": "2026-11-19T10:14:51.000Z", "createdAt": "2026-10-02T08:40:12.000Z", "sims": [ { "id": "sim_r2t4v6x8z1b3d5f7h9j2l4n6", "slot": 0, "subscriptionId": 1, "iccidLast4": "4417", "carrier": "Vodafone EG", "number": "+201009876543", "isEsim": false, "enabled": true, "dailyLimit": 500, "label": "Support line", "isDefault": true } ] } ], "nextCursor": null}قراءة جهاز
Section titled “قراءة جهاز”/v1/devices/:iddevices:readيعيد جهازا واحدا مع شرائحه، أو 404 not_found إذا لم يكن مقترنا بمؤسستك.
curl https://api.smsfabric.com/v1/devices/dev_m4p7s2v5y8b1e4h7k0n3q6t9 \ -H "X-Api-Key: $SMSFABRIC_API_KEY"الاستجابة كائن جهاز كما في عرض الأجهزة.
تحديث جهاز
Section titled “تحديث جهاز”/v1/devices/:iddevices:manageيعيد تسمية الهاتف أو يعطله أو ينقله. يُسجل في التدقيق باسم device.updated. يعيد الجهاز.
| حقل المحتوى | النوع | إلزامي | الوصف | القيود |
|---|---|---|---|---|
name |
string | لا | الاسم المعروض. | من 1 إلى 120 حرفا. |
enabled |
boolean | لا | false يوقف الرسائل الجديدة إلى هذا الهاتف. |
|
poolId |
string أو null | لا | انضم إلى هذه المجموعة، وnull يغادر المجموعة الحالية. |
يجب أن تتبع مؤسستك. |
curl -X PATCH https://api.smsfabric.com/v1/devices/dev_m4p7s2v5y8b1e4h7k0n3q6t9 \ -H "X-Api-Key: $SMSFABRIC_API_KEY" \ -H "Content-Type: application/json" \ -d '{"name": "Pixel 8 · warehouse", "poolId": "pool_c6f9j2m5p8s1v4y7b0e3h6k9"}'| الخطأ | متى |
|---|---|
404 not_found |
الجهاز أو المجموعة لا يتبع مؤسستك. |
فصل جهاز
Section titled “فصل جهاز”/v1/devices/:iddevices:manageيزيل الهاتف من مؤسستك ويلغي رمزه، فيتوقف التطبيق على الهاتف عن الإرسال. تنتقل الرسائل التي تنتظر الهاتف ولم يأخذها بعد إلى هاتف آخر متصل في مجموعته، وتفشل البقية مع errorCode: "device_unpaired". يعيد 204. يُسجل في التدقيق باسم device.unpaired.
ويفعل تطبيق الهاتف الشيء نفسه عند إلغاء الاقتران من الإعدادات فيه، عبر واجهة الأجهزة (POST /device/v1/unpair).
curl -X DELETE https://api.smsfabric.com/v1/devices/dev_m4p7s2v5y8b1e4h7k0n3q6t9 \ -H "X-Api-Key: $SMSFABRIC_API_KEY"تحديث شريحة
Section titled “تحديث شريحة”/v1/devices/:id/sims/:simIddevices:manageيغيّر إعدادات شريحة واحدة ويعيدها.
| حقل المحتوى | النوع | إلزامي | الوصف | القيود |
|---|---|---|---|---|
enabled |
boolean | لا | false يوقف الإرسال من هذه الشريحة. |
|
dailyLimit |
integer أو null | لا | الحد الأقصى للرسائل يوميا، وnull يزيل الحد. |
من 0 إلى 100000. |
label |
string أو null | لا | تسميتك. | حتى 80 حرفا. |
curl -X PATCH https://api.smsfabric.com/v1/devices/dev_m4p7s2v5y8b1e4h7k0n3q6t9/sims/sim_r2t4v6x8z1b3d5f7h9j2l4n6 \ -H "X-Api-Key: $SMSFABRIC_API_KEY" \ -H "Content-Type: application/json" \ -d '{"dailyLimit": 300, "label": "Marketing"}'{ "id": "sim_r2t4v6x8z1b3d5f7h9j2l4n6", "slot": 0, "subscriptionId": 1, "iccidLast4": "4417", "carrier": "Vodafone EG", "number": "+201009876543", "isEsim": false, "enabled": true, "dailyLimit": 300, "label": "Marketing", "isDefault": true}ضبط الشريحة الافتراضية
Section titled “ضبط الشريحة الافتراضية”/v1/devices/:id/sims/:simId/defaultdevices:manageيجعل هذه الشريحة الافتراضية للمؤسسة للرسائل المرسلة دون deviceId أو simId أو poolId. يعيد 200 مع الشريحة (isDefault: true).
curl -X POST https://api.smsfabric.com/v1/devices/dev_m4p7s2v5y8b1e4h7k0n3q6t9/sims/sim_r2t4v6x8z1b3d5f7h9j2l4n6/default \ -H "X-Api-Key: $SMSFABRIC_API_KEY"| الخطأ | متى |
|---|---|
404 not_found |
الجهاز أو الشريحة لا يتبع مؤسستك. |