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 יגרום לכך שהבקשה תיחסם ותמתין עד שתופיע התראה אחת או יותר, או שתוחזר רשימת התראות ריקה אם לא יופיעו התראות לאחר זמן מה.
ציון הערך returnImmediately יגרום לכך שהבקשה תחזיר מיד את ההתראות בהמתנה, או רשימה ריקה אם אין התראות.
אם לא צוין ערך, ברירת המחדל היא waitForNotifications.

הערכים הקבילים הם:
  • "returnImmediately"
  • "waitForNotifications"

אישור

הבקשה הזו דורשת הרשאה ברמת ההיקף הבאה:

היקף
https://www.googleapis.com/auth/androidenterprise

מידע נוסף זמין בדף אימות והרשאה.

גוף הבקשה

אין לספק גוף בקשה בשיטה הזו.

תשובה

אם הפעולה בוצעה ללא שגיאות, ה-method מחזיר גוף תגובה עם המבנה הבא:

{
  "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 מזהה קבוצת ההתראות, שנדרש כדי לסמן את ההתראה כמתקבלת באמצעות ה-API‏ Enterprises.AcknowledgeNotification. אם אין התראות, השדה הזה יושמט.
notification[] list ההתראות שהתקבלו, או ריק אם אין התראות.
notification[].enterpriseId string המזהה של הארגון שאליו נשלחת ההתראה. הוא תמיד יופיע.
notification[].timestampMillis long הזמן שבו ההתראה פורסמה, באלפיות שנייה מאז 1 בינואר 1970 בשעה 00: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 קבוצת ההרשאות שהאפליקציה מבקשת כרגע. כדי לאחזר פרטים על ההרשאות האלה, משתמשים ב-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 המצב החדש של המוצר. השדה הזה תמיד יופיע.

הערכים הקבילים הם:
  • "available"
  • "removed"
  • "unknown"
  • "unpublished"
notification[].newDeviceEvent nested object התראות על מכשירים חדשים.
notification[].newDeviceEvent.userId string המזהה של המשתמש. השדה הזה תמיד יופיע.
notification[].newDeviceEvent.deviceId string מזהה Android של המכשיר. השדה הזה תמיד יופיע.
notification[].newDeviceEvent.managementType string מזהה את מידת השליטה של EMM ל-Android במכשיר בתצורות פריסה שונות.

הערכים האפשריים כוללים:
  • 'managedDevice', מכשיר שבו בקר ה-DPC מוגדר כבעלים של המכשיר,
  • 'managedProfile', מכשיר שבו בקר ה-DPC מוגדר כבעלים של הפרופיל.


הערכים הקבילים הם:
  • "managedDevice"
  • "managedProfile"
notification[].notificationType string סוג ההתראה.

הערכים הקבילים הם:
  • "appRestricionsSchemaChange"
  • "appUpdate"
  • "deviceReportUpdate"
  • "enterpriseUpgrade"
  • "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 חותמת הזמן של עדכון הדוח האחרון, במיליוניות השנייה מאז תחילת הזמן. השדה הזה תמיד יופיע.
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 חותמת הזמן של המועד שבו האפליקציה הגדרה את המצב, במיליוניות השנייה מאז תחילת התקופה של זמן מערכת. השדה הזה תמיד יופיע.
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
notification[].enterpriseUpgradeEvent nested object התראות על שדרוג לארגון.
notification[].enterpriseUpgradeEvent.upgradeState string סטטוס השדרוג.

הערכים הקבילים הם:
  • "upgradeStateSucceeded"
  • "upgradeStateUnspecified"