Chrome Management Customer Subscriptions API 的代码示例

如需大致了解 API 功能,请访问客户订阅 API。

本页面上的所有请求均使用以下变量:

  • $TOKEN - OAuth2 令牌
  • $CUSTOMER - 客户 ID(例如 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"
  }
}