انتقل إلى المحتوى

واجهة برمجة تطبيقات الجمهور (Audience API)

bulkSetTags

Anchor link to

POST https://api.pushwoosh.com/api/v2/audience/bulkSetTags

يُعيّن قيم الوسوم لقائمة الأجهزة.

جسم الطلب

Anchor link to
الاسمالنوعالوصف
application*Stringرمز تطبيق Pushwoosh
auth*Stringرمز الوصول إلى API من لوحة تحكم Pushwoosh.
create_missing_tagsBooleanإذا كانت القيمة true، يتم إنشاء الوسوم المفقودة تلقائيًا.
devices*Objectمصفوفة من الأجهزة.
devices.hwidStringيمكن استخدامه لتعريف جهاز بدلاً من user_id أو push_token. اعرف المزيد
devices.user_idStringيمكن استخدامه لتعريف مستخدم بدلاً من hwid أو push_token. اعرف المزيد
devices.push_tokenStringيمكن استخدامه لتعريف جهاز بدلاً من hwid أو user_id. اعرف المزيد
devices.list_operatorStringيحدد كيفية تعيين قيم للوسوم من نوع القائمة: set، أو append، أو remove
devices.tags*Objectالقيم التي سيتم تعيينها للوسوم المحددة.
{
"request_id": "request_id to use in GET method to obtain job status",
"status": "Pending"
}
الطلب:
{
"application": "application code", // required. Pushwoosh app code
"auth": "Pushwoosh auth token", // required. API access token from Pushwoosh Control Panel
"create_missing_tags": false, // optional. Should automatically create missing tags
"devices": [{ // required. Array of devices
"hwid": "device hwid", // optional. Can be used to identify a device instead of
// "user_id" or "push_token".
"user_id": "user ID", // optional. Can be used to identify a user instead of "hwid" or "push_token".
"push_token": "device push token", // optional. Can be used to identify a device instead of "hwid" or "user_id".
"list_operator": "set", // required. For list tags. Defines how to set values for
// tags of the list type: set, append, or remove
"tags": { // required. Values to set for the tags specified.
"tag_name": "tagvalue", // use correct value type
"tag_name2": "tagvalue2"
}
}]
}
الاستجابة:
{
"request_id": "request_id to use in GET method to obtain job status",
"status": "Pending"
}

حالة bulkSetTags

Anchor link to

GET https://api.pushwoosh.com/api/v2/audience/bulkSetTags/{request_id}?detailed=false

يُرجع حالة عملية /bulkSetTags

معلمات المسار

Anchor link to
الاسمالنوعالوصف
request_idStringمعرف الطلب من استدعاء /bulkSetTags السابق

معلمات الاستعلام

Anchor link to
الاسمالنوعالوصف
detailedBoolean(true/false) ما إذا كان سيتم إرجاع معلومات مفصلة لكل جهاز
الاستجابة:
{
"request_id": "id of the request",
"status": "Completed", // also "Pending", "Failed"
"progress": 100, // jobs progress 0-100
"devices_success": 100, // good devices
"devices_not_found": 0, // devices not found in Pushwoosh
"devices_failed": 0, // errored
"devices": [{ // device report (only in detailed = true)
"hwid": "device hwid",
"status": "done", // also "failed", "not found"
"tags": {
"tagName": "ok",
"tagName2": "tag not found",
"tagName3": "wrong value. expect :string"
}
}]
}

bulkRegisterDevice

Anchor link to

يسجل أجهزة متعددة في Pushwoosh في طلب واحد. كما يسمح بتحديد وسوم متنوعة لكل جهاز.

POST https://api.pushwoosh.com/api/v2/audience/bulkRegisterDevice

معلمات جسم الطلب

Anchor link to
المعلمةالنوعمطلوبالوصف
applicationstringنعمرمز تطبيق Pushwoosh
authstringنعمرمز الوصول إلى API.
devicesarrayنعممصفوفة من كائنات الأجهزة. يمثل كل كائن جهازًا وبياناته المرتبطة به. انظر التفاصيل في جدول معلمات كائن الجهاز أدناه.

معلمات كائن الجهاز

Anchor link to
المعلمةالنوعمطلوبالوصف
hwidstringنعممعرف الجهاز (hardware ID) أو المعرف الفريد للجهاز.
push_tokenstringنعمرمز الدفع (Push token) للجهاز.
platformintegerنعممعرف المنصة. اعرف المزيد
list_operatorstringلايحدد الإجراء للوسوم من نوع القائمة:
- “append”: إضافة القيمة المحددة إلى قائمة الوسم.
- “remove”: إزالة القيمة المحددة من قائمة الوسم.
ملاحظة: إذا لم يتم تحديد معلمة list_operator، فسيتم استبدال جميع القيم الموجودة في قائمة الوسم بالقيم المقدمة.
tagsobjectلاالوسوم المخصصة المعينة للجهاز. الوسوم هي أزواج مفتاح-قيمة تستخدم للتقسيم.

مثال على الطلب

Anchor link to
{
"application": "application code", // required. Pushwoosh app code
"auth": "Pushwoosh auth token", // required. API access token from Pushwoosh Control Panel
"devices": [{ // required. Array of devices
"hwid": "device hwid", // required. Unique identifier for the device (can be an email).
"push_token": "device push token", // required. Push notification token for the device.
"platform": 14, // required. Device platform (e.g., 14 for email).
"list_operator": "append", // optional. For list tags. Adds or removes the specified value(s) from the tag of list type.
"tags": { // optional. Values to set for the specified tags.
"language": "en", // use correct value type.
"CSV_Import": "summer_camp"
}
},
{
"hwid": "device hwid 2", // required. Unique identifier for the second device.
"push_token": "device push token 2", // required. Push notification token for the device.
"platform": 14, // required. Device platform.
"list_operator": "remove", // optional. Adds or removes values from tags of the list type.
"tags": { // optional. Values to remove from the specified tags.
"language": "en",
"CSV_Import": "summer_camp2"
}
},
{
"hwid": "device hwid 3", // required. Unique identifier for the third device.
"push_token": "device push token 3", // required. Push notification token for the device.
"platform": 14, // required. Device platform.
"tags": { // optional. Values to set for the specified tags.
"language": "en",
"CSV_Import": "summer_camp3"
}
}]
}

الاستجابة

Anchor link to

تستجيب الطريقة بمعرف عملية، والذي يمكن استخدامه لتتبع حالة ونتائج عملية التسجيل الجماعي.

{
"request_id": "request_id to use in GET method to obtain job status",
"status": "Pending"
}

حالة bulkRegisterDevice

Anchor link to

يمكنك التحقق من حالة عملية التسجيل الجماعي عن طريق إجراء طلب GET التالي:

GET https://api.pushwoosh.com/api/v2/audience/bulkRegisterDevice/{request_id}?detailed=true

المعلمةالنوعمطلوبالوصف
request_idstringنعممعرف الطلب الذي تم إرجاعه بواسطة طلب POST.
detailedbooleanلاإذا تم تعيينه إلى true، فإن الاستجابة تتضمن نتائج مفصلة لكل جهاز مسجل.

مثال على الاستجابة

Anchor link to
{
"request_id": "9a2e1a14-XXXX-46c3-XXXX-c254b25d3782",
"status": "Completed",
"progress": 100,
"devices_success": 4,
"devices": [
{
"hwid": "user1@example.com",
"status": "done"
},
{
"hwid": "user2@example.com",
"status": "done"
},
{
"hwid": "user3@example.com",
"status": "done"
},
{
"hwid": "invalid_email@example.com",
"status": "failed"
}
]
}

bulkUnregisterDevice

Anchor link to

يلغي تسجيل أجهزة متعددة من Pushwoosh في طلب واحد.

POST https://api.pushwoosh.com/api/v2/audience/bulkUnregisterDevice

معلمات جسم الطلب

Anchor link to
المعلمةالنوعمطلوبالوصف
applicationstringنعمرمز تطبيق Pushwoosh
authstringنعمرمز الوصول إلى API
devicesarrayنعممصفوفة من كائنات الأجهزة. يمثل كل كائن جهازًا وبياناته المرتبطة به. انظر التفاصيل في جدول معلمات كائن الجهاز أدناه.

معلمات كائن الجهاز

Anchor link to
المعلمةالنوعمطلوبالوصف
hwidstringنعممعرف الجهاز أو المعرف الفريد للجهاز. اعرف المزيد

مثال على الطلب

Anchor link to
{
"application": "application code", // required. Pushwoosh app code
"auth": "Pushwoosh auth token", // required. API access token from Pushwoosh Control Panel
"devices": [{ // required. Array of devices
"hwid": "device hwid", // required. Unique identifier for the device (can be an email).
},
{
"hwid": "device hwid 2", // required. Unique identifier for the second device.
},
{
"hwid": "device hwid 3", // required. Unique identifier for the third device.
}]
}

الاستجابة

Anchor link to

تستجيب الطريقة بمعرف عملية، والذي يمكن استخدامه لتتبع حالة ونتائج العملية الجماعية.

{
"request_id": "request_id to use in GET method to obtain job status",
"status": "Pending"
}

حالة bulkUnregisterDevice

Anchor link to

يمكنك التحقق من حالة عملية إلغاء التسجيل الجماعي عن طريق إجراء طلب GET التالي:

GET https://api.pushwoosh.com/api/v2/audience/bulkUnregisterDevice/{request_id}?detailed=true

المعلمةالنوعمطلوبالوصف
request_idstringنعممعرف الطلب الذي تم إرجاعه بواسطة طلب POST.
detailedbooleanلاإذا تم تعيينه إلى true، فإن الاستجابة تتضمن نتائج مفصلة لكل جهاز تم إلغاء تسجيله.

مثال على الاستجابة

Anchor link to
{
"request_id": "9a2e1a14-XXXX-46c3-XXXX-c254b25d3782",
"status": "Completed",
"progress": 100,
"devices_success": 4,
"devices": [
{
"hwid": "user1@example.com",
"status": "done"
},
{
"hwid": "user2@example.com",
"status": "done"
},
{
"hwid": "user3@example.com",
"status": "done"
},
{
"hwid": "invalid_email@example.com",
"status": "failed"
}
]
}