Google classroom implementation

It’s not an error, just the course id is null, and owner id and course id are different, course id is to represent the code


Did You try Insert Id=“123” in this array course ?

yes but it showed me an error…wait ill show you the error

What you Insert in course variable ?

GoogleJsonResponseException: API call to classroom.courses.create failed with error: Invalid JSON payload received. Unknown name “Id” at ‘course’: Cannot find field. (line 298, file “Code”)
here’s the error

it is the resources that are required

How did you make the id declaration.
The variable ID is not being passed.

if you are talking about owner id then it’s a format in which there’s no need to declare it

Did you include the id in the array course?

When I include I get the error posted

You include ID ,Id or id ?

Tried all three but get the error

Strange: the logic, even if I don’t know this language, is to fill the array course vector with the required parameters. I don’t have access to your script and I can’t make a Debugger.

So let’s start with 0 , we’ll create a new code,

1 Like

This is the code i found on github,

function createCourse() {
      var course = {
        name: '10th Grade Biology',
        section: 'Period 2',
        descriptionHeading: 'Welcome to 10th Grade Biology',
        description: "We'll be learning about about the structure of living creatures from a combination of textbooks, guest lectures, and lab work. Expect to be excited!",
        room: '301',
        ownerId: 'me',
        courseState: 'PROVISIONED'
      };
      var course = Classroom.Courses.create(course);
      Logger.log('Course created: %s (%s)', course.name, course.id)
    }

But there’s nothing mentioned about course id

Maybe you can edit this code and let me know @Rogerio_Rios

But where will I test? Do I have to create my key in Google Class? Where does this code run?

I found what was the mistake…

in my previous code i hadn’t declared it as var course that’s why now i get proper values

It works? First, it is declared as an array and then it receives the return from the Create function where it itself was passed as parameters? :scream:
And the last line “course.id” ?

Where does this code run?