Enterprises: pullNotificationSet

ดึงและส่งคืนชุดการแจ้งเตือนสําหรับองค์กรที่เชื่อมโยงกับบัญชีบริการที่ได้รับการตรวจสอบสิทธิ์สําหรับคําขอ ชุดการแจ้งเตือนอาจว่างเปล่าหากไม่มีการแจ้งเตือนที่รอดําเนินการ
คุณต้องรับทราบชุดการแจ้งเตือนที่แสดงผลภายใน 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

ค่าที่ยอมรับมีดังนี้
  • "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
                }
              ]
            }
          ]
        }
      }
    }
  ]
}
ชื่อพร็อพเพอร์ตี้ ค่า คำอธิบาย หมายเหตุ
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 ผลิตภัณฑ์ได้รับอนุมัติหรือไม่ได้รับอนุมัติ ช่องนี้จะปรากฏเสมอ

ค่าที่ยอมรับมีดังนี้
  • "approved"
  • "unapproved"
  • "unknown"
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 สาเหตุของการติดตั้งไม่สําเร็จ ช่องนี้จะปรากฏเสมอ

ค่าที่ยอมรับมีดังนี้
  • "timeout"
  • "unknown"
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 ชุดสิทธิ์ที่แอปขอในขณะนี้ ใช้ "สิทธิ์" ดาวน์โหลด EMM API เพื่อดูรายละเอียดเกี่ยวกับสิทธิ์เหล่านี้
notification[].newPermissionsEvent.approvedPermissions[] list ชุดสิทธิ์ที่ผู้ดูแลระบบขององค์กรอนุมัติสําหรับแอปพลิเคชันนี้แล้ว ใช้ "สิทธิ์" ดาวน์โหลด 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 สถานะใหม่ของผลิตภัณฑ์ ช่องนี้จะปรากฏเสมอ

ค่าที่ยอมรับมีดังนี้
  • "available"
  • "removed"
  • "unknown"
  • "unpublished"
notification[].newDeviceEvent nested object การแจ้งเตือนเกี่ยวกับอุปกรณ์ใหม่
notification[].newDeviceEvent.userId string รหัสของผู้ใช้ ช่องนี้จะปรากฏเสมอ
notification[].newDeviceEvent.deviceId string รหัส Android ของอุปกรณ์ ช่องนี้จะปรากฏเสมอ
notification[].newDeviceEvent.managementType string ระบุขอบเขตของอุปกรณ์ที่ Android EMM ควบคุมในการกําหนดค่าการติดตั้งใช้งานต่างๆ

ค่าที่เป็นไปได้ ได้แก่
  • "managedDevice" ซึ่งเป็นอุปกรณ์ที่ตั้งค่า DPC เป็นเจ้าของอุปกรณ์
  • "managedProfile" ซึ่งเป็นอุปกรณ์ที่ตั้งค่า DPC เป็นเจ้าของโปรไฟล์


ค่าที่ยอมรับมีดังนี้
  • "managedDevice"
  • "managedProfile"
notification[].notificationType string ประเภทของการแจ้งเตือน

ค่าที่ยอมรับมีดังนี้
  • "appRestricionsSchemaChange"
  • "appUpdate"
  • "deviceReportUpdate"
  • "installFailure"
  • "newDevice"
  • "newPermissions"
  • "productApproval"
  • "productAvailabilityChange"
  • "testNotification"
  • "unknown"
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 การประทับเวลาของการอัปเดตรายงานครั้งล่าสุดเป็นมิลลิวินาทีนับตั้งแต่ Epoch ช่องนี้จะปรากฏเสมอ
notification[].deviceReportUpdateEvent.report.appState[] list รายการสถานะแอปที่กําหนดโดยแอปที่มีการจัดการในอุปกรณ์ สถานะแอปจะกําหนดโดยนักพัฒนาแอป ช่องนี้จะปรากฏเสมอ
notification[].deviceReportUpdateEvent.report.appState[].packageName string ชื่อแพ็กเกจของแอป ระบบจะแสดงช่องนี้เสมอ
notification[].deviceReportUpdateEvent.report.appState[].keyedAppState[] list รายการสถานะของแอปคีย์ ช่องนี้จะปรากฏเสมอ
notification[].deviceReportUpdateEvent.report.appState[].keyedAppState[].key string คีย์ที่ระบุสถานะของแอป เนื้อหาของคีย์จะกําหนดโดยนักพัฒนาแอป เพื่อป้องกัน XSS เราขอแนะนําให้นํา HTML ออกจากคีย์ก่อนที่จะแสดง ช่องนี้จะปรากฏเสมอ
notification[].deviceReportUpdateEvent.report.appState[].keyedAppState[].stateTimestampMillis long การประทับเวลาที่แอปตั้งค่าสถานะเป็นมิลลิวินาทีนับตั้งแต่ Epoch ช่องนี้จะปรากฏเสมอ
notification[].deviceReportUpdateEvent.report.appState[].keyedAppState[].severity string ความรุนแรงของสถานะแอป ช่องนี้จะปรากฏเสมอ

ค่าที่ยอมรับมีดังนี้
  • "severityError"
  • "severityInfo"
notification[].deviceReportUpdateEvent.report.appState[].keyedAppState[].message string ข้อความรูปแบบอิสระที่มนุษย์อ่านได้ซึ่งอธิบายสถานะแอป เช่น ข้อความแสดงข้อผิดพลาด เพื่อป้องกัน XSS เราขอแนะนําให้นํา HTML ออกจากข้อความก่อนแสดง
notification[].deviceReportUpdateEvent.report.appState[].keyedAppState[].data string ช่องเพิ่มเติมสําหรับข้อมูลที่เครื่องอ่านได้ เช่น ตัวเลขหรือออบเจ็กต์ JSON เพื่อป้องกัน XSS เราขอแนะนําให้นํา HTML ออกจากข้อมูลก่อนที่จะแสดง
kind string