สถิติแอปพลิเคชันและผู้ติดตาม
getAppStats
Anchor link toรับสถิติของแอปที่ระบุสำหรับช่วงเวลาที่กำหนด
POST https://api.pushwoosh.com/json/1.3/getAppStats
พารามิเตอร์เนื้อหาคำขอ
Anchor link to| ชื่อ | จำเป็น | ประเภท | คำอธิบาย |
|---|---|---|---|
auth | ใช่ | string | API access token จาก Pushwoosh Control Panel |
application | ใช่ | string | รหัสแอปพลิเคชัน Pushwoosh |
datefrom | ใช่ | string | วันและเวลาเริ่มต้นของรอบการรายงาน รูปแบบ: Y-m-d H:i:s |
dateto | ใช่ | string | วันและเวลาสิ้นสุดของรอบการรายงาน รูปแบบ: Y-m-d H:i:s |
ตัวอย่างคำขอ
Anchor link to{ "request": { "auth": "yxoPUlwqm…………pIyEX4H", // required. API access token from Pushwoosh Control Panel "application": "XXXXX-XXXXX", // required. Pushwoosh application code "datefrom": "2013-06-04 00:00:00", // required. Date and time, start of the reporting period "dateto": "2013-06-07 00:00:00" // required. Date and time, end of the reporting period }}ตัวอย่างการตอบกลับ
Anchor link to{ "status_code": 200, "status_message": "OK", "response": { "request_id": "c93a202f439235f9adaaa06d651548ab" }}ทำความเข้าใจสถิติ
Anchor link toสถิติจะแสดงการกระทำที่ลงทะเบียนไว้สำหรับแอปพลิเคชัน อุปกรณ์ หรือข้อความภายในกรอบเวลาที่กำหนด
รายงานจะถูกรวบรวมโดยอัตโนมัติตามกฎต่อไปนี้:
- รายปี: หากช่วงเวลานานกว่าหนึ่งปี
- รายเดือน: หากช่วงเวลานานกว่าหนึ่งเดือน
- รายวัน: หากช่วงเวลานานกว่าหนึ่งวัน
- รายชั่วโมง: หากช่วงเวลานานกว่าสามชั่วโมง
- รายนาที: ในกรณีอื่นๆ ทั้งหมด
ประเภทการกระทำ
Anchor link to- ระดับแอปพลิเคชัน:
_open_,_install_ - ระดับอุปกรณ์:
_register_,_unregister_ - ระดับข้อความ:
_send_,_open_
รูปแบบการตอบกลับ
Anchor link toออบเจ็กต์สถิติทั้งหมดมีรูปแบบเดียวกัน:
| ฟิลด์ | ประเภท | คำอธิบาย |
|---|---|---|
formatter | string | มาตราส่วนรายงาน: yearly, monthly, daily, hourly, minutely |
rows | list | มีข้อมูลรายงานสำหรับการกระทำที่ลงทะเบียนแต่ละรายการ |
แต่ละแถวของรายงานประกอบด้วย:
| ฟิลด์ | ประเภท | คำอธิบาย |
|---|---|---|
count | int | จำนวนการกระทำที่ลงทะเบียน |
action | string | ประเภทของการกระทำที่ลงทะเบียน |
datetime | string | วันที่ในรูปแบบ: Y-m-d H:i:s |
การดึงผลลัพธ์คำขอที่กำหนดเวลาไว้
Anchor link toเนื้อหาการตอบกลับ
Anchor link to| ฟิลด์ | ประเภท | คำอธิบาย |
|---|---|---|
request_id | string | ID คำขอที่กำหนดเวลาไว้ โปรดดู /getResults สำหรับรายละเอียดเพิ่มเติม |
เนื้อหาการตอบกลับที่กำหนดเวลาไว้ (/getResults)
Anchor link to| ฟิลด์ | ประเภท | คำอธิบาย |
|---|---|---|
applications | dictionary | สถิติสำหรับแอปพลิเคชัน |
devices | dictionary | สถิติสำหรับอุปกรณ์ |
messages | dictionary | สถิติสำหรับข้อความ |
ตัวอย่าง
Anchor link to{ "error": { "code": 0, "message": "OK" }, "json_data": { "applications": { "formatter": "hourly", "rows": [{ "count": 0, "action": "open", "datetime": "2013-06-06 00:00:00" }, { ... }] } }}getApplicationSubscribersStats
Anchor link toแสดงรายชื่อผู้ติดตามของแอปโดยจัดกลุ่มตามประเภทของอุปกรณ์
POST https://api.pushwoosh.com/json/1.3/getApplicationSubscribersStats
เนื้อหาคำขอ
Anchor link to| ชื่อ | จำเป็น | ประเภท | คำอธิบาย |
|---|---|---|---|
auth | ใช่ | string | API access token จาก Pushwoosh Control Panel |
application | ใช่ | string | รหัสแอปพลิเคชัน Pushwoosh |
ตัวอย่างคำขอ
{ "request": { "auth": "yxoPUlwqm…………pIyEX4H", // required. API access token from Pushwoosh Control Panel "application": "XXXXX-XXXXX" // required. Pushwoosh application code }}{ "status_code": 200, "status_message": "OK", "response": { "IOS": 1, "ANDROID": 1, "OSX": 0, "WINDOWS": 0, "AMAZON": 0, "SAFARI": 0, "FIREFOX": 0 }}getSubscribersStatistics
Anchor link toดึงข้อมูลสถิติผู้ติดตามแอปสำหรับช่วงเวลาหนึ่ง
POST https://api.pushwoosh.com/api/v2/statistics/application/getSubscribersStatistics
Headers
Anchor link to| ชื่อ | จำเป็น | คำอธิบาย |
|---|---|---|
| Authorization | ใช่ | API access token ในรูปแบบ: Key PKX.......NHg |
| Content-Type | ใช่ | ต้องตั้งค่าเป็น application/json |
พารามิเตอร์เนื้อหาคำขอ
Anchor link to| ชื่อ | จำเป็น | ประเภท | คำอธิบาย |
|---|---|---|---|
| application_code | ใช่ | string | รหัสแอปพลิเคชัน Pushwoosh |
| timestamp_from | ใช่ | string | วันและเวลาเริ่มต้นของช่วงเวลาสถิติ (รูปแบบ: YYYY-MM-DD hh:mm:ss, UTC+0) |
| timestamp_to | ใช่ | string | วันและเวลาสิ้นสุดของช่วงเวลาสถิติ (รูปแบบ: YYYY-MM-DD hh:mm:ss, UTC+0) |
ตัวอย่างคำขอ
curl --location --request POST 'https://api.pushwoosh.com/api/v2/statistics/application/getSubscribersStatistics' \--header 'Authorization: Key 3a2X......828JreCk48f' \--header 'Content-Type: application/json' \--data-raw '{ "application_code": "12345-67890", // Pushwoosh app code "timestamp_from": "2022-08-01 00:00:00", // UTC+0 "timestamp_to": "2022-09-01 00:00:00" // UTC+0}'ตัวอย่างการตอบกลับ
{ "statistics": [{ "timestamp": "YYYY-MM-DD hh:mm:ss", // UTC+0 "platform": 1, "push_enabled": 100, "push_disabled": 100 }]}รหัสการตอบกลับ
{ "statistics": [{ "timestamp": "YYYY-MM-DD hh:mm:ss", "platform": 1, "push_enabled": 100, "push_disabled": 100 }]}คำอธิบาย: คำขอสำเร็จและสถิติจะถูกส่งคืน
{ // Response}คำอธิบาย: คำขอมีไวยากรณ์หรือพารามิเตอร์ที่ไม่ถูกต้อง
{ // Response}คำอธิบาย: เซิร์ฟเวอร์พบข้อผิดพลาด โปรดลองอีกครั้งในภายหลัง
{ // Response}คำอธิบาย: การรับรองความถูกต้องล้มเหลว ตรวจสอบ API key หรือ token ของคุณ
{ // Response}คำอธิบาย: การเข้าถึงถูกปฏิเสธสำหรับรหัสแอปที่ระบุ
{ // Response}คำอธิบาย: ไม่พบรหัสแอปหรือไม่มีอยู่
กฎช่วงเวลาของ Timestamp
Anchor link to| ช่วงเวลาที่ร้องขอ | ช่วงเวลาในการตอบกลับ |
|---|---|
| มากกว่า 1 ปี | 1 ปี |
| 1 ปี | 1 เดือน |
| 1 เดือน - 1 ปี | 1 วัน |
| น้อยกว่า 1 เดือน | 1 ชั่วโมง |