Skip to content

Latest commit

 

History

History
167 lines (116 loc) · 1.92 KB

lessons.md

File metadata and controls

167 lines (116 loc) · 1.92 KB

Lessons


Retrieve all lessons in the course

api.ayat.com/v1/programs/{id}/courses/{id}/lessons GET

Payload:
{
    "jwt":  "32132143432432"
}
Success Response:

code : 200

Json retrive list of lessons with IDs
Error Response:

code: 403

{
  "error": "user is unauthorized"
}

Retrieve a specific lesson in the course

api.ayat.com/v1/programs/{id}/courses/{id}/lessons GET

Payload:
{
    "jwt":  "32132143432432"
}
Success Response:

code : 200

{
    "name":   "lessonName",
    "order":  "1",
    "objective":  "123123",
    "content":   "content example"
}
Error Response:

code: 403

{
  "error": "user is unauthorized"
}

Create a new lesson in the course

api.ayat.com/v1/programs/{id}/courses/{id}/lessons POST

Payload:
{
    "jwt":  "32132143432432",
    "order":  "1",
    "name":  "example",
    "objective":  "123123",
    "content":   "content example"
}
Success Response:

code : 200

{
    "status":   "<Duplicate resource codes>"
}
Error Response:

code: 403

{
  "error": "user is unauthorized"
}

Update lesson in the course

api.ayat.com/v1/programs/{id}/courses/{id}/lessons/{id} PUT

Payload:
{
    "jwt":  "32132143432432",
    "order":  "1",
    "name":  "example",
    "objective":  "123123",
    "content":   "content example"
}
Success Response:

code 200:

{
    "status":  "updated"
}

or

{
    "status":  "<Duplicate resource codes>"
}

How to delete lesson from database

api.ayat.com/v1/programs/{id}/courses/{id}/lessons/{id} DELETE

Payload:
{
    "jwt":   "ffff"
}
Success Response:

code 200:

{
    "status":  "deleted"
}