ข้ามไปยังเนื้อหา

สถิติแอปพลิเคชันและผู้ติดตาม

getAppStats

Anchor link to

รับสถิติของแอปที่ระบุสำหรับช่วงเวลาที่กำหนด

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

พารามิเตอร์เนื้อหาคำขอ
Anchor link to
ชื่อ
จำเป็นประเภทคำอธิบาย
authใช่stringAPI 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

ออบเจ็กต์สถิติทั้งหมดมีรูปแบบเดียวกัน:

ฟิลด์
ประเภทคำอธิบาย
formatterstringมาตราส่วนรายงาน: yearly, monthly, daily, hourly, minutely
rowslistมีข้อมูลรายงานสำหรับการกระทำที่ลงทะเบียนแต่ละรายการ

แต่ละแถวของรายงานประกอบด้วย:

ฟิลด์
ประเภทคำอธิบาย
countintจำนวนการกระทำที่ลงทะเบียน
actionstringประเภทของการกระทำที่ลงทะเบียน
datetimestringวันที่ในรูปแบบ: Y-m-d H:i:s

การดึงผลลัพธ์คำขอที่กำหนดเวลาไว้

Anchor link to
เนื้อหาการตอบกลับ
Anchor link to
ฟิลด์
ประเภทคำอธิบาย
request_idstringID คำขอที่กำหนดเวลาไว้ โปรดดู /getResults สำหรับรายละเอียดเพิ่มเติม
เนื้อหาการตอบกลับที่กำหนดเวลาไว้ (/getResults)
Anchor link to
ฟิลด์
ประเภทคำอธิบาย
applicationsdictionaryสถิติสำหรับแอปพลิเคชัน
devicesdictionaryสถิติสำหรับอุปกรณ์
messagesdictionaryสถิติสำหรับข้อความ
ตัวอย่าง
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ใช่stringAPI 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

ชื่อ
จำเป็นคำอธิบาย
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)

ตัวอย่างคำขอ

Terminal window
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
}]
}

คำอธิบาย: คำขอสำเร็จและสถิติจะถูกส่งคืน

กฎช่วงเวลาของ Timestamp

Anchor link to
ช่วงเวลาที่ร้องขอ
ช่วงเวลาในการตอบกลับ
มากกว่า 1 ปี1 ปี
1 ปี1 เดือน
1 เดือน - 1 ปี1 วัน
น้อยกว่า 1 เดือน1 ชั่วโมง