במאמר הזה מוסבר איך לקבל פרטים על התקנה ורישוי של אפליקציות מ-Google Workspace Marketplace. לשם כך, מוצגות דוגמאות לבקשות ולתשובות מ- Google Workspace Marketplace API.
האפליקציה מותקנת על ידי אדמין
האדמין של cymbalgroup.com התקין את האפליקציה לכל מי ששייך לארגון.
בקשת userLicense.get
הבקשה הזו קוראת לשיטה userLicense.get כדי לקבל את סטטוס הרישוי של user1@cymbalgroup.com, כדי לקבוע אם יש לו הרשאה להשתמש באפליקציה.
GET /appsmarket/v2/userLicense/{applicationId}/{userId}
curl -H "Authorization: Bearer {TOKEN}" https://appsmarket.googleapis.com/appsmarket/v2/userLicense/APPLICATION_ID/user1@cymbalgroup.comגוף התשובה
מאחר שהאפליקציה הותקנה בדומיין cymbalgroup.com, התגובה מחזירה את המשאב userLicense עבור user1@cymbalgroup.com. השדה enabled במשאב userLicense מוגדר לערך true, שמציין שמנהל הדומיין של cymbalgroup.com הפעיל את האפליקציה בדומיין הזה. השדה state מוגדר לערך ACTIVE, שמציין שלמשתמש user1@cymbalgroup.com יש רישיון תקף וצריך לאפשר לו להשתמש באפליקציה.
{
"kind": "appsmarket#userLicense",
"enabled": true,
"state": "ACTIVE",
"editionId": "default_edition",
"customerId": "user1@cymbalgroup.com",
"applicationId": "APPLICATION_ID",
"id": "USER_LICENSE_ID",
"userId": "user1@cymbalgroup.com"
}
בקשת customerLicense.get
הבקשה הזו קוראת ל-method customerLicense.get כדי לקבל את סטטוס הרישיון של cymbalgroup.com ולקבוע אם יש להם גישה לאפליקציה.
GET /appsmarket/v2/customerLicense/{applicationId}/{customerId}
curl -H "Authorization: Bearer {TOKEN}" https://appsmarket.googleapis.com/appsmarket/v2/customerLicense/APPLICATION_ID/cymbalgroup.comגוף התשובה
התגובה מחזירה את משאב customerLicense עבור cymbalgroup.com, כאשר השדה state מוגדר לערך ACTIVE, שמציין שללקוח יש רישיון בתוקף.
{
"kind": "appsmarket#customerLicense",
"id": "CUSTOMER_LICENSE_ID",
"applicationId": "APPLICATION_ID",
"customerId": "cymbalgroup.com",
"state": "ACTIVE",
"editions": [
{
"editionId": "default_edition",
"seatCount": -1
}
]
}
האפליקציה מותקנת על ידי האדמין רק ביחידה ארגונית ספציפית של משתמש
האפליקציה מותקנת עכשיו רק על ידי האדמין עבור היחידה הארגונית (OU) של המשתמש user2@cymbalgroup.com. האדמין לא יכול יותר להתקין את האפליקציה לכל המשתמשים בארגון.
בקשת userLicense.get
הבקשה הזו קוראת לשיטה userLicense.get כדי לקבל את סטטוס הרישוי של user3@cymbalgroup.com, במטרה לקבוע אם יש לו הרשאה להשתמש באפליקציה.
GET /appsmarket/v2/userLicense/{applicationId}/{userId}
curl -H "Authorization: Bearer {TOKEN}" https://appsmarket.googleapis.com/appsmarket/v2/userLicense/APPLICATION_ID/user3@cymbalgroup.comגוף התשובה
מכיוון שהאפליקציה מותקנת רק על ידי האדמין עבור user2@cymbalgroup.com, התגובה מחזירה משאב userLicense עבור user3@cymbalgroup.com עם השדה enabled שמוגדר לערך false, שמציין שאדמין הדומיין של cymbalgroup.com לא הפעיל את האפליקציה עבור הדומיין הזה, והשדה state שמוגדר לערך ACTIVE, שמציין שלמשתמש יש רישיון תקף וצריך לאפשר לו להשתמש באפליקציה.
{
"kind": "appsmarket#userLicense",
"enabled": false,
"state": "ACTIVE",
"editionId": "default_edition",
"customerId": "cymbalgroup.com",
"applicationId": "APPLICATION_ID",
"id": "USER_LICENSE_ID",
"userId": "user3@cymbalgroup.com"
}
בקשת userLicense.get
בבקשה הזו מופעלת השיטה userLicense.get כדי לקבל את סטטוס הרישוי של user2@cymbalgroup.com ולקבוע אם יש לו הרשאה להשתמש באפליקציה.
GET /appsmarket/v2/userLicense/{applicationId}/{userId}
curl -H "Authorization: Bearer {TOKEN}" https://appsmarket.googleapis.com/appsmarket/v2/userLicense/APPLICATION_ID/user2@cymbalgroup.comגוף התשובה
מכיוון שהאפליקציה מותקנת רק על ידי האדמין עבור user2@cymbalgroup.com, התגובה מחזירה משאב userLicense עבור user2@cymbalgroup.com עם השדה enabled שמוגדר ל-true והשדה state שמוגדר ל-ACTIVE.
{
"kind": "appsmarket#userLicense",
"enabled": true,
"state": "ACTIVE",
"editionId": "default_edition",
"customerId": "cymbalgroup.com",
"applicationId": "APPLICATION_ID",
"id": "USER_LICENSE_ID",
"userId": "user2@cymbalgroup.com"
}
האפליקציה נמחקת לכל המשתמשים בארגון
למרות שהאפליקציה נמחקה לכל המשתמשים בארגון, למשתמש user1@cymbalgroup.com עדיין יש גישה כי הוא התקין אותה בעבר באופן פרטני.
בקשת userLicense.get
בבקשה הזו מופעלת השיטה userLicense.get כדי לקבל את סטטוס הרישוי של user2@cymbalgroup.com ולקבוע אם יש לו הרשאה להשתמש באפליקציה.
GET /appsmarket/v2/userLicense/{applicationId}/{userId}
curl -H "Authorization: Bearer {TOKEN}" https://appsmarket.googleapis.com/appsmarket/v2/userLicense/APPLICATION_ID/user2@cymbalgroup.comגוף התשובה
מאחר שהאפליקציה נמחקה לכל המשתמשים בארגון, התשובה מחזירה משאב userLicense עבור user2@cymbalgroup.com, כשהשדה enabled מוגדר לערך false והשדה state מוגדר לערך UNLICENSED. המשמעות היא שהאדמין של הדומיין של המשתמש הזה לא הקצה לו מושב באפליקציה.
{
"kind": "appsmarket#userLicense",
"enabled": false,
"state": "UNLICENSED",
"applicationId": "APPLICATION_ID",
"id": "USER_LICENSE_ID",
"userId": "user2@cymbalgroup.com"
}
בקשת userLicense.get
הבקשה הזו קוראת לשיטה userLicense.get כדי לקבל את סטטוס הרישוי של user1@cymbalgroup.com, כדי לקבוע אם יש לו הרשאה להשתמש באפליקציה.
GET /appsmarket/v2/userLicense/{applicationId}/{userId}
curl -H "Authorization: Bearer {TOKEN}" https://appsmarket.googleapis.com/appsmarket/v2/userLicense/APPLICATION_ID/user1@cymbalgroup.comגוף התשובה
מכיוון שהמשתמש user1@cymbalgroup.com התקין את האפליקציה בעבר באופן פרטני,
עדיין יש לו הרשאה להשתמש בה. התשובה מחזירה משאב userLicense שהשדה enabled שלו מוגדר ל-true והשדה state שלו מוגדר ל-ACTIVE.
{
"kind": "appsmarket#userLicense",
"enabled": true,
"state": "ACTIVE",
"editionId": "default_edition",
"customerId": "user1@cymbalgroup.com",
"applicationId": "APPLICATION_ID",
"id": "USER_LICENSE_ID",
"userId": "user1@cymbalgroup.com"
}