设置权限和身份验证
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
确保您的用户账号对项目拥有 Editor/Owner 权限
您可以通过发出以下命令来检查您的活跃账号:
gcloud auth list
如果您的用户账号不是活跃账号,您可以使用以下命令更改活跃账号:
gcloud config set account `ACCOUNT`
如果没有有效的账号,您需要先发出以下请求:
gcloud auth login
获取 OAuth 2.0 访问令牌
在能够向 Google 地图数据集服务发出请求之前,最后一步是获取与您的用户账号关联的 OAuth 2.0 令牌。
export TOKEN=$(gcloud auth print-access-token)
现在,您可以开始向 Maps Datasets API 发出请求
curl -H "X-Goog-User-Project: PROJECT_NUMBER" -H "Authorization: Bearer $TOKEN" https://mapsplatformdatasets.googleapis.com/v1alpha/projects/PROJECT_NUMBER/datasets/
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-05-02。
[[["易于理解","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-02。"],[[["Ensure your Google Cloud user account has Editor or Owner permissions for the project to access and manage Maps Datasets."],["Verify your active account using `gcloud auth list` and switch accounts if necessary with `gcloud config set account ACCOUNT`."],["Obtain an OAuth 2.0 access token using `gcloud auth print-access-token` to authenticate requests to the Maps Datasets API."],["Use the access token and project details in API requests to interact with the Maps Datasets service, such as listing datasets via `curl`."]]],[]]