0

I'm trying delete an announcement in Google Classroom but I can't, this's my code:

function doPatch(){
  /*Course ID*/
  var courseId = "14887945865";
  /*Announcements ID*/
  var id = "15923451820";

  //Try delete using remove
  
  Classroom.Courses.Announcements.remove(courseId, id);
  
  /*
  Log ERROR: @ProjectPermissionDenied The Developer Console project is not permitted to make this request
  */
  
  //Try update with path, PUBLISHED -> DELETED
  
  /*
  var resource = {  
    'state': 'DELETED'  
  }  
  
  Classroom.Courses.Announcements.patch(resource, courseId, id, {
      'updateMask':'state'  
    });
  */
  
  /*
  Log ERROR: state: State can only be changed to PUBLISHED
  */
}

First, I tried directly using remove, but show this error:

@ProjectPermissionDenied The Developer Console project is not permitted to make this request

Second, I tried update state to DELETE and show this:state: State can only be changed to PUBLISHED

Any idea? Could you help me?

Thank you, very much.

  • Have you checked this out https://stackoverflow.com/questions/38313748/google-classroom-api-modifyattachments ? – Umair Mohammad Jul 12 '18 at 09:07
  • Possible duplicate of [Google Classroom API modifyAttachments](https://stackoverflow.com/questions/38313748/google-classroom-api-modifyattachments) – tehhowch Jul 12 '18 at 11:22

0 Answers0