REST API

This page describes the various REST API methods that may be called, what input/ouput they will accept/provide.

For almost all the API methods you will need to supply a username and api_key (either as post or get parameters) otherwise you will get an HTTP 401 Unauthorized response

It is quite unlikely you will need to access these methods directly yourself, since the OppiaMobile client app handles all the API calls already.

By default all the methods will return JSON object(s).

Awards

Gets all the badges which have been awarded to the given user.

Badges

Gets all the badges that are currently available on the server.

Course

Gets all the courses currently available on the server, and includes the link to download the course zip file

Points

Gets all the points for the given user

Question

For creating or returning a quiz question

  • Available methods: GET, POST

  • Required parameters (for both GET and POST requests):

    • username
    • api_key
  • Required POST parameters:

    • title
    • type
  • Example GET request: http://localhost/api/v1/question/59/?format=json&username=XXXX&api_key=XXXXXXXX

  • Example CURL POST request:

    curl --dump-header - -H "Accept: application/json" -H "Content-Type: application/json" -X POST --data '{"title":"A woman has sexual intercourse with a man who is HIV-positive. She is tested for HIV infection two weeks after this sexual intercourse. Her HIV test is negative. Should you trust this result?","type":"multichoice","responses":[],"props":[{"name":"maxscore","value":"1.0000000"}]}' "http://localhost/api/v1/question/?format=json&username=XXXX&api_key=XXXXXXXX"

Quiz

QuizAttempt

QuizProps

QuizQuestion

Register

Response

Schedule

Scorecard

Tag

Tracker

User

Table Of Contents

Previous topic

Upgrading

Next topic

Change Log

This Page