Skip to content
This repository has been archived by the owner on Nov 9, 2021. It is now read-only.

Prototype

Pranav Kanade edited this page Apr 14, 2019 · 6 revisions

API Endpoint Listing

User

Sr No. Description API Endpoint Method
1 User Sign Up /api/user/signup/ POST
2 User Log In /api/user/login/ POST
3 Get logged in user's details /api/user/me/ GET
4 List all the courses user is enrolled in api/user/enrolledin/ GET
5 List all users /api/user/all/ GET

Sign UP

API

POST http://127.0.0.1:8000/api/user/signup/

BODY
{
username: user2,
email: user2@asdf.com,
password: asdfasdf,
is_producer: False
}
OUTPUT
{
    "user": {
        "id": 2,
        "username": "user2",
        "first_name": "",
        "last_name": "",
        "email": "user2@asdf.com",
        "is_producer": false,
        "date_joined": "2019-04-03T23:40:31.709334Z"
    },
    "company_name": null
}

Log In

This end point returns JWT auth token. It is supposed to be saved on the client side. It has to be passed as a part of header.

API

POST http://127.0.0.1:8000/api/user/login/

BODY
username: user1,
password: asdfasdf
OUTPUT
{
    "token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoxLCJ1c2VybmFtZSI6InVzZXIxIiwiZXhwIjoxNTU0NDQyODQxLCJlbWFpbCI6InVzZXIxQGFzZGYuY29tIiwib3JpZ19pYXQiOjE1NTQzMzQ4NDF9.Obfk4Rzp74MC2SujWEIfkK32NCo4jYRtTMYakaSVGQc"
}

Platform Contribution APIs

Lookup - Fix nested listing

Sr. No End Point Description Method
1 /api/course/ create and list courses POST and GET
2 /api/course/unt/ create unit POST
3 /api/course/<int:crs_id/unt/ list units of a course GET
4 /api/course/lsn/ create lesson POST
5 /api/course/<int:unt_id>/lsn/ list lessons of a unit GET
6 /api/course/ex/ create assignment POST
7 /api/course/<int:crs_id>/ex/ list assignment from a course GET
8 /api/course/<int:crs_id>/<int:unt_id>/ex/ list assignment from a course's unit GET
9 /api/course/<int:crs_id>/<int:unt_id>/<int:lsn_id>/ex/ list assignment from a course's unit's lesson GET
Clone this wiki locally