According to Google's documentation, the structure of a course in the response should contain the enrollment code, however, the response I am getting has a structure like this:
{
alternateLink,
calendarId,
courseGroupEmail,
courseState,
creationTime,
descriptionHeading,
guardiansEnabled,
id,
name,
ownerId,
room,
section,
teacherGroupEmail,
updateTime
}
Notice the enrollment code missing
I'm getting them like this:
async getClassesWhereStudent(auth: any, classes: any[] = [], pageToken?: string) {
const classroom = google.classroom({ version: 'v1', auth })
const { courses, nextPageToken } = (await classroom.courses.list({
pageSize: 100,
courseStates: ['ACTIVE'],
studentId: 'me',
pageToken
})).data
if (courses)
classes.push(...courses);
return nextPageToken ? await this.getClassesWhereStudent(auth, classes, nextPageToken) : classes;
}
I've already tried requesting it straight from the API: https://classroom.googleapis.com/v1/courses and the results are the same
enrollmentCode
enrollmentCode