คู่มือนี้จะแสดงวิธีรับรายละเอียดการติดตั้งและการอนุญาตให้ใช้สิทธิของแอปใน Google Workspace Marketplace โดยการระบุคำขอและคำตอบตัวอย่างจาก Google Workspace Marketplace API
ยังไม่ได้ติดตั้งแอปพลิเคชัน
คำขอ licenseNotification.list
คำขอนี้เรียกใช้เมธอด licenseNotification.list
เพื่อดึงข้อมูลรายการ
การแจ้งเตือนการอนุญาตให้ใช้สําหรับแอปพลิเคชันที่เฉพาะเจาะจง
GET /appsmarket/v2/licenseNotification/{applicationId}
curl -H "Authorization: Bearer {TOKEN}" https://appsmarket.googleapis.com/appsmarket/v2/licenseNotification/{applicationId}
เนื้อหาการตอบกลับ
เนื่องจากยังไม่ได้ติดตั้งแอปพลิเคชัน คำตอบสำหรับคำขอนี้จึงไม่มีการแจ้งเตือนการอนุญาตให้ใช้สิทธิ
{
"kind": "appsmarket#licenseNotificationList",
"nextPageToken": ""
}
ติดตั้งแอปพลิเคชันแยกกัน
ผู้ใช้ user1@domain1.com ติดตั้งแอปพลิเคชันจาก Google Workspace Marketplace ด้วยตนเอง
คำขอ licenseNotification.list
คำขอนี้จะเรียกใช้เมธอด
licenseNotification.list
และดึงข้อมูลรายการการแจ้งเตือนการอนุญาตให้ใช้สิทธิสำหรับแอปพลิเคชันที่ผู้ใช้ติดตั้ง
GET /appsmarket/v2/licenseNotification/{applicationId}
curl -H "Authorization: Bearer {TOKEN}" https://appsmarket.googleapis.com/appsmarket/v2/licenseNotification/{applicationId}
เนื้อหาการตอบกลับ
เนื่องจาก user1@domain1.com ติดตั้งแอปพลิเคชัน การตอบกลับจึงมีการแจ้งเตือนเกี่ยวกับใบอนุญาต 1 รายการ การแจ้งเตือนเกี่ยวกับใบอนุญาต การแจ้งเตือนใบอนุญาตจะมีการแจ้งเตือนการจัดสรร เนื่องจากมีการจัดสรรใบอนุญาตใหม่สำหรับ user1@domain1.com เมื่อผู้ใช้ติดตั้งแอปพลิเคชัน
{
"kind": "appsmarket#licenseNotificationList",
"notifications": [
{
"kind": "appsmarket#licenseNotification",
"id": "{LICENSE_NOTIFICATION_ID}",
"applicationId": "{APPLICATION_ID}",
"customerId": "user1@domain1.com",
"timestamp": "1641318266998",
"provisions": [
{
"kind": "appsmarket#provisionNotification",
"editionId": "default_edition",
"seatCount": "1"
}
]
}
],
"nextPageToken": "{NEXT_PAGE_TOKEN}"
}
แอปพลิเคชันได้รับการติดตั้งโดยผู้ดูแลระบบ
ผู้ดูแลระบบของ domain1.com ติดตั้งแอปพลิเคชันสำหรับทุกคนในองค์กร
คำขอ userLicense.get
คำขอนี้เรียกใช้เมธอด userLicense.get
เพื่อรับสถานะการอนุญาตให้ใช้สิทธิ
ของ user1@domain1.com และตรวจสอบว่าผู้ใช้มีสิทธิ์ใช้
แอปพลิเคชันหรือไม่
GET /appsmarket/v2/userLicense/{applicationId}/{userId}
curl -H "Authorization: Bearer {TOKEN}" https://appsmarket.googleapis.com/appsmarket/v2/userLicense/{applicationId}/user1@domain1.com
เนื้อหาการตอบกลับ
เนื่องจาก domain1.com มีผู้ดูแลระบบติดตั้งแอปพลิเคชัน การตอบกลับจึงแสดงใบอนุญาตของผู้ใช้สำหรับ user1@domain1.com โดย enabled
คือ true
ซึ่งบ่งชี้ว่าผู้ดูแลระบบโดเมนสำหรับ domain1.com ได้เปิดใช้งานแอปพลิเคชันสำหรับโดเมนนี้ และ state
คือ ACTIVE
ซึ่งบ่งชี้ว่า user1@domain1.com มีใบอนุญาตที่ถูกต้องและควรได้รับอนุญาตให้ใช้แอปพลิเคชัน
{
"kind": "appsmarket#userLicense",
"enabled": true,
"state": "ACTIVE",
"editionId": "default_edition",
"customerId": "user1@domain1.com",
"applicationId": "{APPLICATION_ID}",
"id": "{USER_LICENSE_ID}",
"userId": "user1@domain1.com"
}
คำขอ customerLicense.get
คำขอนี้เรียกใช้เมธอด customerLicense.get
เพื่อรับสถานะการอนุญาตให้ใช้สิทธิของ domain1.com เพื่อพิจารณาว่าผู้ใช้มีสิทธิ์เข้าถึงแอปพลิเคชันหรือไม่
GET /appsmarket/v2/customerLicense/{applicationId}/{customerId}
curl -H "Authorization: Bearer {TOKEN}" https://appsmarket.googleapis.com/appsmarket/v2/customerLicense/{applicationId}/domain1.com
เนื้อหาการตอบกลับ
การตอบกลับจะแสดงใบอนุญาตของลูกค้า
สำหรับ domain1.com โดยที่ state
คือ ACTIVE
ซึ่งบ่งชี้ว่าลูกค้ามี
ใบอนุญาตที่ถูกต้อง
{
"kind": "appsmarket#customerLicense",
"id": "{CUSTOMER_LICENSE_ID}",
"applicationId": "{APPLICATION_ID}",
"customerId": "domain1.com",
"state": "ACTIVE",
"editions": [
{
"editionId": "default_edition",
"seatCount": -1
}
]
}
แอปพลิเคชันนี้ติดตั้งโดยผู้ดูแลระบบสำหรับหน่วยขององค์กร (OU) ของผู้ใช้ที่เฉพาะเจาะจงเท่านั้น
ตอนนี้แอปพลิเคชันนี้จะติดตั้งโดยผู้ดูแลระบบสำหรับ OU ของ user2@domain1.com เท่านั้น โดยจะไม่มีการติดตั้งโดยผู้ดูแลระบบสำหรับทุกคนในองค์กรอีกต่อไป
คำขอ userLicense.get
คำขอนี้จะเรียกใช้เมธอด userLicense.get
เพื่อรับสถานะการอนุญาตให้ใช้สิทธิของ user3@domain1.com และพิจารณาว่าผู้ใช้มี
สิทธิ์ใช้แอปพลิเคชันหรือไม่
GET /appsmarket/v2/userLicense/{applicationId}/{userId}
curl -H "Authorization: Bearer {TOKEN}" https://appsmarket.googleapis.com/appsmarket/v2/userLicense/{applicationId}/user3@domain1.com
เนื้อหาการตอบกลับ
เนื่องจากแอปพลิเคชันนี้ติดตั้งโดยผู้ดูแลระบบสำหรับ user2@domain1.com เท่านั้น คำตอบจึงแสดงใบอนุญาตผู้ใช้สำหรับ user3@domain1.com โดยที่ enabled
คือ
false
ซึ่งบ่งชี้ว่าผู้ดูแลระบบโดเมนสำหรับ domain1.com ยังไม่ได้
เปิดใช้งานแอปพลิเคชันสำหรับโดเมนนี้ และ state
คือ ACTIVE
ซึ่งบ่งชี้
ว่าผู้ใช้มีใบอนุญาตที่ถูกต้องและควรได้รับอนุญาตให้ใช้แอปพลิเคชัน
{
"kind": "appsmarket#userLicense",
"enabled": false,
"state": "ACTIVE",
"editionId": "default_edition",
"customerId": "domain1.com",
"applicationId": "{APPLICATION_ID}",
"id": "{USER_LICENSE_ID}",
"userId": "user3@domain1.com"
}
คำขอ userLicense.get
คำขอนี้เรียกใช้เมธอด userLicense.get
เพื่อรับสถานะการอนุญาตให้ใช้สิทธิ
ของ user2@domain1.com และตรวจสอบว่าผู้ใช้มีสิทธิ์ใช้
แอปพลิเคชันหรือไม่
GET /appsmarket/v2/userLicense/{applicationId}/{userId}
curl -H "Authorization: Bearer {TOKEN}" https://appsmarket.googleapis.com/appsmarket/v2/userLicense/{applicationId}/user2@domain1.com
เนื้อหาการตอบกลับ
เนื่องจากแอปพลิเคชันนี้ติดตั้งโดยผู้ดูแลระบบสำหรับ user2@domain1.com เท่านั้น คำตอบจึงแสดงใบอนุญาตผู้ใช้สำหรับ user2@domain1.com โดยที่ enabled
คือ
true
และ state
คือ ACTIVE
{
"kind": "appsmarket#userLicense",
"enabled": true,
"state": "ACTIVE",
"editionId": "default_edition",
"customerId": "domain1.com",
"applicationId": "{APPLICATION_ID}",
"id": "{USER_LICENSE_ID}",
"userId": "user2@domain1.com"
}
ระบบจะลบแอปพลิเคชันสำหรับทุกคนในองค์กร
ระบบได้ลบแอปพลิเคชันดังกล่าวสำหรับทุกคนในองค์กรแล้ว ผู้ใช้ user1@domain1.com ยังคงมีสิทธิ์เข้าถึงแอปพลิเคชันเนื่องจากก่อนหน้านี้ ได้ติดตั้งแอปพลิเคชันด้วยตนเอง
คำขอ userLicense.get
คำขอนี้เรียกใช้เมธอด userLicense.get
เพื่อรับสถานะการอนุญาตให้ใช้สิทธิ
ของ user2@domain1.com และตรวจสอบว่าผู้ใช้มีสิทธิ์ใช้
แอปพลิเคชันหรือไม่
GET /appsmarket/v2/userLicense/{applicationId}/{userId}
curl -H "Authorization: Bearer {TOKEN}" https://appsmarket.googleapis.com/appsmarket/v2/userLicense/{applicationId}/user2@domain1.com
เนื้อหาการตอบกลับ
เนื่องจากระบบลบแอปพลิเคชันสำหรับทุกคนในองค์กร การตอบกลับจึงแสดงใบอนุญาตผู้ใช้สำหรับ user2@domain1.com โดยที่ enabled
คือ false
และ state
คือ UNLICENSED
ซึ่งบ่งชี้ว่าผู้ดูแลระบบของโดเมนของผู้ใช้รายนี้ไม่ได้มอบหมายที่นั่งสำหรับแอปพลิเคชันให้แก่ผู้ใช้รายนี้
{
"kind": "appsmarket#userLicense",
"enabled": false,
"state": "UNLICENSED",
"applicationId": "{APPLICATION_ID}",
"id": "{USER_LICENSE_ID}",
"userId": "user2@domain1.com"
}
คำขอ userLicense.get
คำขอนี้เรียกใช้เมธอด userLicense.get
เพื่อรับสถานะการอนุญาตให้ใช้สิทธิ
ของ user1@domain1.com และตรวจสอบว่าผู้ใช้มีสิทธิ์ใช้
แอปพลิเคชันหรือไม่
GET /appsmarket/v2/userLicense/{applicationId}/{userId}
curl -H "Authorization: Bearer {TOKEN}" https://appsmarket.googleapis.com/appsmarket/v2/userLicense/{applicationId}/user1@domain1.com
เนื้อหาการตอบกลับ
เนื่องจาก user1@domain1.com เคยติดตั้งแอปพลิเคชันนี้แยกกันมาก่อน จึงยังคงมีสิทธิ์ใช้แอปพลิเคชันนี้ การตอบกลับจะแสดงใบอนุญาตของผู้ใช้ โดยที่
enabled
คือ true
และ state
คือ ACTIVE
{
"kind": "appsmarket#userLicense",
"enabled": true,
"state": "ACTIVE",
"editionId": "default_edition",
"customerId": "user1@domain1.com",
"applicationId": "{APPLICATION_ID}",
"id": "{USER_LICENSE_ID}",
"userId": "user1@domain1.com"
}
การแจ้งเตือนเกี่ยวกับใบอนุญาตจากการดำเนินการทั้งหมดข้างต้น
คำขอ licenseNotification.list
คำขอไปยังเมธอด licenseNotification.list
จะเรียกการแจ้งเตือนการอนุญาตให้ใช้สิทธิทั้งหมดสำหรับแอปพลิเคชัน
GET /appsmarket/v2/licenseNotification/{applicationId}
curl -H "Authorization: Bearer {TOKEN}" https://appsmarket.googleapis.com/appsmarket/v2/licenseNotification/{applicationId}
เนื้อหาการตอบกลับ
การตอบกลับจะแสดงรายการการแจ้งเตือนเกี่ยวกับใบอนุญาตสำหรับการดำเนินการทั้งหมด ที่ดำเนินการข้างต้น
{
"kind": "appsmarket#licenseNotificationList",
"notifications": [
{
"kind": "appsmarket#licenseNotification",
"id": "{LICENSE_NOTIFICATION_ID}",
"applicationId": "{APPLICATION_ID}",
"customerId": "user1@domain1.com",
"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}"
}