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.