前提条件
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
在开始编写您的首个客户端应用之前,您需要做一些准备工作(如果您还没有做的话)。
获取 Google 账号
您需要拥有一个 Google 账号才能在 Chrome Device Token API 中创建项目。如果您已经具有账号,则您已准备就绪。
您可能还需要一个用来测试的单独 Google 账号。
为客户端创建一个项目
您需要先将客户端的相关信息告知 Google 并激活对该 API 的访问权限,然后才能向 Chrome Device Token API 发送请求。为此,您可以使用 Chrome Device Token API 创建一个项目(项目是设置和 API 访问信息的指定集合),然后注册您的应用。
要开始使用 Chrome Device Token API,您需要先执行以下操作:
设置工具,它会引导您在
Google API 控制台、启用 API 并创建凭据。
如果您尚未创建应用的 API 密钥,请点击
创建凭据 >API 密钥。接下来,在 API
密钥部分。
了解 REST 基础知识
Chrome Device Token API 中的 REST
Chrome Device Token API 操作会直接映射到 REST HTTP 动词。
Chrome Device Token API URI 的具体格式为:
https://chromedevicetoken.googleapis.com/v1/resourcePath?parameters
Chrome Device Token API 参考文档总结了用于 API 中各项受支持操作的全部 URI。
了解 JSON 基础知识
Chrome Device Token API 返回 JSON 格式的数据。
JSON(JavaScript 对象表示法)是一种与语言无关的常见数据格式,可通过简单的文本来表示任意数据结构。如需了解详情,请参阅 json.org。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-05-08。
[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["没有我需要的信息","missingTheInformationINeed","thumb-down"],["太复杂/步骤太多","tooComplicatedTooManySteps","thumb-down"],["内容需要更新","outOfDate","thumb-down"],["翻译问题","translationIssue","thumb-down"],["示例/代码问题","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-05-08。"],[[["You need a Google Account to create a project and utilize the Chrome Device Token API, potentially using a separate account for testing."],["Before sending API requests, create a project in the Google API Console to register your application and enable access to the Chrome Device Token API."],["The Chrome Device Token API leverages REST HTTP verbs and utilizes specific URIs for various operations, detailed in the API Reference documentation."],["Understanding REST and JSON basics is essential for working with the API, as it maps operations to REST verbs and returns data in JSON format."]]],[]]