Using API to get Gradebook CSV export

Community Member

I need to obtain the same csv/information you get when you export a gradebook, but via API/without going through the GUI. This includes final grades, all assignment grades, assignment names and ids, max scores, , and the grade for each assignment group for each student.

Here are my two attempts that have gotten me closest to my goal.

1. I've been able to obtain all final grades via the enrollment API, and all assignment details/grades via the submissions API, and then synthesize these together into a gradebook-esque csv. However, this doesn't give me assignment group grades , which are included in csv when you export the gradebook. Ideally, I would want all 3. Or if that's impossible, inform me how to get each student's assignment group grade (posted and unposted).
2. Some people have given hints that if you make a post call to{courseid}/gradebook_csv, that you could theoretically start the download this way and then obtain the csv when its done downloading. However, whenever I do this, the only thing returned is "session timeout." I presume there is some authentication I'm missing (as I'm only providing my authentication token like it was an API endpoint), but I have no clue what it is. 


If anyone could help me complete the missing step on these last two attempts, or provide me a completely alternative working process, I would be grateful