2

So, I'm trying to use the new StudentSubmissions section of the API to search for student submissions in a particular course. When I try using the "Try It!" portion of the resource page, it works fine, but when I run it in my script, I get the following error:

"The caller does not have permission (line 6, file "silo test")"

I have also gotten the error "The requested identity does not exist"

I am a Super Admin on the domain, this is my course that I am the teacher of, and it should be noted that when I do Classroom.Courses.CourseWork.list(deCourse), it works fine and gives me an array of the coursework for the course, but the StudentSubmissions piece keeps erroring out. I know that I can add the userId separately do only look for a particular student, but that doesn't fix it either.

Thoughts?!

function siloTest() {

 var nick = { teacherId: "nmarchese@berkeleycarroll.org"} 
var courses = Classroom.Courses.list(nick);  
var deCourse = courses.courses[5].id;

   var late = Classroom.Courses.CourseWork.StudentSubmissions.list(deCourse, "-");  
}

1 Answers1

0

Make sure that your app script is associated with the correct dev console project. It should be associated with the dev console project id that corresponds with your OAuth 2.0 client ID. This should also have "Apps Script Execution API" enabled.

We have to assign permission under Developer Console Project for the project which the apps-script is associated. So follow these steps:

  • Open your apps script.
  • Go to Resources-Developers Console Project.
  • Click on the project name appearing in blue under "This script is currently associated with project:". It will redirect you to Developer Console Project.
  • Click on Menu on the left hand side upper corner and click on Permissions.
  • Under Permissions, click on Add members.
  • In the member, type the email ID or domain you want to provide permission and desired permission level.
  • Click on 'Add'.

Check these related questions:

Community
  • 1
  • 1
abielita
  • 13,147
  • 2
  • 17
  • 59
  • Yes, I believe I've done that all. It appears to be all set with what you've said. I made sure the dev console project was linked correctly (I believe) and gave myself all the permissions I could. No dice. I'm worried that it isn't asking for OAuth for an additional scope, such as https://www.googleapis.com/auth/classroom.courses.students? I'm trying to figure out how to manually authorize that scope, maybe that will do it? – Nick Marchese May 25 '16 at 16:27
  • I feel like some scopes haven't been updated in the library. – Nick Marchese May 25 '16 at 16:44
  • 1
    I got it to work. The library hasn't been updated to include the correct scope so I had to authorize it manually. – Nick Marchese May 27 '16 at 13:04
  • Nick, how do you authorize it manually? Do you mean by asking the user for scope acceptance manually or by adding the scope manually to the project somehow? – The Fat Oracle May 03 '17 at 19:36