Tags API
addTag
Anchor link toPOST https://api.pushwoosh.com/json/1.3/addTag
สร้างแท็กในบัญชีของคุณ
Request body
Anchor link to| ชื่อ | ประเภท | คำอธิบาย |
|---|---|---|
| auth* | string | API access token จาก Pushwoosh Control Panel |
| tag* | object | พารามิเตอร์ของแท็ก |
| tag.name* | string | ชื่อแท็ก |
| tag.type* | integer | ประเภทแท็ก ดูค่าที่เป็นไปได้ด้านล่าง |
| tag.user_specific | boolean | เมื่อเป็น true ค่าแท็กจะถูกจัดเก็บในระดับผู้ใช้และแชร์ไปยังอุปกรณ์ทั้งหมดของผู้ใช้เมื่อตั้งค่าโดย UserID เมื่อเป็น false (ค่าเริ่มต้น) แท็กจะเป็นระดับอุปกรณ์และตั้งค่าต่อ HWID |
| tag.application_specific | boolean | เลิกใช้แล้ว ระบบรับค่านี้แต่จะไม่นำไปใช้ เพราะแท็กไม่ได้แยกเป็นแบบเฉพาะแอปพลิเคชันและแบบทั้งบัญชีอีกต่อไป ไม่จำเป็นต้องส่ง |
{ "status_code": 200, "status_message": "OK", "response": { "result": true }}{ "request": { "auth": "yxoPUlwqm…………pIyEX4H", // จำเป็นต้องมี API access token จาก Pushwoosh Control Panel "tag": { "name": "TAG_NAME", // จำเป็นต้องมี "type": 1, // จำเป็นต้องมี ดูค่าที่เป็นไปได้ด้านล่าง "user_specific": false // ไม่บังคับ true = แท็กระดับผู้ใช้ (แชร์ในอุปกรณ์ทั้งหมด); false = แท็กระดับอุปกรณ์ (ค่าเริ่มต้น) } }}ประเภทค่าแท็กที่เป็นไปได้:
- 1 - Integer
- 2 - String
- 3 - List
- 4 - Date
- 5 - Boolean
- 6 - Decimal เช่น: 19.95
- 7 - Version เช่น: “1.0.0.0”
deleteTag
Anchor link toPOST https://api.pushwoosh.com/json/1.3/deleteTag
ลบแท็กพร้อมข้อมูลที่เกี่ยวข้องทั้งหมดออกจากฐานข้อมูลอย่างสมบูรณ์
Request body
Anchor link to| ชื่อ | ประเภท | คำอธิบาย |
|---|---|---|
| auth* | string | API access token จาก Pushwoosh Control Panel |
| tag* | object | พารามิเตอร์ของแท็ก |
| tag.name* | string | ชื่อของ tag ที่จะลบ |
{ "status_code": 200, "status_message": "OK", "response": { "result": true }}{ "request": { "auth": "yxoPUlwqm…………pIyEX4H", // จำเป็นต้องมี API access token จาก Pushwoosh Control Panel "tag": { "name": "TAG_NAME" // จำเป็นต้องมี ชื่อของแท็กที่จะลบ } }}listTags
Anchor link toPOST https://api.pushwoosh.com/json/1.3/listTags
ดึงรายการแท็กในบัญชี
Request body
Anchor link to| ชื่อ | ประเภท | คำอธิบาย |
|---|---|---|
| auth* | string | API access token จาก Pushwoosh Control Panel |
{ "status_code": 200, "status_message": "OK", "response": { "tags": [{ "name":"Language", "type":2, "isUserSpecific":true, "isApplicationSpecific":true }, { "name":"List tag", "type":3, "isUserSpecific":false, "isApplicationSpecific":true }] }}isUserSpecific ระบุว่าแท็กเป็นแบบ User-specific หรือไม่ isApplicationSpecific มีค่าเป็น true เสมอและคงไว้เพื่อความเข้ากันได้ย้อนหลังเท่านั้น เพราะแท็กไม่ได้แยกเป็นแบบเฉพาะแอปพลิเคชันและแบบทั้งบัญชีอีกต่อไป อย่าอ้างอิงฟิลด์นี้
{ "request":{ "auth": "yxoPUlwqm…………pIyEX4H" // API access token จาก Pushwoosh Control Panel }}ประเภทแท็ก:
- 1 - Integer
- 2 - String
- 3 - List
- 4 - Date
- 5 - Boolean
- 6 - Decimal เช่น: 19.95
- 7 - Version เช่น: “1.0.0.0”