Google Cloud AutoML API REST 调用

Google Cloud AutoML API REST call

我正在尝试通过 Postman 向 Google Cloud AutoML API 发送一个简单的请求,我一直在阅读此处的文档:https://cloud.google.com/vision/automl/docs/reference/rest/v1beta1/projects.locations.datasets/get

在页面上,它说 REST 端点应该是这样的:

获取https://automl.googleapis.com/v1beta1/{名称}

其中名称是 "resource name of the dataset to retrieve"。

资源名称到底是什么?

我的 Google Cloud AutoML 中有一个数据集,我用数据集的名称代替了 {name} 部分,但我一直收到“404 错误”。

我似乎无法在网上找到实际向 Google AutoML 发送 REST api 调用的示例。任何帮助是极大的赞赏。谢谢!

这里的文档不是很清楚,端点不正确,我建议你看看this。 正确的端点是:

https://automl.googleapis.com/v1beta1/projects/{YOUR-PROJECT-ID}/locations/us-central1/datasets

您需要 OAuth2 身份验证,here 对此进行了说明。 获得访问令牌后,您应该将请求的 header "Authorization" 设置为 "Bearer {access-token}".