Skip to content

feat: add enrollment put/delete API routes#1413

Open
chrononyan wants to merge 1 commit intookpy:masterfrom
chrononyan:feat/api/write-enrollment
Open

feat: add enrollment put/delete API routes#1413
chrononyan wants to merge 1 commit intookpy:masterfrom
chrononyan:feat/api/write-enrollment

Conversation

@chrononyan
Copy link
Copy Markdown

These models still confuse me.

GET /api/v3/course/<offering>/enrollment/<email>

$ curl 'http://127.0.0.1:5000/api/v3/course/cal/cs61a/sp16/enrollment/okstaff@okpy.org?access_token=access1'
{
    "code": 200,
    "data": {
        "class_account": "",
        "role": "staff",
        "section": "",
        "user": {
            "email": "okstaff@okpy.org",
            "id": "asdf"
        }
    },
    "message": "success"
}

DELETE /api/v3/course/<offering>/enrollment/<email> works the same as the frontend batch-enroll-CSV

$ curl 'http://127.0.0.1:5000/api/v3/course/cal/cs61a/sp16/enrollment/okstaff@okpy.org?access_token=token' -X DELETE
{
    "code": 200,
    "data": {},
    "message": "success"
}

PUT /api/v3/course/<offering>/enrollment works the same as the frontend batch-enroll-CSV

$ curl 'http://127.0.0.1:5000/api/v3/course/cal/cs61a/sp16/enrollment?access_token=token' -X PUT -H 'Content-Type: application/json' -d '{"role":"student","csv":"okstaff@okpy.org,Staff,,,"}'
{
    "code": 200,
    "data": {
        "new": 1,
        "updated": 0
    },
    "message": "success"
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant