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

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

bulkSetTags

Anchor link to

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

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

جسم الطلب

Anchor link to
الاسمالنوعالوصف
application*سلسلة نصية (String)رمز تطبيق Pushwoosh
auth*سلسلة نصية (String)رمز الوصول إلى واجهة برمجة التطبيقات (API access token) من لوحة تحكم Pushwoosh.
create_missing_tagsقيمة منطقية (Boolean)إذا كانت القيمة true، يتم إنشاء الوسوم المفقودة تلقائيًا.
devices*كائن (Object)مصفوفة من الأجهزة.
devices.hwidسلسلة نصية (String)يمكن استخدامه لتعريف جهاز بدلاً من user_id أو push_token. اعرف المزيد
devices.user_idسلسلة نصية (String)يمكن استخدامه لتعريف مستخدم بدلاً من hwid أو push_token. اعرف المزيد
devices.push_tokenسلسلة نصية (String)يمكن استخدامه لتعريف جهاز بدلاً من hwid أو user_id. اعرف المزيد
devices.list_operatorسلسلة نصية (String)يحدد كيفية تعيين القيم لـ الوسوم من نوع القائمة: 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 status

Anchor link to

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

إرجاع حالة عملية /bulkSetTags.

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

Anchor link to
الاسمالنوعالوصف
request_idسلسلة نصية (String)request id من استدعاء /bulkSetTags السابق

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

Anchor link to
الاسمالنوعالوصف
detailedقيمة منطقية (Boolean)(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
المعلمةالنوعمطلوبالوصف
applicationسلسلة نصية (string)نعمرمز تطبيق Pushwoosh
authسلسلة نصية (string)نعمرمز الوصول إلى واجهة برمجة التطبيقات (API access token).
devicesمصفوفة (array)نعممصفوفة من كائنات الأجهزة. يمثل كل كائن جهازًا وبياناته المرتبطة به. انظر التفاصيل في جدول معلمات كائن الجهاز أدناه.

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

Anchor link to
المعلمةالنوعمطلوبالوصف
hwidسلسلة نصية (string)نعممعرف الجهاز (hardware ID) أو معرف فريد للجهاز.
push_tokenسلسلة نصية (string)نعمرمز الدفع (Push token) للجهاز.
platformعدد صحيح (integer)نعممعرف المنصة. اعرف المزيد
list_operatorسلسلة نصية (string)لايحدد الإجراء للوسوم من نوع القائمة:
- “append”: إضافة القيمة المحددة إلى قائمة الوسم.
- “remove”: إزالة القيمة المحددة من قائمة الوسم.
ملاحظة: إذا لم يتم تحديد المعلمة list_operator، فسيتم استبدال جميع القيم الحالية في قائمة الوسم بالقيم المقدمة.
tagsكائن (object)لاالوسوم المخصصة المعينة للجهاز. الوسوم هي أزواج من المفاتيح والقيم تستخدم للتقسيم.

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

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 status

Anchor link to

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

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

المعلمةالنوعمطلوبالوصف
request_idسلسلة نصية (string)نعممعرف الطلب (request ID) الذي تم إرجاعه بواسطة طلب POST.
detailedقيمة منطقية (boolean)لاإذا تم تعيينه إلى 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
المعلمةالنوعمطلوبالوصف
applicationسلسلة نصية (string)نعمرمز تطبيق Pushwoosh
authسلسلة نصية (string)نعمرمز الوصول إلى واجهة برمجة التطبيقات (API access token)
devicesمصفوفة (array)نعممصفوفة من كائنات الأجهزة. يمثل كل كائن جهازًا وبياناته المرتبطة به. انظر التفاصيل في جدول معلمات كائن الجهاز أدناه.

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

Anchor link to
المعلمةالنوعمطلوبالوصف
hwidسلسلة نصية (string)نعممعرف الجهاز (hardware ID) أو معرف فريد للجهاز. اعرف المزيد

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

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 status

Anchor link to

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

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

المعلمةالنوعمطلوبالوصف
request_idسلسلة نصية (string)نعممعرف الطلب (request ID) الذي تم إرجاعه بواسطة طلب POST.
detailedقيمة منطقية (boolean)لاإذا تم تعيينه إلى 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"
}
]
}