ดึงและแสดงชุดการแจ้งเตือนสําหรับองค์กรที่เชื่อมโยงกับบัญชีบริการที่ตรวจสอบสิทธิ์สําหรับคําขอ ชุดการแจ้งเตือนอาจว่างเปล่าหากไม่มีการแจ้งเตือนที่รอดำเนินการ
ชุดการแจ้งเตือนที่แสดงผลต้องได้รับการรับทราบภายใน 20 วินาทีโดยเรียกใช้ Enterprises.AcknowledgeNotificationSet เว้นแต่ว่าชุดการแจ้งเตือนจะว่างเปล่า
การแจ้งเตือนที่ไม่มีการตอบกลับภายใน 20 วินาทีจะรวมอยู่ในคำตอบของคำขอ PullNotificationSet รายการอื่นในท้ายที่สุด และระบบจะลบการแจ้งเตือนที่ไม่มีการตอบกลับเลยในท้ายที่สุดตามนโยบายระบบ Pub/Sub ของ Google Cloud Platform
ระบบอาจดำเนินการตามคำขอหลายรายการพร้อมกันเพื่อดึงข้อมูลการแจ้งเตือน ซึ่งในกรณีนี้ การแจ้งเตือนที่รอดำเนินการ (หากมี) จะแยกไปยังผู้เรียกแต่ละราย หากมี
หากไม่มีการแจ้งเตือน ระบบจะแสดงรายการการแจ้งเตือนที่ว่างเปล่า
คำขอที่ตามมาอาจแสดงการแจ้งเตือนเพิ่มเติมเมื่อพร้อมใช้งาน
ส่งคำขอ
คำขอ HTTP
POST https://www.googleapis.com/androidenterprise/v1/enterprises/pullNotificationSet
พารามิเตอร์
| ชื่อพารามิเตอร์ | ค่า | คำอธิบาย | 
|---|---|---|
| พารามิเตอร์การค้นหาที่ไม่บังคับ | ||
requestMode | 
        string | 
        
          โหมดคำขอสำหรับการดึงข้อมูลการแจ้งเตือน
 การระบุ waitForNotifications จะทําให้คําขอถูกบล็อกและรอจนกว่าจะมีการแจ้งเตือนอย่างน้อย 1 รายการ หรือแสดงรายการการแจ้งเตือนว่างเปล่าหากไม่มีรายการใดแสดงหลังจากผ่านไประยะหนึ่ง
การระบุ returnImmediately จะทำให้คำขอแสดงการแจ้งเตือนที่รอดำเนินการทันที หรือแสดงรายการว่างหากไม่มีการแจ้งเตือน
หากไม่ระบุ ระบบจะใช้ค่าเริ่มต้นเป็น waitForNotifications
          ค่าที่ยอมรับมีดังนี้ 
  | 
      
การให้สิทธิ์
คำขอนี้ต้องได้รับสิทธิ์ที่มีขอบเขตต่อไปนี้
| ขอบเขต | 
|---|
https://www.googleapis.com/auth/androidenterprise | 
ดูข้อมูลเพิ่มเติมได้ที่หน้าการตรวจสอบสิทธิ์และการให้สิทธิ์
เนื้อหาของคำขอ
อย่าระบุเนื้อหาคำขอด้วยเมธอดนี้
การตอบกลับ
หากทำสำเร็จ วิธีการนี้จะแสดงผลลัพธ์เป็นเนื้อหาการตอบกลับซึ่งมีโครงสร้างดังต่อไปนี้
{
  "kind": "androidenterprise#notificationSet",
  "notificationSetId": string,
  "notification": [
    {
      "enterpriseId": string,
      "timestampMillis": long,
      "notificationType": string,
      "productApprovalEvent": {
        "productId": string,
        "approved": string
      },
      "installFailureEvent": {
        "productId": string,
        "deviceId": string,
        "userId": string,
        "failureReason": string,
        "failureDetails": string
      },
      "appUpdateEvent": {
        "productId": string
      },
      "newPermissionsEvent": {
        "productId": string,
        "requestedPermissions": [
          string
        ],
        "approvedPermissions": [
          string
        ]
      },
      "appRestrictionsSchemaChangeEvent": {
        "productId": string
      },
      "productAvailabilityChangeEvent": {
        "productId": string,
        "availabilityStatus": string
      },
      "newDeviceEvent": {
        "userId": string,
        "deviceId": string,
        "managementType": string,
        "dpcPackageName": string
      },
      "deviceReportUpdateEvent": {
        "userId": string,
        "deviceId": string,
        "report": {
          "lastUpdatedTimestampMillis": long,
          "appState": [
            {
              "packageName": string,
              "keyedAppState": [
                {
                  "key": string,
                  "stateTimestampMillis": long,
                  "severity": string,
                  "message": string,
                  "data": string
                }
              ]
            }
          ]
        }
      },
      "enterpriseUpgradeEvent": {
        "upgradeState": string
      }
    }
  ]
}| ชื่อพร็อพเพอร์ตี้ | ค่า | คำอธิบาย | หมายเหตุ | 
|---|---|---|---|
notificationSetId | 
        string | 
        รหัสชุดการแจ้งเตือนที่จําเป็นในการทําเครื่องหมายการแจ้งเตือนว่าได้รับแล้วด้วย Enterprises.AcknowledgeNotification API ระบบจะไม่แสดงส่วนนี้หากไม่มีการแจ้งเตือน | |
notification[] | 
        list | 
        การแจ้งเตือนที่ได้รับ หรือว่างเปล่าหากไม่มีการแจ้งเตือน | |
notification[].enterpriseId | 
        string | 
        รหัสขององค์กรที่จะส่งการแจ้งเตือน รายการนี้จะแสดงอยู่เสมอ | |
notification[].timestampMillis | 
        long | 
        เวลาที่มีการเผยแพร่การแจ้งเตือนเป็นมิลลิวินาทีนับจาก 1970-01-01T00:00:00Z รายการนี้จะแสดงอยู่เสมอ | |
notification[].productApprovalEvent | 
        nested object | 
        การแจ้งเตือนเกี่ยวกับการเปลี่ยนแปลงสถานะการอนุมัติของผลิตภัณฑ์ | |
notification[].productApprovalEvent.productId | 
        string | 
        รหัสของผลิตภัณฑ์ (เช่น "app:com.google.android.gm") ที่สถานะการอนุมัติมีการเปลี่ยนแปลง ช่องนี้จะแสดงอยู่เสมอ | |
notification[].productApprovalEvent.approved | 
        string | 
        ผลิตภัณฑ์ได้รับอนุมัติหรือไม่ได้รับอนุมัติ ช่องนี้จะแสดงอยู่เสมอ
           ค่าที่ยอมรับมีดังนี้ 
  | 
        |
notification[].installFailureEvent | 
        nested object | 
        การแจ้งเตือนเกี่ยวกับการติดตั้งแอปที่ไม่สำเร็จ | |
notification[].installFailureEvent.productId | 
        string | 
        รหัสของผลิตภัณฑ์ (เช่น "app:com.google.android.gm") ที่ทำให้เกิดเหตุการณ์การติดตั้งไม่สำเร็จ ช่องนี้จะแสดงอยู่เสมอ | |
notification[].installFailureEvent.deviceId | 
        string | 
        รหัส Android ของอุปกรณ์ ช่องนี้จะแสดงอยู่เสมอ | |
notification[].installFailureEvent.userId | 
        string | 
        รหัสของผู้ใช้ ช่องนี้จะแสดงอยู่เสมอ | |
notification[].installFailureEvent.failureReason | 
        string | 
        สาเหตุที่การติดตั้งไม่สำเร็จ ช่องนี้จะแสดงอยู่เสมอ
           ค่าที่ยอมรับมีดังนี้ 
  | 
        |
notification[].installFailureEvent.failureDetails | 
        string | 
        รายละเอียดเพิ่มเติมเกี่ยวกับความล้มเหลว (หากมี) | |
notification[].appUpdateEvent | 
        nested object | 
        การแจ้งเตือนเกี่ยวกับการอัปเดตแอป | |
notification[].appUpdateEvent.productId | 
        string | 
        รหัสของผลิตภัณฑ์ (เช่น "app:com.google.android.gm") ที่อัปเดต ช่องนี้จะแสดงอยู่เสมอ | |
notification[].newPermissionsEvent | 
        nested object | 
        การแจ้งเตือนเกี่ยวกับสิทธิ์ใหม่ของแอป | |
notification[].newPermissionsEvent.productId | 
        string | 
        รหัสของผลิตภัณฑ์ (เช่น "app:com.google.android.gm") ที่เพิ่มสิทธิ์ใหม่ ช่องนี้จะแสดงอยู่เสมอ | |
notification[].newPermissionsEvent.requestedPermissions[] | 
        list | 
        ชุดสิทธิ์ที่แอปขออยู่ในขณะนี้ ใช้ Permissions.Get ใน EMM API เพื่อเรียกข้อมูลรายละเอียดเกี่ยวกับสิทธิ์เหล่านี้ | |
notification[].newPermissionsEvent.approvedPermissions[] | 
        list | 
        ชุดสิทธิ์ที่ผู้ดูแลระบบขององค์กรอนุมัติให้แอปพลิเคชันนี้แล้ว ใช้ Permissions.Get ใน EMM API เพื่อเรียกข้อมูลรายละเอียดเกี่ยวกับสิทธิ์เหล่านี้ | |
notification[].appRestrictionsSchemaChangeEvent | 
        nested object | 
        การแจ้งเตือนเกี่ยวกับการเปลี่ยนแปลงสคีมาข้อจำกัดแอปใหม่ | |
notification[].appRestrictionsSchemaChangeEvent.productId | 
        string | 
        รหัสของผลิตภัณฑ์ (เช่น "app:com.google.android.gm") ที่มีการเปลี่ยนแปลงสคีมาการจํากัดแอป ช่องนี้จะแสดงอยู่เสมอ | |
notification[].productAvailabilityChangeEvent | 
        nested object | 
        การแจ้งเตือนเกี่ยวกับการเปลี่ยนแปลงความพร้อมจำหน่ายผลิตภัณฑ์ | |
notification[].productAvailabilityChangeEvent.productId | 
        string | 
        รหัสของผลิตภัณฑ์ (เช่น "app:com.google.android.gm") ที่ความพร้อมจำหน่ายผลิตภัณฑ์มีการเปลี่ยนแปลง ช่องนี้จะแสดงอยู่เสมอ | |
notification[].productAvailabilityChangeEvent.availabilityStatus | 
        string | 
        สถานะใหม่ของผลิตภัณฑ์ ช่องนี้จะแสดงอยู่เสมอ
           ค่าที่ยอมรับมีดังนี้ 
  | 
        |
notification[].newDeviceEvent | 
        nested object | 
        การแจ้งเตือนเกี่ยวกับอุปกรณ์ใหม่ | |
notification[].newDeviceEvent.userId | 
        string | 
        รหัสของผู้ใช้ ช่องนี้จะแสดงอยู่เสมอ | |
notification[].newDeviceEvent.deviceId | 
        string | 
        รหัส Android ของอุปกรณ์ ช่องนี้จะแสดงอยู่เสมอ | |
notification[].newDeviceEvent.managementType | 
        string | 
        ระบุระดับที่อุปกรณ์ได้รับการควบคุมจาก EMM ของ Android ในการกำหนดค่าต่างๆ ของการติดตั้งใช้งาน  ค่าที่เป็นไปได้ ได้แก่ 
 ค่าที่ยอมรับมีดังนี้ 
  | 
        |
notification[].notificationType | 
        string | 
        ประเภทการแจ้งเตือน
           ค่าที่ยอมรับมีดังนี้ 
  | 
        |
notification[].newDeviceEvent.dpcPackageName | 
        string | 
        แอปนโยบายในอุปกรณ์ | |
notification[].deviceReportUpdateEvent | 
        nested object | 
        การแจ้งเตือนเกี่ยวกับการอัปเดตรายงานอุปกรณ์ | |
notification[].deviceReportUpdateEvent.userId | 
        string | 
        รหัสของผู้ใช้ ช่องนี้จะแสดงอยู่เสมอ | |
notification[].deviceReportUpdateEvent.deviceId | 
        string | 
        รหัส Android ของอุปกรณ์ ช่องนี้จะแสดงอยู่เสมอ | |
notification[].deviceReportUpdateEvent.report | 
        nested object | 
        รายงานอุปกรณ์ที่อัปเดตด้วยสถานะแอปล่าสุด ช่องนี้จะแสดงอยู่เสมอ | |
notification[].deviceReportUpdateEvent.report.lastUpdatedTimestampMillis | 
        long | 
        การประทับเวลาของการอัปเดตรายงานครั้งล่าสุดเป็นมิลลิวินาทีนับตั้งแต่เริ่มต้น ช่องนี้จะแสดงอยู่เสมอ | |
notification[].deviceReportUpdateEvent.report.appState[] | 
        list | 
        รายการสถานะแอปที่กำหนดโดยแอปที่มีการจัดการในอุปกรณ์ สถานะแอปจะกำหนดโดยนักพัฒนาแอป ช่องนี้จะแสดงอยู่เสมอ | |
notification[].deviceReportUpdateEvent.report.appState[].packageName | 
        string | 
        ชื่อแพ็กเกจของแอป ช่องนี้จะปรากฏอยู่เสมอ | |
notification[].deviceReportUpdateEvent.report.appState[].keyedAppState[] | 
        list | 
        รายการสถานะแอปที่มีคีย์ ช่องนี้จะแสดงอยู่เสมอ | |
notification[].deviceReportUpdateEvent.report.appState[].keyedAppState[].key | 
        string | 
        คีย์ที่ระบุสิ่งที่แอปแสดงสถานะ โดยนักพัฒนาแอปเป็นผู้ตั้งค่าเนื้อหาของคีย์ เราขอแนะนําให้นํา HTML ออกจากคีย์ก่อนที่จะแสดงเพื่อป้องกัน XSS ช่องนี้จะแสดงอยู่เสมอ | |
notification[].deviceReportUpdateEvent.report.appState[].keyedAppState[].stateTimestampMillis | 
        long | 
        การประทับเวลาที่แอปตั้งค่าสถานะเป็นมิลลิวินาทีนับจาก Epoch ช่องนี้จะแสดงอยู่เสมอ | |
notification[].deviceReportUpdateEvent.report.appState[].keyedAppState[].severity | 
        string | 
        ความรุนแรงของสถานะแอป ช่องนี้จะแสดงอยู่เสมอ
           ค่าที่ยอมรับมีดังนี้ 
  | 
        |
notification[].deviceReportUpdateEvent.report.appState[].keyedAppState[].message | 
        string | 
        ข้อความรูปแบบอิสระที่มนุษย์อ่านได้ซึ่งอธิบายสถานะแอป เช่น ข้อความแสดงข้อผิดพลาด เราขอแนะนําให้นํา HTML ออกจากข้อความก่อนที่จะแสดงเพื่อป้องกัน XSS | |
notification[].deviceReportUpdateEvent.report.appState[].keyedAppState[].data | 
        string | 
        ฟิลด์เพิ่มเติมที่มีไว้สำหรับข้อมูลที่อ่านได้ด้วยเครื่อง เช่น ตัวเลขหรือออบเจ็กต์ JSON เพื่อป้องกัน XSS เราขอแนะนําให้นํา HTML ออกจากข้อมูลก่อนแสดง | |
kind | 
        string | 
        ||
notification[].enterpriseUpgradeEvent | 
        nested object | 
        การแจ้งเตือนเกี่ยวกับการอัปเกรดองค์กร | |
notification[].enterpriseUpgradeEvent.upgradeState | 
        string | 
        สถานะการอัปเกรด
           ค่าที่ยอมรับมีดังนี้ 
  |