【问题标题】:Google Classroom Rest API Patching 'text' in announcement does not workGoogle Classroom Rest API 在公告中修补“文本”不起作用
【发布时间】:2019-01-31 17:09:45
【问题描述】:

当我们尝试使用 REST API 修补 Google Classroom 公告中的“文本”时,我们会收到错误消息。如果我们从 updateMask 中删除“文本”,它会起作用。其他人也报告了这一点,但没有答案。详情如下:

Request URL: https://classroom.googleapis.com/v1/courses/xxxxxxx2746/announcements/xxxxxxx8639?updateMask=text,state
Request Method: PATCH

Payload:
{text: "Live Session at 1/31/2019", state: "PUBLISHED"}

Response:
Status Code: 400 
Remote Address: 172.217.15.106:443
{
  "error": {
    "code": 400,
    "message": "updateMask: Non-supported update mask fields specified",
    "status": "INVALID_ARGUMENT",
    "details": [
      {
        "@type": "type.googleapis.com/google.rpc.BadRequest",
        "fieldViolations": [
          {
            "field": "updateMask",
            "description": "Non-supported update mask fields specified"
          }
        ]
      }
    ]
  }
}

【问题讨论】:

    标签: rest google-classroom


    【解决方案1】:

    很遗憾,目前这是 Classroom API 中的一个错误。现在最好的解决方法是删除并使用announcements.deleteannouncements.create 端点重新创建帖子。您可以跟踪错误here 的进度。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-05-20
      • 1970-01-01
      • 2016-11-13
      • 1970-01-01
      • 2016-02-04
      • 2021-02-06
      • 1970-01-01
      • 2021-12-31
      相关资源
      最近更新 更多