首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何只检索我的客户所有订阅的座位数?(Google Workplace Reseller)

如何只检索我的客户所有订阅的座位数?(Google Workplace Reseller)
EN

Stack Overflow用户
提问于 2021-02-04 19:20:10
回答 1查看 54关注 0票数 0

我正在使用以下JS代码来检索我的客户的所有订阅的seats详细信息。

代码语言:javascript
复制
gapi.client.reseller.subscriptions.list()
  .then(function(response) {
    // Handle the results here (response.result has the parsed body).
    console.log("Response", response);
  },
  function(err) { console.error("Execute error", err); });

但是,它也会返回他们的所有其他信息。如何对其进行自定义,使其只返回座位数?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2021-02-04 20:44:46

Google有一个名为fields的标准参数,允许您选择在响应(see documentation on Docs API)中包含哪些字段。

在Google API Client Library for JavaScript (也称为gapi)中,您可以在发出请求时简单地将参数添加到对象中。在您的情况下,这应该是可行的:

代码语言:javascript
复制
gapi.client.reseller.subscriptions.list({
  fields: [
    'nextPageToken',
    'subscriptions/subscriptionId',
    'subscriptions/seats/numberOfSeats',
  ].join(',')
})

保留您需要的所有字段很重要,包括像nextPageToken这样的控制字段。You can read more about the format used here

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/66044567

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档