-
Notifications
You must be signed in to change notification settings - Fork 7
[Spec API] HomePage
Nguyen Bui Thien Dat edited this page Aug 1, 2023
·
9 revisions
This API will select the top 10 most registered courses
- GET: /api/courses/top-10
- None
- Success:
{
"success" : true,
"message": String,
"status_code": number
"data":[
{
"thumbnail": string,
"author": {
"first_name":string,
"last_name":string,
"id":number
}
"ratings": number,
"categories":[
{
"id": number,
"title": string,
}
],
"title": string,
"id": number,
"slug": string
}
]
}
- Failure:
{
"success": false,
"message": string,
"status_code": number
}
- 200: If the request is successful
- 400: If the request is failed
- 500: If the server is down
This API will select all the categories
- GET: /api/categories/
- None
- Success:
{
"success" : true,
"message": string,
"status_code": number
"data":[
{
"title": string,
"id": number
}
]
}
- Failure:
{
"success": false,
"message": string,
"status_code": number
}
Status code | Message | Description |
---|---|---|
200 | Get data successfully | Get top 10 courses data successfully, return data |
400 | Validation failed | Request body field missing |
500 | Server down | Server is down |