创建具有 scheduled_time/scheduledTime returns 内部错误的 CourseWork
Creating a CourseWork with scheduled_time/scheduledTime returns an Internal Error
我正在尝试通过他们的 API 创建一个 Google 课堂课程作业。具体来说,这个调用:https://developers.google.com/classroom/reference/rest/v1/courses.courseWork/create
我正在使用 Google Ruby API gem 这样做。
每次我尝试使用 scheduledTime 创建 CourseWork 时,我都会收到内部服务器错误。
请求示例:
Sending HTTP post https://classroom.googleapis.com/v1/courses/5022964882/courseWork?
{"description":null,"dueDate":null,"dueTime":null,"materials":[{"link":{"url":"https://google-c.gc.localhost.mine.com:3000/scores/view/f78df89b0f92be257f004501b7c4958216f2167b"}}],"maxPoints":null,"scheduledTime":{"seconds":1601913540000,"nanos":0},"state":"DRAFT","title":"test2","workType":"ASSIGNMENT"}
并回复:
#<HTTP::Message:0x00007f7fb2fdeee8 @http_header=#<HTTP::Message::Headers:0x00007f7fb2fdeec0 @http_version="1.1", @body_size=0, @chunked=false, @request_method="POST", @request_uri=#<Addressable::URI:0x3fbfd97efd78 URI:https://classroom.googleapis.com/v1/courses/5022964882/courseWork?>, @request_query=nil, @request_absolute_uri=nil, @status_code=500, @reason_phrase="Internal Server Error", @body_type=nil, @body_charset=nil, @body_date=nil, @body_encoding=#<Encoding:UTF-8>, @is_request=false, @header_item=[["Vary", "Origin"], ["Vary", "X-Origin"], ["Vary", "Referer"], ["Content-Type", "application/json; charset=UTF-8"], ["Content-Encoding", "gzip"], ["Date", "Mon, 26 Oct 2020 15:36:14 GMT"], ["Server", "ESF"], ["Cache-Control", "private"], ["X-XSS-Protection", "0"], ["X-Frame-Options", "SAMEORIGIN"], ["X-Content-Type-Options", "nosniff"], ["Alt-Svc", "h3-Q050=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000,h3-T051=\":443\"; ma=2592000,h3-T050=\":443\"; ma=2592000,h3-Q046=\":443\"; ma=2592000,h3-Q043=\":443\"; ma=2592000,quic=\":443\"; ma=2592000; v=\"46,43\""], ["Transfer-Encoding", "chunked"]], @dumped=false>, @peer_cert=#<OpenSSL::X509::Certificate: subject=#<OpenSSL::X509::Name CN=upload.video.google.com,O=Google LLC,L=Mountain View,ST=California,C=US>, issuer=#<OpenSSL::X509::Name CN=GTS CA 1O1,O=Google Trust Services,C=US>, serial=#<OpenSSL::BN:0x00007f7fb2fce818>, not_before=2020-10-06 06:40:00 UTC, not_after=2020-12-29 06:40:00 UTC>, @http_body=#<HTTP::Message::Body:0x00007f7fb2fdee48 @body="{\n \"error\": {\n \"code\": 500,\n \"message\": \"Internal error encountered.\",\n \"errors\": [\n {\n \"message\": \"Internal error encountered.\",\n \"domain\": \"global\",\n \"reason\": \"backendError\"\n }\n ],\n \"status\": \"INTERNAL\"\n }\n}\n", @size=0, @positions=nil, @chunk_size=nil>, @previous=nil>
似乎只有 scheduledTime 有这个问题 - 如果我从请求中删除该字段,其他一切都创建得很好。
我正在将日期从 JS 传递到 Ruby,并且需要将纪元时间戳除以 1000 以使它们位于同一页面上。我不认为返回 500 是对我意外的大约会的正确回应,希望 Google 增加一些额外的处理。
我正在尝试通过他们的 API 创建一个 Google 课堂课程作业。具体来说,这个调用:https://developers.google.com/classroom/reference/rest/v1/courses.courseWork/create
我正在使用 Google Ruby API gem 这样做。
每次我尝试使用 scheduledTime 创建 CourseWork 时,我都会收到内部服务器错误。
请求示例:
Sending HTTP post https://classroom.googleapis.com/v1/courses/5022964882/courseWork?
{"description":null,"dueDate":null,"dueTime":null,"materials":[{"link":{"url":"https://google-c.gc.localhost.mine.com:3000/scores/view/f78df89b0f92be257f004501b7c4958216f2167b"}}],"maxPoints":null,"scheduledTime":{"seconds":1601913540000,"nanos":0},"state":"DRAFT","title":"test2","workType":"ASSIGNMENT"}
并回复:
#<HTTP::Message:0x00007f7fb2fdeee8 @http_header=#<HTTP::Message::Headers:0x00007f7fb2fdeec0 @http_version="1.1", @body_size=0, @chunked=false, @request_method="POST", @request_uri=#<Addressable::URI:0x3fbfd97efd78 URI:https://classroom.googleapis.com/v1/courses/5022964882/courseWork?>, @request_query=nil, @request_absolute_uri=nil, @status_code=500, @reason_phrase="Internal Server Error", @body_type=nil, @body_charset=nil, @body_date=nil, @body_encoding=#<Encoding:UTF-8>, @is_request=false, @header_item=[["Vary", "Origin"], ["Vary", "X-Origin"], ["Vary", "Referer"], ["Content-Type", "application/json; charset=UTF-8"], ["Content-Encoding", "gzip"], ["Date", "Mon, 26 Oct 2020 15:36:14 GMT"], ["Server", "ESF"], ["Cache-Control", "private"], ["X-XSS-Protection", "0"], ["X-Frame-Options", "SAMEORIGIN"], ["X-Content-Type-Options", "nosniff"], ["Alt-Svc", "h3-Q050=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000,h3-T051=\":443\"; ma=2592000,h3-T050=\":443\"; ma=2592000,h3-Q046=\":443\"; ma=2592000,h3-Q043=\":443\"; ma=2592000,quic=\":443\"; ma=2592000; v=\"46,43\""], ["Transfer-Encoding", "chunked"]], @dumped=false>, @peer_cert=#<OpenSSL::X509::Certificate: subject=#<OpenSSL::X509::Name CN=upload.video.google.com,O=Google LLC,L=Mountain View,ST=California,C=US>, issuer=#<OpenSSL::X509::Name CN=GTS CA 1O1,O=Google Trust Services,C=US>, serial=#<OpenSSL::BN:0x00007f7fb2fce818>, not_before=2020-10-06 06:40:00 UTC, not_after=2020-12-29 06:40:00 UTC>, @http_body=#<HTTP::Message::Body:0x00007f7fb2fdee48 @body="{\n \"error\": {\n \"code\": 500,\n \"message\": \"Internal error encountered.\",\n \"errors\": [\n {\n \"message\": \"Internal error encountered.\",\n \"domain\": \"global\",\n \"reason\": \"backendError\"\n }\n ],\n \"status\": \"INTERNAL\"\n }\n}\n", @size=0, @positions=nil, @chunk_size=nil>, @previous=nil>
似乎只有 scheduledTime 有这个问题 - 如果我从请求中删除该字段,其他一切都创建得很好。
我正在将日期从 JS 传递到 Ruby,并且需要将纪元时间戳除以 1000 以使它们位于同一页面上。我不认为返回 500 是对我意外的大约会的正确回应,希望 Google 增加一些额外的处理。