مجموعات جهات الاتصال
المجموعة قائمة ثابتة: تنضم إليها جهات الاتصال وتغادرها فقط عبر نقاط النهاية هذه، أو عبر groupIds عند إنشاء جهة اتصال، أو عبر groupId في الاستيراد. تستهدف الحملات المجموعات عبر groupIds.
كائن المجموعة
Section titled “كائن المجموعة”| الحقل | النوع | الوصف |
|---|---|---|
id |
string | grp_… |
name |
string | فريد داخل مؤسستك. |
description |
string أو null | |
memberCount |
integer | عدد جهات الاتصال في المجموعة. |
createdAt وupdatedAt |
string |
عرض المجموعات
Section titled “عرض المجموعات”GET
/v1/contact-groupscontacts:read| الاستعلام | النوع | الوصف |
|---|---|---|
q |
string | نص يرد في الاسم. |
limit |
integer | من 1 إلى 200، والافتراضي 50. |
cursor |
string | nextCursor من الصفحة السابقة. |
curl https://api.smsfabric.com/v1/contact-groups \ -H "X-Api-Key: $SMSFABRIC_API_KEY"{ "data": [ { "id": "grp_t6w9z2c5f8i1l4o7r0u3x6a9", "name": "Newsletter", "description": "Signed up on the website", "memberCount": 4210, "createdAt": "2026-09-14T12:00:00.000Z", "updatedAt": "2026-11-18T16:22:10.000Z" } ], "nextCursor": null}إنشاء مجموعة
Section titled “إنشاء مجموعة”POST
/v1/contact-groupscontacts:manageيعيد 201 مع المجموعة. يدعم Idempotency-Key.
| حقل المحتوى | النوع | إلزامي | القيود |
|---|---|---|---|
name |
string | نعم | من 1 إلى 120 حرفا، فريد. |
description |
string | لا | حتى 500 حرف. |
curl https://api.smsfabric.com/v1/contact-groups \ -H "X-Api-Key: $SMSFABRIC_API_KEY" \ -H "Content-Type: application/json" \ -d '{"name": "Newsletter", "description": "Signed up on the website"}'| الخطأ | متى |
|---|---|
409 group_exists |
توجد مجموعة بهذا الاسم. |
قراءة مجموعة
Section titled “قراءة مجموعة”GET
/v1/contact-groups/:idcontacts:readcurl https://api.smsfabric.com/v1/contact-groups/grp_t6w9z2c5f8i1l4o7r0u3x6a9 \ -H "X-Api-Key: $SMSFABRIC_API_KEY"يعيد المجموعة. اعرض أعضاءها عبر GET /v1/contacts?groupId=grp_….
تحديث مجموعة
Section titled “تحديث مجموعة”PATCH
/v1/contact-groups/:idcontacts:manageيقبل name وdescription، وكلاهما اختياري بقيود الإنشاء نفسها. يعيد المجموعة، أو 409 group_exists عند تكرار الاسم.
curl -X PATCH https://api.smsfabric.com/v1/contact-groups/grp_t6w9z2c5f8i1l4o7r0u3x6a9 \ -H "X-Api-Key: $SMSFABRIC_API_KEY" \ -H "Content-Type: application/json" \ -d '{"description": "Website sign-ups since September"}'حذف مجموعة
Section titled “حذف مجموعة”DELETE
/v1/contact-groups/:idcontacts:manageيحذف المجموعة وتبقى جهات الاتصال. يعيد 204.
curl -X DELETE https://api.smsfabric.com/v1/contact-groups/grp_t6w9z2c5f8i1l4o7r0u3x6a9 \ -H "X-Api-Key: $SMSFABRIC_API_KEY"إضافة أعضاء
Section titled “إضافة أعضاء”POST
/v1/contact-groups/:id/memberscontacts:manageيضيف حتى 1000 جهة اتصال. تُتجاهل جهات الاتصال الموجودة في المجموعة أصلا. المعرّفات التي لا تخص جهات اتصال في مؤسستك تُحتسب في notFound ولا تُربط أبدا. يعيد 200.
| حقل المحتوى | النوع | إلزامي | القيود |
|---|---|---|---|
contactIds |
string[] | نعم | من 1 إلى 1000 معرّف غير مكرر. |
curl https://api.smsfabric.com/v1/contact-groups/grp_t6w9z2c5f8i1l4o7r0u3x6a9/members \ -H "X-Api-Key: $SMSFABRIC_API_KEY" \ -H "Content-Type: application/json" \ -d '{"contactIds": ["con_a8d1g4j7m0p3s6v9y2b5e8h1", "con_b9e2h5k8n1q4t7w0z3c6f9i2"]}'{ "changed": 2, "notFound": 0, "memberCount": 4212 }إزالة أعضاء
Section titled “إزالة أعضاء”POST
/v1/contact-groups/:id/members/removecontacts:manageالمحتوى والاستجابة نفسها كما في إضافة الأعضاء، ويحسب changed جهات الاتصال التي أُزيلت.
curl https://api.smsfabric.com/v1/contact-groups/grp_t6w9z2c5f8i1l4o7r0u3x6a9/members/remove \ -H "X-Api-Key: $SMSFABRIC_API_KEY" \ -H "Content-Type: application/json" \ -d '{"contactIds": ["con_b9e2h5k8n1q4t7w0z3c6f9i2"]}'{ "changed": 1, "notFound": 0, "memberCount": 4211 }