title: Creating a student with Google Apps Script & Google Classroom
body: <p>GOAL:
  I am trying to use Google Apps Script &amp; the Google Classroom API to generate a student for a Google Classroom class.</p>
  
  <p>ERROR:
  Code: 404 &amp; message: Requested entity was not found.</p>
  
  <p>CODE:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>Classroom.Courses.Students.create(
              {
                "userId": "bwayne@school.edu",
                "profile": {
                  "name": {
                    "givenName": "Bruce",
                    "familyName": "Wayne"
                  }
                }
              }, 14496468106);</code></pre>
  </div>
  </div>
  </p>
  
  <p>THOUGHTS:
  I have tried many different variations replacing the course id with the a method to retrieve the code (ie. Classroom.Courses.list().courses[0].id) and the project scoped alias (ie. "p:abc123"). When I put in an incorrect courseId I receive the same error. Also, when I replace the userId with my email or the String "me" returns an error of code: 403, message: The caller does not have permission. When I replace the userId with a friend's ID there is an error message, the caller does not have permission. </p>
  
  <p>This may have something to do with permissions or formatting, but I haven't been able to figure out how to get this code to work.</p>
  
  <p>Thank you for your time!
  Jeremy</p>
  
  <p><img src="https://i.stack.imgur.com/WPUJA.png" alt="Google Classroom API Explorer"></p>