谷歌课堂REST API补丁公告中的“文本”不起作用

时间:2019-01-31 17:09:45

标签: rest google-classroom

当我们尝试使用REST API在Google课堂通知中修补“文本”时,出现错误。如果我们从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"
          }
        ]
      }
    ]
  }
}

1 个答案:

答案 0 :(得分:0)

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