Skip to content

Google Classroom Turn In API bad request error #1979

Open
@mattszeto

Description

@mattszeto

Environment details

  • Programming language: Go
  • OS: Mac OS
  • Language runtime version: 1.19
  • Package version: google.golang.org/api/classroom/v1 , google.golang.org/api v0.87.0

Steps to reproduce

running this code snippet (given valid course id, coursework id and submission id...):

_,err = service.Courses.CourseWork.StudentSubmissions.TurnIn(submission.CourseID, submission.courseWorkID, submission.ID, &classroom.TurnInStudentSubmissionRequest{}).Context(ctx).Do()

gives this error:

googleapi: Error 400: Invalid JSON payload received. Unknown name "": Root element must be a message.
Details:
[
  {
    "@type": "type.googleapis.com/google.rpc.BadRequest",
    "fieldViolations": [
      {
        "description": "Invalid JSON payload received. Unknown name \"\": Root element must be a message."
      }
    ]
  }
]

I read the docs and found no information on what TurnInStudentSubmissionRequest is. It seem its only purpose is to provide an empty request body. So, my assumption is to just include an empty struct, but i am left with a 400 bad request error stating above issue.

Am I writing this call incorrectly?

Metadata

Metadata

Assignees

Labels

externalThis issue is blocked on a bug with the actual product.priority: p2Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions