我正在使用谷歌课堂API方法checkAddOnCreationEligibility,但给了我404,找不到方法

问题描述 投票:0回答:1

我试图通过使用谷歌课堂 API 来了解课程是否具有插件创建的合法性。

文档 -> https://developers.google.com/classroom/reference/rest/v1/courses/checkAddOnCreationEligibility

但是看起来没有找到该方法,可能是因为该插件是预览中的功能,此文档https://developers.google.com/classroom/reference/preview提到您可以通过以下方式使用预览在 URL 中添加标签,或者向 Google 团队询问具有预览功能的 API 客户端,我已经这样做了,但与此同时,我想通过在 URL 中使用标签进行测试,但我不完全确定如何进行。有谁知道可能是什么问题吗?

curl -X GET \
  "https://classroom.googleapis.com/v1/courses/my_course_id:checkAddOnCreationEligibility" \
  -H "Authorization: Bearer my_access_token
"
{
  "error": {
    "code": 404,
    "message": "Method not found.",
    "status": "NOT_FOUND"
  }
}

文档文档中描述的 http 响应 -> https://developers.google.com/classroom/reference/rest/v1/courses/checkAddOnCreationEligibility

axios google-classroom
1个回答
0
投票

通常,您可以使用

X-Goog-Visibilities
标头在 HTTP 请求中指定标签。在这种情况下,该值将为
ADD_ONS_ALPHA
。参考文档中这并不是很清楚。

但是,您的 Google Cloud 项目需要启用相应的预览功能。目前您需要申请此特定预览,因为它是私人。请参阅 https://developers.google.com/classroom/add-ons#timeline 填写兴趣表格。

© www.soinside.com 2019 - 2024. All rights reserved.