Listening Manager API Documentation

Documentation for Listening Manager Backend with Node JS.

Audios

HTTP URI Description
GET /audios Retrieve all audio list
GET /audios/{id} Retrieve audio specified by id
POST /audios Store new audio
PUT /audios/{id} Update audio specified by id
DELETE /audios/{id} Delete audio specified by id

Retrieve All Audio

GET /audios
Optional Params :
    -> search
Response Body :
{
    "datas": [
        {
            "id": 3,
            "name": "IBT_VAR_1",
            "path": "public/...",
            "categories":[
                {
                    "id": 3,
                    "name": "IBT"
                },
                {
                    "id": 2,
                    "name": "TPKS"
                }
            ]
        },
        {
            "id": 2,
            "name": "TOEFL_VAR_7",
            "path": "public/...",
            "categories":[
                {
                    "id": 3,
                    "name": "IBT"
                },
                {
                    "id": 2,
                    "name": "TPKS"
                }
            ]
        }
    ]
}

With Specified ID

GET /audios/{id}
Response Body: 
{
            "id": 2,
            "name": "TOEFL_VAR_7",
            "path": "public/...",
            "categories":[
                {
                   "id": 3,
                    "name": "IBT"
                },
                {
                    "id": 2,
                    "name": "TPKS"
                }
            ]
        }

Store New Audio

POST /audios

Request Body :
- audio_name : string
- audio_file : file[audio/mpeg,audio/ogg]
- categories : array with value integer (ex: [2,5,4])
Response Body: OK

Update Audio

PUT /audios/{id}

Request Body :
- audio_name : string
- audio_file : file[audio/mpeg,audio/ogg]
- categories : [] array of integer
Response Body: OK

Delete Audio

DELETE /audios/{id}
Response Body: OK

Categories

HTTP URI Description
GET /categories Retrieve all category list
GET /categories/{id} Retrieve category specified by id
POST /categories Store new category
PUT /categories/{id} Update category specified by id
DELETE /categories/{id} Delete category specified by id

Retrieve All Category

GET /categories
Optional Params :
    -> search
Response Body :
{
    "datas": [
        {
            "id": 3,
            "name": "IBT"
        },
        {
            "id": 2,
            "name": "TPKS"
        }
    ]
}

With Specified ID

GET /categories/{id}
Response Body :
{
    "id": 1,
    "name": "adsfdsaf"
}

Store New Category

POST /categories/{id}

Request Body :
- category_name
Response Body: OK

Update Category

PUT /categories/{id}

Request Body :
- category_name
Response Body: OK

Delete Category

DELETE /categories/{id}
Response Body: OK

Subjects

HTTP URI Description
GET /subjects Retrieve all subject list
GET /subjects/{id} Retrieve subject specified by id
POST /subjects Store new subject
PUT /subjects/{id} Update subject specified by id
DELETE /subjects/{id} Delete subject specified by id

Retrieve All Subject

GET /subjects
Optional Params :
    -> search
Response Body :
{
    "datas": [
        {
            "id": 3,
            "name": "ENGL1122"
        },
        {
            "id": 2,
            "name": "ENGL1212"
        }
    ]
}

With Specified ID

GET /subjects/{id}
Response Body :
{
    "id": 2,
    "name": "ENGL1212"
}

Store New Subject

POST /subjects/{id}

Request Body :
- subject_name
Response Body: OK

Update Subject

PUT /subjects/{id}

Request Body :
- subject_name
Response Body: OK

Delete Subject

DELETE /subjects/{id}
Response Body: OK