Anhand von Beispielanfragen an und Antworten von der Google Workspace Marketplace API wird in diesem Leitfaden gezeigt, wie Sie Details zur Installation und Lizenzierung von Google Workspace Marketplace-Apps abrufen.
Die Anwendung wurde noch nicht installiert
licenseNotification.list-Anfrage
Bei dieser Anfrage wird die Methode licenseNotification.list
aufgerufen, um eine Liste der Lizenzierungsbenachrichtigungen für eine bestimmte Anwendung abzurufen.
GET /appsmarket/v2/licenseNotification/{applicationId}
curl -H "Authorization: Bearer {TOKEN}" https://appsmarket.googleapis.com/appsmarket/v2/licenseNotification/{applicationId}
Antworttext
Da die Anwendung noch nicht installiert wurde, enthält die Antwort auf diese Anfrage keine Lizenzierungsbenachrichtigungen.
{
"kind": "appsmarket#licenseNotificationList",
"nextPageToken": ""
}
Die Anwendung wird einzeln installiert
Ein Nutzer, [email protected], hat die Anwendung einzeln aus dem Google Workspace Marketplace installiert.
licenseNotification.list-Anfrage
Bei dieser Anfrage wird die Methode licenseNotification.list
aufgerufen und die Liste der Lizenzierungsbenachrichtigungen für die vom Nutzer installierte Anwendung abgerufen.
GET /appsmarket/v2/licenseNotification/{applicationId}
curl -H "Authorization: Bearer {TOKEN}" https://appsmarket.googleapis.com/appsmarket/v2/licenseNotification/{applicationId}
Antworttext
Da die Anwendung von „[email protected]“ installiert wurde, enthält die Antwort eine Lizenzbenachrichtigung. Die Lizenzbenachrichtigung enthält eine Benachrichtigung zur Bereitstellung, da für [email protected] beim Installieren der Anwendung eine neue Lizenz bereitgestellt wurde.
{
"kind": "appsmarket#licenseNotificationList",
"notifications": [
{
"kind": "appsmarket#licenseNotification",
"id": "{LICENSE_NOTIFICATION_ID}",
"applicationId": "{APPLICATION_ID}",
"customerId": "[email protected]",
"timestamp": "1641318266998",
"provisions": [
{
"kind": "appsmarket#provisionNotification",
"editionId": "default_edition",
"seatCount": "1"
}
]
}
],
"nextPageToken": "{NEXT_PAGE_TOKEN}"
}
Die Anwendung wurde vom Administrator installiert
Der Administrator von domain1.com hat die Anwendung für alle Nutzer in der Organisation installiert.
userLicense.get-Anfrage
Bei dieser Anfrage wird die userLicense.get
-Methode aufgerufen, um den Lizenzierungsstatus von „[email protected]“ abzurufen und festzustellen, ob er berechtigt ist, die Anwendung zu verwenden.
GET /appsmarket/v2/userLicense/{applicationId}/{userId}
curl -H "Authorization: Bearer {TOKEN}" https://appsmarket.googleapis.com/appsmarket/v2/userLicense/{applicationId}/[email protected]
Antworttext
Da der Administrator die Anwendung auf domain1.com installiert hat, wird in der Antwort die Nutzerlizenz für [email protected] zurückgegeben. Dabei ist enabled
= true
, was bedeutet, dass der Domainadministrator für domain1.com die Anwendung für diese Domain aktiviert hat. state
= ACTIVE
bedeutet, dass [email protected] eine gültige Lizenz hat und die Anwendung verwenden darf.
{
"kind": "appsmarket#userLicense",
"enabled": true,
"state": "ACTIVE",
"editionId": "default_edition",
"customerId": "[email protected]",
"applicationId": "{APPLICATION_ID}",
"id": "{USER_LICENSE_ID}",
"userId": "[email protected]"
}
customerLicense.get-Anfrage
Bei dieser Anfrage wird die customerLicense.get
-Methode aufgerufen, um den Lizenzierungsstatus von domain1.com abzurufen und so zu ermitteln, ob der Nutzer Zugriff auf die Anwendung hat.
GET /appsmarket/v2/customerLicense/{applicationId}/{customerId}
curl -H "Authorization: Bearer {TOKEN}" https://appsmarket.googleapis.com/appsmarket/v2/customerLicense/{applicationId}/domain1.com
Antworttext
Die Antwort gibt die Kundenlizenz für domain1.com zurück, wobei state
= ACTIVE
ist, was bedeutet, dass der Kunde eine gültige Lizenz hat.
{
"kind": "appsmarket#customerLicense",
"id": "{CUSTOMER_LICENSE_ID}",
"applicationId": "{APPLICATION_ID}",
"customerId": "domain1.com",
"state": "ACTIVE",
"editions": [
{
"editionId": "default_edition",
"seatCount": -1
}
]
}
Die Anwendung wird nur vom Administrator für die Organisationseinheit (OE) eines bestimmten Nutzers installiert.
Die Anwendung wird jetzt nur noch vom Administrator für die OU von [email protected] installiert. Die App wird nicht mehr von Administratoren für alle Nutzer in der Organisation installiert.
userLicense.get-Anfrage
Bei dieser Anfrage wird die userLicense.get
-Methode aufgerufen, um den Lizenzierungsstatus von „[email protected]“ abzurufen und festzustellen, ob er berechtigt ist, die Anwendung zu verwenden.
GET /appsmarket/v2/userLicense/{applicationId}/{userId}
curl -H "Authorization: Bearer {TOKEN}" https://appsmarket.googleapis.com/appsmarket/v2/userLicense/{applicationId}/[email protected]
Antworttext
Da die Anwendung nur vom Administrator für „[email protected]“ installiert wurde, gibt die Antwort eine Nutzerlizenz für „[email protected]“ zurück, bei der enabled
= false
ist. Das bedeutet, dass der Domainadministrator für „domain1.com“ die Anwendung nicht für diese Domain aktiviert hat. state
= ACTIVE
gibt an, dass der Nutzer eine gültige Lizenz hat und die Anwendung verwenden darf.
{
"kind": "appsmarket#userLicense",
"enabled": false,
"state": "ACTIVE",
"editionId": "default_edition",
"customerId": "domain1.com",
"applicationId": "{APPLICATION_ID}",
"id": "{USER_LICENSE_ID}",
"userId": "[email protected]"
}
userLicense.get-Anfrage
Bei dieser Anfrage wird die userLicense.get
-Methode aufgerufen, um den Lizenzierungsstatus von „[email protected]“ abzurufen und festzustellen, ob er berechtigt ist, die Anwendung zu verwenden.
GET /appsmarket/v2/userLicense/{applicationId}/{userId}
curl -H "Authorization: Bearer {TOKEN}" https://appsmarket.googleapis.com/appsmarket/v2/userLicense/{applicationId}/[email protected]
Antworttext
Da die Anwendung nur vom Administrator für „[email protected]“ installiert wurde, gibt die Antwort eine Nutzerlizenz für „[email protected]“ zurück, wobei enabled
true
und state
ACTIVE
ist.
{
"kind": "appsmarket#userLicense",
"enabled": true,
"state": "ACTIVE",
"editionId": "default_edition",
"customerId": "domain1.com",
"applicationId": "{APPLICATION_ID}",
"id": "{USER_LICENSE_ID}",
"userId": "[email protected]"
}
Die Anwendung wird für alle Nutzer in der Organisation gelöscht.
Die Anwendung wurde für alle Nutzer in der Organisation gelöscht. Der Nutzer „[email protected]“ hat weiterhin Zugriff auf die Anwendung, da er sie zuvor einzeln installiert hat.
userLicense.get-Anfrage
Bei dieser Anfrage wird die userLicense.get
-Methode aufgerufen, um den Lizenzierungsstatus von „[email protected]“ abzurufen und festzustellen, ob er berechtigt ist, die Anwendung zu verwenden.
GET /appsmarket/v2/userLicense/{applicationId}/{userId}
curl -H "Authorization: Bearer {TOKEN}" https://appsmarket.googleapis.com/appsmarket/v2/userLicense/{applicationId}/[email protected]
Antworttext
Da die Anwendung für alle Nutzer in der Organisation gelöscht wurde, gibt die Antwort eine Nutzerlizenz für „[email protected]“ zurück, wobei enabled
false
und state
UNLICENSED
ist. Das bedeutet, dass der Administrator der Domain dieses Nutzers diesem Nutzer keinen Sitz für die Anwendung zugewiesen hat.
{
"kind": "appsmarket#userLicense",
"enabled": false,
"state": "UNLICENSED",
"applicationId": "{APPLICATION_ID}",
"id": "{USER_LICENSE_ID}",
"userId": "[email protected]"
}
userLicense.get-Anfrage
Bei dieser Anfrage wird die userLicense.get
-Methode aufgerufen, um den Lizenzierungsstatus von „[email protected]“ abzurufen und festzustellen, ob er berechtigt ist, die Anwendung zu verwenden.
GET /appsmarket/v2/userLicense/{applicationId}/{userId}
curl -H "Authorization: Bearer {TOKEN}" https://appsmarket.googleapis.com/appsmarket/v2/userLicense/{applicationId}/[email protected]
Antworttext
Da [email protected] die Anwendung zuvor einzeln installiert hat, hat er weiterhin die Berechtigung, sie zu verwenden. Die Antwort gibt eine Nutzerlizenz zurück, wobei enabled
= true
und state
= ACTIVE
ist.
{
"kind": "appsmarket#userLicense",
"enabled": true,
"state": "ACTIVE",
"editionId": "default_edition",
"customerId": "[email protected]",
"applicationId": "{APPLICATION_ID}",
"id": "{USER_LICENSE_ID}",
"userId": "[email protected]"
}
Die Lizenzbenachrichtigungen zu allen oben genannten Aktionen
licenseNotification.list-Anfrage
Eine Anfrage an die licenseNotification.list
-Methode ruft alle Lizenzierungsbenachrichtigungen für die Anwendung ab.
GET /appsmarket/v2/licenseNotification/{applicationId}
curl -H "Authorization: Bearer {TOKEN}" https://appsmarket.googleapis.com/appsmarket/v2/licenseNotification/{applicationId}
Antworttext
Die Antwort enthält eine Liste der Lizenzbenachrichtigungen für alle oben ausgeführten Aktionen.
{
"kind": "appsmarket#licenseNotificationList",
"notifications": [
{
"kind": "appsmarket#licenseNotification",
"id": "{LICENSE_NOTIFICATION_ID}",
"applicationId": "{APPLICATION_ID}",
"customerId": "[email protected]",
"timestamp": "1641318266998",
"provisions": [
{
"kind": "appsmarket#provisionNotification",
"editionId": "default_edition",
"seatCount": "1"
}
]
},
{
"kind": "appsmarket#licenseNotification",
"id": "{LICENSE_NOTIFICATION_ID}",
"applicationId": "{APPLICATION_ID}",
"customerId": "domain1.com",
"timestamp": "1641318351038",
"provisions": [
{
"kind": "appsmarket#provisionNotification",
"editionId": "default_edition",
"seatCount": "-1"
}
]
},
{
"kind": "appsmarket#licenseNotification",
"id": "{LICENSE_NOTIFICATION_ID}",
"applicationId": "{APPLICATION_ID}",
"customerId": "domain1.com",
"timestamp": "1641318858349",
"deletes": [
{
"kind": "appsmarket#deleteNotification",
"editionId": "default_edition",
}
]
},
],
"nextPageToken": "{NEXT_PAGE_TOKEN}"
}