2

I'm using the Google Classroom API with Python, and am trying to invite a student to a course, using the invitations.create() method. However, I keep getting a "404 requested entity not found" error, and I'm unsure what's causing it.

service = build('classroom', 'v1', credentials=creds)
info = {
  "userId": "zariftwitters@gmail.com",
  "courseId": "117906298438634973718",
  "role": "STUDENT"
}
i = service.invitations().create(body=info).execute()

Error message:

Http Error 404 when requesting
https://classroom.googleapis.com/v1/invitations?alt=json returned
"Requested entity was not found."

Azametzin
  • 5,223
  • 12
  • 28
  • 46

1 Answers1

1

Most likely it means that the course Id is incorrect

  • The course Id should contain 11 numbers.
  • You can list all courses and their Ids with the method courses.list, the easiest way to do it would be with the Try this API.
ziganotschka
  • 25,866
  • 2
  • 16
  • 33