Error 403 - Google API - Classroom

Asked

Viewed 34 times

1

I have a python script that creates and links students from a certain list of Class room classes in Google via API.

The problem I’m having is the following, the student and inserted in more than one class in the first class he accuses me of error 403 that would be permission, but already for the next class he already passes correctly, then authentications are correct wanted to know what might cause this conflict only in the first class.

Error: {'error': {'code': 403, 'message': 'The Caller does not have permission', 'status': 'PERMISSION_DENIED'}}

Insertion function :

def Insert_Aluno_Turma(idCurso,body):
    url = "%s/%s/students?key=%s" % (URL_COURSES,idCurso,API)
    credentials = get_credentials()
    headers = {
        'Authorization': 'Bearer %s' % credentials.token,
        'Accept': 'application/json',
        'Content-Type': 'application/json',
    }
    response = requests.post(url,headers=headers,json=body)
    print(response.json())
    return response

I have tested with different students with different classes and the error persists always in the first class that the student will be inserted after being created he accuses the error permission, but in the next passes correctly.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.