ตัวอย่างโค้ดสำหรับ Chrome Management Customer Subscriptions API

ไปที่ Customer Subscriptions API เพื่อดูภาพรวมของ ฟีเจอร์ API

คำขอทั้งหมดในหน้านี้ใช้ตัวแปรต่อไปนี้

  • $TOKEN - โทเค็น OAuth2
  • $CUSTOMER - รหัสของลูกค้า (เช่น C01234567) หรือค่าคงที่ my_customer

รับข้อมูลการสมัครใช้บริการของลูกค้า

รับข้อมูลการสมัครใช้บริการและใบอนุญาตที่รวบรวมไว้ของลูกค้า

ส่งคำขอ

curl -H "Authorization: Bearer $TOKEN" \
https://chromemanagement.googleapis.com/v1/customers/$CUSTOMER/subscriptionInfo

นอกจากนี้ คุณยังใช้นามแฝง my_customer เพื่อดึงข้อมูลการสมัครใช้บริการของโดเมนของผู้เรียกได้ด้วย

curl -H "Authorization: Bearer $TOKEN" \
https://chromemanagement.googleapis.com/v1/customers/my_customer/subscriptionInfo

คำตอบ

{
  "name": "customers/$CUSTOMER/subscriptionInfo",
  "chromeEnterpriseUpgradeAnnual": {
    "counts": {
      "totalPurchasedCount": "300",
      "assignedCount": "3",
      "unassignedCount": "297"
    },
    "subscriptionEndTime": "2027-08-15T12:00:00Z"
  },
  "kioskSignageUpgradeAnnual": {
    "counts": {
      "totalPurchasedCount": "10",
      "assignedCount": "4",
      "unassignedCount": "6"
    },
    "subscriptionEndTime": "2027-08-15T12:00:00Z"
  },
  "chromePerpetualUpgrade": {
    "counts": {
      "totalPurchasedCount": "10",
      "assignedCount": "10",
      "unassignedCount": "0"
    },
    "retiredCount": "2",
    "conditionallyAvailableCount": "2"
  }
}