Search code examples
androidgoogle-classroom

How to access Classroom Course Stream using Google Classroom API


I was finally able to access the Google classroom API from an Android app even though the Authorization flow used here doesn't work in an Android environment.

Now I can view all courses, the description etc but not the discussions in the Classroom (labeled Stream in the Google android Classroom app and Web App).

The Google classroom android app is so poor and buggy and always crashes that's why I decided to embark on this project.

So my question is how can I get this? I can't find such a call in the API documentation.


Solution

  • The Stream from Google Classroom is split into different elements so, depending on the type of elements you have and want to retrieve from the Classroom Stream, you might benefit from checking the following requests:

    Retrieving the announcements

    GET https://classroom.googleapis.com/v1/courses/{courseId}/announcements
    

    Retrieving the courseworks

    GET https://classroom.googleapis.com/v1/courses/{courseId}/courseWork
    

    Retrieving the coursework materials

    GET https://classroom.googleapis.com/v1/courses/{courseId}/courseWorkMaterials
    

    Note

    Also, please bear in mind that all these requests will return the information needed only if the user making the request has access and the necessary permissions for retrieving it.

    The quickstart you mentioned is a Java one - so in order to make it work for Android you will have to adapt it properly to your needs.

    Reference