Represent API


The Represent API is based around Django Rest framework(link here) and uses DRF-Filters(link here) Most of the endpoints have some information about how to use them when visited in a browser


Most data is filterable - so looking at http://localhost:8000/api/users/ we can see users have an attrib username

we can filter to exact matches like this: http://localhost:8000/api/users/?username=chozabu

or this we can filter to exact matches like this: http://localhost:8000/api/users/?id=1

or do an exclude, rather than filter like this: http://localhost:8000/api/users/?id!=1

we can also change the page size (up to 30) http://localhost:8000/api/users/?page_size=20


The set of auth endpoints can be found at:

Sign up here:

and login here:

Either of this actions will get you an auth_token, which can be used in a header for a user to store data


Authorization: Token 9944b09199c62bcf9418ad846dd0e4bbdfc6ee4b

curl example:

curl -X GET -H 'Authorization: Token 9944b09199c62bcf9418ad846dd0e4bbdfc6ee4b'


lets say we want to find someone with "cho" in their name, in a case-insensitive manner: http://localhost:8000/api/users/?username__icontains=cho

add a double underscore __ to the end of the data you are looking up followed by an operator.

The available operators include:


contains - case sensitive contains

icontains - case insensitive contains

exact - case sensitive match (this is the default operator)

iexact - case insensitive match


gt - Greater than

gte - Equal or Greater than

lt - Less than

lte - Equal or Less than


isnull - (detail here)

in - (detail here)

The double underscore __ is also used for joins - it works for both 1-1 connections and 1-many, and is chainable over several steps.

so, if we want to find only users where someone has voted exactly 5 on one of their questions, we can try:


This can be combined with operators, find only users where someone has voted 3 or more on one of their questions:


info on some endpoints:

http://localhost:8000/api/ - Main list of API endpoints

http://localhost:8000/auth/ - Auth-related API endpoints

http://localhost:8000/api/users/ - members of represent

http://localhost:8000/api/questions/ - questions people have asked

http://localhost:8000/api/question_votes/ - Likert Votes

http://localhost:8000/api/choice_votes/ - MCQ Votes

http://localhost:8000/api/next_question/ - a special route to get a question the current user may want to see

GET /api/help/
Content-Type: application/json
Vary: Accept

    "info": "view this endpoint in your browser!"