सामग्री पर जाएं

सेगमेंटेशन (फिल्टर्स) API

createFilter

Anchor link to

POST https://api.pushwoosh.com/json/1.3/createFilter

एक नया फ़िल्टर बनाता है।

रिक्वेस्ट बॉडी

नामआवश्यकप्रकारविवरण
auth*हाँstringPushwoosh कंट्रोल पैनल से API एक्सेस टोकन
name*हाँstringफ़िल्टर का नाम
filter_expression*हाँstring

सेगमेंटेशन भाषा के नियमों के अनुसार बनाया गया एक्सप्रेशन।
उदाहरण: T(“City”, eq, “Madrid”) उन उपयोगकर्ताओं को सेगमेंट करने के लिए जिनका शहर मैड्रिड है।

applicationनहींstringPushwoosh एप्लिकेशन कोड। यह पैरामीटर केवल हाई-स्पीड सेटअप के साथ प्रयोग करने योग्य है; अन्यथा इसे छोड़ दें।
expiration_dateनहींstringफ़िल्टर की समाप्ति। फ़िल्टर निर्दिष्ट तिथि पर स्वचालित रूप से हटा दिया जाएगा, जब तक कि इसका उपयोग किसी प्रीसेट या RSS फ़ीड में न किया जाए।

200

{
"status_code": 200,
"status_message": "OK",
"response": {
"name": "filter name"
}
}

उदाहरण

{
"request": {
"auth": "yxoPUlwqm…………pIyEX4H",
"name": "City = Madrid",
"filter_expression": "T(\"City\", eq, \"Madrid\")",
"application": "B18XX-XXXXX",
"expiration_date": "2025-01-01"
}
}
// creating Filters for Timezones
{
"request": {
"auth": "yxoPUlwqm…………pIyEX4H", // API access token from Pushwoosh Control Panel
"name": "Timezone Filter",
"filter_expression": "T(\"Timezone\", BETWEEN, [\"UTC-12:00\", \"UTC+14:00\"])"
}
}

listFilters

Anchor link to

POST https://api.pushwoosh.com/json/1.3/listFilters

उपलब्ध सेगमेंट (फिल्टर) की सूची उनकी शर्तों के साथ लौटाता है।

रिक्वेस्ट बॉडी

नामआवश्यकप्रकारविवरण
auth*हाँstringPushwoosh कंट्रोल पैनल से API एक्सेस टोकन
application*हाँstringPushwoosh एप्लिकेशन कोड

200

{
"status_code": 200,
"status_message": "OK",
"response": {
"filters": [{
"code": "52551-F2F42",
"name": "City = Madrid",
"filter_expression": "T(\"City\", eq, \"madrid\")",
"expiration_date": "2025-01-01",
"application": "B18XX-XXXXX"
}]
}
}

उदाहरण

{
"request": {
"auth": "yxoPUlwqm…………pIyEX4H",
"application": "B18XX-XXXXX"
}
}

deleteFilter

Anchor link to

POST https://api.pushwoosh.com/json/1.3/deleteFilter

एक मौजूदा फ़िल्टर को हटाता है।

रिक्वेस्ट बॉडी

नामप्रकारविवरण
auth*stringPushwoosh कंट्रोल पैनल से API एक्सेस टोकन
name*stringफ़िल्टर का नाम
{
"status_code": 200,
"status_message": "OK",
"response": null
}
उदाहरण
{
"request": {
"auth": "yxoPUlwqm…………pIyEX4H", // API access token from Pushwoosh Control Panel
"name": "filter name"
}
}

exportSegment

Anchor link to

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

एक अनुसूचित अनुरोध। निर्दिष्ट फ़िल्टर शर्तों के अंतर्गत आने वाले सब्सक्राइबर्स की सूची निर्यात करता है।

रिक्वेस्ट बॉडी

नाम
आवश्यक
प्रकारविवरण
auth*हाँstringPushwoosh कंट्रोल पैनल से API एक्सेस टोकन
filterExpression*हाँstringफ़िल्टर की शर्तें
exportDataनहींarrayनिर्यात करने के लिए डेटा। संभावित मान: "hwids", "push_tokens", "users", "tags", "location""location" को शामिल करने से निर्यात की गई CSV में Latitude और Longitude कॉलम जुड़ जाते हैं। यदि exportData को छोड़ दिया जाता है, तो Latitude और Longitude डिफ़ॉल्ट रूप से निर्यात में शामिल होते हैं।
filterCodeनहींstringपहले से बना फ़िल्टर कोड, filterExpression के बजाय इस्तेमाल किया जा सकता है। /listFilters API से या कंट्रोल पैनल में फ़िल्टर देखते समय अपने ब्राउज़र के एड्रेस बार से प्राप्त किया जा सकता है।
applicationCodeयदि आप filterExpression या filterCode का उपयोग कर रहे हैं तो आवश्यक है।stringPushwoosh एप्लिकेशन कोड
generateExportनहींbooleanडिफ़ॉल्ट रूप से true पर सेट है, और प्रतिक्रिया में फ़ाइल डाउनलोड करने के लिए एक लिंक होता है। यदि false है, तो प्रतिक्रिया में केवल डिवाइस की संख्या भेजी जाएगी।
formatनहींstringनिर्यात की गई फ़ाइल का प्रारूप सेट करता है: “csv” या “json_each_line”। यदि छोड़ा गया है, तो CSV फ़ाइल उत्पन्न होती है।
tagsListनहींarrayनिर्यात करने के लिए टैग निर्दिष्ट करता है। केवल विशिष्ट टैग प्राप्त करने के लिए, “exportData” ऐरे में “tags” मान होना चाहिए।
includeWithoutTokensनहींbooleanनिर्यात की गई फ़ाइल में बिना पुश टोकन वाले उपयोगकर्ताओं को शामिल करने के लिए true पर सेट करें। डिफ़ॉल्ट false है।
{
"task_id": "177458"
}
उदाहरण
{
"auth": "yxoPUlwqm…………pIyEX4H", // required. API access token from Pushwoosh Control Panel
"filterExpression": "AT(\"12345-67890\", \"Name\", any)", // filter conditions, refer to the Segmentation Language guide for syntax
"filterCode": "12345-67890", // pre-made filter code, can be used instead of filterExpression
"applicationCode": "00000-AAAAA", // Required if you're using either `filterExpression` or `filterCode`. Pushwoosh app code. Can be obtained from /listFilters API request or address bar of your browser while viewing the filter in Control Panel.
"generateExport": true, // if false, devices count only will be sent in response; by default, a response contains a link to download the CSV file
"format": "json_each_line", // format of the file to present the data in: "csv" – the .csv file is downloaded; "json" – a JSON file with all expored devices; or "json_each_line" – JSON line for each device. If not specified, CSV is the default format.
"exportData": ["hwids", "tags"], // optional. Data to export. Possible values: "hwids", "push_tokens", "users", "tags", "location", "fcm_keys", "web keys"
"tagsList": ["Name", "Level"], // optional. Specifies tags to export. To obtain the specific tags only, the "tags" value should be sent within the "exportData" array or the "exportData" be empty.
"includeWithoutTokens": true // optional. Set to true to include users without push tokens in the exported file. Default is false.
}

उदाहरण के लिए, किसी विशेष ऐप के सभी सब्सक्राइबर्स को निर्यात करने के लिए, निम्नलिखित फ़िल्टर शर्तों का उपयोग करें:

{
"auth": "yxoPUlwqm…………pIyEX4H", // API access token from Pushwoosh Control Panel
"filterExpression": "A(\"AAAAA-BBBBB\")", // Filter expression referencing app segment
"applicationCode": "AAAAA-BBBBB" // Required Pushwoosh app code
}

exportSegment results

Anchor link to

POST https://api.pushwoosh.com/api/v2/audience/exportSegment/result

/exportSegment परिणामों के साथ CSV का लिंक पुनः प्राप्त करता है।

रिक्वेस्ट बॉडी

नामप्रकारविवरण
auth*StringPushwoosh कंट्रोल पैनल से API एक्सेस टोकन
task_id*Stringआपके /exportSegment प्रतिक्रिया में प्राप्त पहचानकर्ता।
{
"devicesCount": "24735",
"filename": "https://static.pushwoosh.com/segment-export/export_segment_XXXXX_XXXXX_xxxxxxxxxxxxxxxxx.csv.zip",
"status": "completed"
}

अपने /exportSegment प्रतिक्रिया में प्राप्त “task_id” को /exportSegment/result अनुरोध बॉडी में पास करें।

/exportSegment/result प्रतिक्रिया में, आपको “filename” पैरामीटर मिलेगा। उस पैरामीटर मान में दिए गए लिंक का पालन करके एक ZIP संग्रह स्वचालित रूप से डाउनलोड करें। CSV या JSON फ़ाइल (आपके अनुरोध में निर्दिष्ट “format” के आधार पर) जिसमें डिवाइस का डेटा है, उसे पुनः प्राप्त करने के लिए संग्रह को अनपैक करें।

3 अप्रैल, 2025 से फ़ाइल डाउनलोड करने के लिए प्राधिकरण आवश्यक है:

  • यदि ब्राउज़र के माध्यम से डाउनलोड कर रहे हैं, तो एक्सेस पाने के लिए बस Pushwoosh कंट्रोल पैनल में लॉग इन करें।
  • यदि सर्वर सॉफ़्टवेयर के माध्यम से डाउनलोड कर रहे हैं, तो अपने अनुरोध में निम्नलिखित हेडर शामिल करें: Authorization: Token YOUR_API_TOKEN

यदि आप अपने /exportSegment अनुरोध में “exportData” निर्दिष्ट करते हैं, तो डाउनलोड की गई फ़ाइल में केवल अनुरोधित डेटा होगा। डिफ़ॉल्ट रूप से, फ़ाइल में निम्नलिखित उपयोगकर्ता डेटा होता है:

फ़ील्डविवरणमान का उदाहरण
Hwidडिवाइस की हार्डवेयर आईडी01D1BA5C-AAAA-0000-BBBB-9B81CD5823C8
User IDयूज़र आईडी जो किसी डिवाइस को किसी विशेष उपयोगकर्ता के साथ जोड़ता है। यदि कोई यूज़र आईडी निर्दिष्ट नहीं है, तो HWID का उपयोग किया जाता है।user8192
Push Tokenक्लाउड मैसेजिंग गेटवे द्वारा किसी डिवाइस को सौंपा गया अद्वितीय पहचानकर्ता। और जानेंeeeb2fd7…0fc3547
Typeप्लेटफ़ॉर्म प्रकार (पूर्णांक)।1
Type (humanized)प्लेटफ़ॉर्म प्रकार (स्ट्रिंग)।iOS
Ageडिफ़ॉल्ट आयु टैग का मान।29
ApplicationVersionडिफ़ॉल्ट एप्लिकेशन संस्करण टैग का मान।1.12.0.0
Cityडिफ़ॉल्ट शहर टैग का मान।us, boston
TagNameआपके खाते में बनाए गए टैग का मान।TagValue