REST API documentation

Is there an up to date documentation about the REST API details?

I found an old version at https://zambia-intrahealth.readthedocs.io/en/latest/dev/api.html but this seems to be outdated and maybe not matching. I can get some information from that but don’t know if the usage is correct.

Hi @juergi,

The old version you mention is still correct for several endpoints. The differences being that now the Quiz, Question, QuizProps and QuizQuestion, Response and Schedule endpoints no longer exist - these were basically there for the course publication process from Moodle and now this is handled in a different way.

The API is basically just used for the app to communicate with the server, rather than the API being used for extracting data etc.

We’ve not yet had chance to update the API docs on the main docs, which is why it’s been removed from there (I thought best not to have the docs at all if they were not correct and up to date).

However you can view the endpoints code at:
https://github.com/DigitalCampus/django-oppia/tree/master/api/resources - for the general endpoints the app uses
https://github.com/DigitalCampus/django-oppia/blob/master/quiz/api/resources.py - for the quiz attempt tracking

Hope that’s useful?
Cheers,
Alex

Hi Alex,

thank you for the information, that is very important to know for us.

We are evaluating if we can get some information from the server with a different app than the android app although using this too. So the API can be of great use to us.

For the python code: That would be the next thing to having looked into, so thank you for pointing that out for me. Makes things much easier.

Thanks,

Jürgen

No problem!

Couple of other things that might be helpful for you…

You can see the endpoints at: https://demo.oppia-mobile.org/api/v2/
Most of the endpoints are for post requests (from the app), and almost all require the user & api_key info.

But an example for a get request is the ‘tag’ endpoint (show the categories/tags that the courses are listed under) and you can view this directly in your browser with:
https://demo.oppia-mobile.org/api/v2/tag/?username=XXXXXXX&api_key=XXXXXXX&format=json

Just replace with your server, username and api_key - you can find your api_key in the edit profile section in the server dashboard

Hope that helps.
BTW… I’d be very interested to know more about the work you and team are doing, let me know if you’re free for a skype call sometime, my email is alex@digital-campus.org.

Cheers,
Alex

A mid/long-term roadmap development would be to migrate the current API functionality to DRF (Django REST Framework), that among other nice advantages can auto-generate full openAPI schema definitions for API docs generators like swagger or Redoc to fetch from.

We could try using a project that does that for django-tastypie, but from what I’ve been looking, the project seems a bit dead (latest update was more than four years ago). There is a fork that says that has support for current Django/tastypie versions: