Message inbox API
getInboxMessages
Anchor link toส่งคืนรายการข้อความ Inbox สำหรับ HWID ที่ระบุ
POST https://api.pushwoosh.com/json/1.3/getInboxMessages
Request headers
Anchor link to| ชื่อ | จำเป็น | ค่า | คำอธิบาย |
|---|---|---|---|
| Authorization | ใช่ | Token XXXX | API Device Token เพื่อเข้าถึง Device API แทนที่ XXXX ด้วย Device API token จริงของคุณ |
Request Body
Anchor link to| ชื่อ | ประเภท | คำอธิบาย |
|---|---|---|
| application* | string | Pushwoosh application code |
| userId* | string | หากไม่ได้ตั้งค่า User ID แบบกำหนดเอง ให้ใช้ HWID |
| hwid | string | Hardware ID ของอุปกรณ์ ที่จะดึงข้อความ Inbox |
| last_code | string | รหัสของข้อความล่าสุดที่ดึงมาในการตอบกลับครั้งก่อน หากว่างเปล่า จะส่งคืนข้อความแรกสุด |
| count | integer | จำนวนข้อความที่จะแสดงในการตอบกลับเดียว ใช้สำหรับการแบ่งหน้า (pagination) ใส่ 0 เพื่อโหลดข้อความทั้งหมดใน Inbox |
{ "response": { "messages": [{ // array of messages currently stored in user's Inbox "inbox_id": "avde1c792cd", "rt": "146078676", // date to remove the message from Inbox "send_date": "1459758676", // date when the message was saved to Inbox "order": "59138176", // position in Inbox presentation order "title": "New Rich Media in inbox!", "text": "Hi! New feature is available right now!", "action_type": "RichMedia", "action_params": { // payload describing the actions on push opening "rm": "{\"url\":\"https:\/\/richmedia.pushwoosh.com\/C82F7-51FC1.zip\",\"ts\":\"1459758676\",\"tags\":{\"tagName\":\"tagValue\"}}" }, "status": 1, // 1 - delivered, 2 - read, 3 - opened, // 4 - deleted(by a user), 5 - deleted from Control Panel "hash":"1C" // hash code of push notification }, { ... }], "next":"afarew511", // the next Inbox code to be returned by // the following /getInboxMessages request "deleted": ["bbaf85ab", "a41957b"], // the list of messages deleted from Control Panel "new_inbox": 6 // the number of delivered Inbox messages for that user (can be used for badge) }}{ "request": { "application": "XXXXX-XXXXX", // required. Pushwoosh app code "userId": "user_name_1", // required. User ID registered in Pushwoosh "device_type": 1 // optional. For device types refer to /registerDevice }}inboxStatus
Anchor link toอัปเดตสถานะของข้อความ Inbox ที่ระบุ
POST https://api.pushwoosh.com/json/1.3/inboxStatus
Request headers
Anchor link to| ชื่อ | จำเป็น | ค่า | คำอธิบาย |
|---|---|---|---|
| Authorization | ใช่ | Token XXXX | API Device Token เพื่อเข้าถึง Device API แทนที่ XXXX ด้วย Device API token จริงของคุณ |
Request Body
Anchor link to| ชื่อ | ประเภท | คำอธิบาย |
|---|---|---|
| application* | string | Pushwoosh application code |
| inbox_code* | string | สามารถรับได้จากรายละเอียดข้อความใน Control Panel หรือจากพารามิเตอร์ “order” ของคำขอ /getInboxMessages |
| hash | string | รหัส Hash ของข้อความ Inbox |
| hwid | string | Hardware ID ของอุปกรณ์ ที่จะอัปเดตสถานะ Inbox |
| time | string | Timestamp ของวันที่ส่ง |
| userID* | string | หากไม่ได้ตั้งค่า User ID แบบกำหนดเอง ให้ใช้ HWID |
| status* | integer | 1 - ส่งแล้ว (delivered), 2 - อ่านแล้ว (read), 3 - เปิดแล้ว (opened), 4 - ลบโดยผู้ใช้ (deleted by a user) |
| device_type | integer | ดูค่าที่เป็นไปได้ |
{ "status_code": 200, "status_message": "OK", "response": null}{ "request": { "application": "XXXXX-XXXXX", // required. Pushwoosh application code "inbox_code": "874393934032909", // required. "order" parameter of /getInboxMessages request "hash": "1C", // optional. "userId": "some_user", // required. "status": 2, // required. status to set: 1-delivered, 2-read, 3-opened, 4-deleted (by a user) "device_type": 3 // optional. }}