Tutor LMS is fully integrated with the WordPress REST API. This allows Tutor LMS data to be created, read, updated, and deleted using JSON requests. It supports standard HTTP verbs and WordPress REST API Authentication methods.
Course API
The course API lets you create, view, update, and delete course data. You can also sort courses, provide course ratings, get course details, etc using these APIs.
Here are the attributes of Tutor LMS Course API:
Attributes | Type | Requirement | Description |
---|---|---|---|
post_author | Numeric | Required | Post author / admin ID |
post_date | Date-time | Optional | The date the course was created in the site’s timezone. The time will be in YYYY-MM-DD HH:MM:SS format. |
post_date_gmt | Date-time | Optional | The date the course was created as GMT time. |
post_content | String | Required | Course content |
post_title | String | Required | Course title |
post_excerpt | String | Optional | Course short description |
post_status | String | Required | Course status |
post_password | String | Optional | A password to protect your course |
comment_status | String | Optional | Whether or not comments are open on the object |
post_modified | Date-time | Optional | Course update time in the site’s timezone and YYYY-MM-DD HH:MM:SS format. |
post_modified_gmt | Date-time | Optional | Course update time in GMT and YYYY-MM-DD HH:MM:SS format. |
post_content_filtered | String | Optional | Filter course |
additional_content | Object | Optional | Set additional course content like course benefits, target audience, and duration. |
course_benefits | String | Optional | Set course benefits |
course_target_audience | String | Optional | Set target audience |
course_duration | Object | Optional | Sends course duration in hours and minutes |
hours | Numeric | Optional | Course duration in hours |
minutes | Numeric | Optional | Course duration in minutes |
course_material_includes | String | Optional | Get course materials |
course_requirements | String | Optional | Requirements for that course |
video | Object | Optional | Video objects like video source type and link |
source_type | String | Optional | Set video source type. Supported sources are external_url, shortcode, YouTube, Vimeo, and embedded videos. |
source | String | Optional | Video link |
course_level | String | Optional | Set course level. The supported levels are beginner, intermediate, and expert. |
course_categories | Array [Numeric] | Optional | Course categories as array |
course_tags | Array [Numeric] | Optional | Course tags in array format |
thumbnail_id | Numeric | Optional | Set course thumbnail ID |
Here’s the JSON file of Course API:
{
"post_author": 1,
"post_date": "2023-01-01 12:00:00",
"post_date_gmt": "2023-01-01 00:00:00",
"post_content": "Introduction to Mathematics is a fundamental course covering arithmetic, algebra, geometry, and basic statistics. It develops problem-solving and critical thinking skills, providing a solid foundation for further mathematical studies and practical applications.",
"post_title": "Introduction to Mathematics",
"post_excerpt": "Introduction to Mathematics is a fundamental course covering arithmetic, algebra, geometry, and basic statistics.",
"post_status": "publish",
"comment_status": "open",
"post_password": "",
"post_modified": "2023-01-01 12:30:00",
"post_modified_gmt": "2023-01-01 00:30:00",
"post_content_filtered": "",
"additional_content": {
"course_benefits": "Course benefits",
"course_target_audience": "Course target audience",
"course_duration": {
"hours": "1",
"minutes": "10"
},
"course_material_includes": "Course material includes",
"course_requirements": "Course requirements"
},
"video": {
"source_type": "youtube",
"source": "https://www.youtube.com/watch?v=iLlrIi9-NfQ"
},
"course_level": "beginner",
"course_categories": [161,163],
"course_tags": [18,19],
"thumbnail_id": 0
}
1. Course Create
URL: https://yourdomain.com/wp-json/tutor/v1/courses
Type: POST
2. Course Read
URL: https://yourdomain.com/wp-json/tutor/v1/courses?order=desc&orderby=ID&paged=1
Type: GET
3. Course Update
URL: https://yourdomain.com/wp-json/tutor/v1/courses/{course_id}
Type: POST, PUT, PATCH
4. Course Delete
URL: https://yourdomain.com/wp-json/tutor/v1/courses/{course_id}
Type: DELETE
5. Course Detail
URL: https://yourdomain.com/wp-json/tutor/v1/courses/{course_id}
Type: GET
6. Course Topic
URL: https://yourdomain.com/wp-json/tutor/v1/course-topic/{course_id}
Type: GET
7. Course Mark as Complete
URL: https://yourdomain.com/wp-json/tutor/v1/course-mark-complete
Type: POST
8. Course Sorting by Price
URL: https://yourdomain.com/tutor/wp-json/tutor/v1/course-sorting-by-price?order=asc&page=1
Type: GET
9. Course Rating by Course ID
URL: https://yourdomain.com/tutor/wp-json/tutor/v1/course-rating/{course_id}
Type: GET
10. Course by Terms
URL: https://yourdomain.com/tutor/wp-json/tutor/v1/course-by-terms
Type: POST
Topic API
The topic API allows you to create, view, update, and delete Tutor LMS course topics.
Here are the topic attributes:
Attributes | Type | Requirement | Description |
---|---|---|---|
topic_course_id | Numeric | Required | Set the unique topic ID |
topic_title | String | Required | Use topic title |
topic_summary | String | Optional | Provide a summary of the topic |
topic_author | Numeric | Required | Set admin/author ID |
Here’s the JSON file of Topic API:
{
"topic_course_id": 5607,
"topic_title": "Introduction to Mathematics.",
"topic_summary": "Introduction to Mathematics is a fundamental course covering arithmetic, algebra, geometry, and basic statistics.",
"topic_author": 1
}
1. Topics Create
URL: https://yourdomain.com/wp-json/tutor/v1/topics
Type: POST
2. Topics Read
URL: https://yourdomain.com/wp-json/tutor/v1/topics?course_id={course_id}
Type: GET
3. Topics Update
URL: https://yourdomain.com/wp-json/tutor/v1/topics/{topic_id}
Type: POST, PUT, PATCH
4. Topics Delete
URL: https://yourdomain.com/wp-json/tutor/v1/topics/{topic_id}
Type: DELETE
Lesson API
The lesson API lets you create, update, and delete lesson data. You can also sort lessons, and mark lessons as complete using these APIs.
Here are the attributes of Tutor LMS Lesson API:
Attributes | Type | Requirement | Description |
---|---|---|---|
topic_id | Numeric | Required | Set the lesson ID. |
lesson_title | String | Required | The title of the lesson. |
lesson_content | String | Optional | The content of the lesson. |
thumbnail_id | Numeric | Optional | Set lesson thumbnail ID |
lesson_author | Numeric | Required | Set lesson author ID |
video | Object | Optional | Video objects like source type, source and runtime |
source_type | String | Optional | Set video source type |
source | String | Optional | Set video source link |
runtime | Object | Optional | Runtime objects like hours, minutes, and seconds |
hours | Numeric | Optional | Video length hours |
minutes | Numeric | Optional | Video length minutes |
seconds | Numeric | Optional | Video length seconds |
attachments | Array [Numeric] | Optional | WordPress Media ID |
preview | Boolean | Optional | Set if preview will be allowed or not |
Here’s the JSON file of Lesson API:
{
"topic_id": 5608,
"lesson_title": "Introduction to Mathematics.",
"lesson_content": "Introduction to Mathematics is a fundamental lesson covering arithmetic, algebra, geometry, and basic statistics.",
"thumbnail_id": 1,
"lesson_author": 1,
"video": {
"source_type": "youtube",
"source": "https://www.youtube.com/watch?v=iLlrIi9-NfQ",
"runtime": {
"hours": "00",
"minutes": "10",
"seconds": "36"
}
},
"attachments": [110],
"preview": true
}
1. Lesson Create
URL: https://yourdomain.com/wp-json/tutor/v1/lessons/
Type: POST
2. Lesson by Topic ID
URL: https://yourdomain.com/wp-json/tutor/v1/lesson/{lesson_id}
Type: GET
3. Lesson Update
URL: https://yourdomain.com/wp-json/tutor/v1/lessons/{lesson_id}
Type: POST, PUT, PATCH
4. Lesson Delete
URL: https://yourdomain.com/wp-json/tutor/v1/lessons/{lesson_id}
Type: DELETE
5. Lesson Mark as Complete
URL: https://yourdomain.com/wp-json/tutor/v1/lesson-mark-complete
Type: POST
Assignment API
The assignment API of Tutor LMS will let you create, update, delete, and get assignment information by ID.
Here are the attributes of Assignment API:
Attributes | Type | Requirement | Description |
---|---|---|---|
topic_id | Numeric | Required | Assignment ID |
assignment_title | String | Required | Assignment title |
assignment_author | Numeric | Required | Assignment author name |
assignment_content | String | Optional | Assignment content |
attachments | Array | Optional | WordPress Media ID |
assignment_options | Object | Required | Assignment |
time_duration | Object | Optional | Deadline for submitting the assignment |
value | Numeric | Optional | Specify the time |
unit | String | Optional | Duration in days, weeks, months, or year |
total_mark | Numeric | Optional | Total mark for an assignment |
pass_mark | Numeric | Optional | Mininum number to pass the assignment |
upload_files_limit | Numeric | Optional | Set the upload file limit |
upload_file_size_limit | Numeric | Optional | Set the upload file size limit |
Here’s the JSON file of Assignment API:
{
"topic_id": 5587,
"assignment_title": "Math Assignment 1",
"assignment_author": 1,
"assignment_content": "<p>Assignment content</p>",
"attachments": [2278],
"assignment_options": {
"time_duration": {
"value": 1,
"unit": "weeks"
},
"total_mark": 10,
"pass_mark": 2,
"upload_files_limit": 1,
"upload_file_size_limit": 2
}
}
1. Course Assignment by ID
URL: https://yourdomain.com/wp-json/tutor/v1/course-assignment/{assignment_id}
Type: GET
2. Assignment Create
URL: https://yourdomain.com/wp-json/tutor/v1/assignments/
Type: POST
3. Assignment Update
URL: https://yourdomain.com/wp-json/tutor/v1/assignments/{assignment_id}
Type: POST, PUT, PATCH
4. Assignment Delete
URL: https://yourdomain.com/wp-json/tutor/v1/assignments/{assignment_id}
Type: DELETE
Assignment API (student section)
The assignment API of Tutor LMS will let you create, update, delete, and get assignment information by ID. It also allows students to get assignment information, attachment files, etc.
Here are the attributes:
Attributes | Type | Requirement | Description |
---|---|---|---|
assignment_id | Numeric | Required | Get assignment ID |
assignment_answer | String | Required | Get the student’s answers to the assignment |
student_id | Numeric | Required | Get students ID |
attached_assignment_files[] | Array | Required | Retrieves the attached assignment files |
Here’s the JSON file:
{
"assignment_id": "7651",
"assignment_answer": "Student’s assignment answer",
"student_id": 3,
"attached_assignment_files[]": files
}
1. Get Student Assignment Submit
URL: https://yourdomain.com/wp-json/tutor/v1/assignments?student_id={student_id}&assignment_id={assignment_id}
Type: GET
2. Student Assignment Submit
URL: https://yourdomain.com/wp-json/tutor/v1/assignment-submit
Type: POST
3. Student Assignment Update
URL: https://yourdomain.com/wp-json/tutor/v1/assignment-submit/{assignment_id}
Type: POST
4. Assignment Attachment
URL: https://yourdomain.com/wp-json/tutor/v1/assignment-attachment/{assignment_id}?file_name={file_name}
Type: POST
Quiz API
The quiz API lets you create, update and delete quizzes as well as quiz questions. You can also get quizzes, quiz questions, and quiz attempt details using quiz ID.
Here are the attributes of quiz API:
Attributes | Type | Requirement | Description |
---|---|---|---|
topic_id | Numeric | Required | Unique identifier for the quiz |
quiz_title | String | Required | Title of the quiz |
quiz_author | String | Required | The ID for the author of the quiz |
quiz_description | String | Optional | Description of the quiz |
quiz_options | String | Required | Quiz options |
time_limit | Object | Optional | Time limit for the quiz |
time_value | Numeric | Optional | Specify the time |
time_type | String | Optional | Specify the time units. Allowed units are seconds, minutes, hours, days, and weeks. |
feedback_mode | String | Optional | Provide feedback. Allowed feedback modes are default, reveal, and retry. |
question_layout_view | String | Optional | Appearance of the questions |
attempts_allowed | Numeric | Optional | Specifies how many attempts are allowed |
passing_grade | Numeric | Optional | Specifies the passing grade |
max_questions_for_answer | Numeric | Optional | Maximum number of questions for answer |
questions_order | String | Optional | Set the question order |
short_answer_characters_limit | Numeric | Optional | Character limit for the ‘short answer’ type questions |
open_ended_answer_characters_limit | Numeric | Optional | Character limit for the ‘open ended’ type questions |
Here’s the JSON file of Quiz API:
{
"topic_id": 5587,
"quiz_title": "Mathematics quiz",
"quiz_author": 1,
"quiz_description": "Introduction to Mathematics quiz.",
"quiz_options": {
"time_limit": {
"time_value": 1,
"time_type": "minutes"
},
"feedback_mode": "default",
"question_layout_view": "question_below_each_other",
"attempts_allowed": 10,
"passing_grade": 80,
"max_questions_for_answer": 10,
"questions_order": "rand",
"short_answer_characters_limit": 200,
"open_ended_answer_characters_limit": 500
}
}
1. Quiz by Topic ID
URL: https://yourdomain.com/wp-json/tutor/v1/quiz/{quiz_id}
Type: GET
2. Quiz Questions Answer by Quiz ID
URL: https://yourdomain.com/wp-json/tutor/v1/quiz-question-answer/{quiz_id}
Type: GET
3. Quiz Quiz Attempts Details By Quiz ID
URL: https://yourdomain.com/tutor/wp-json/tutor/v1/quiz-question-answer/{quiz_id}
Type: GET
4. Quiz Create
URL: https://yourdomain.com/wp-json/tutor/v1/quizzes
Type: POST
5. Quiz Update
URL: https://yourdomain.com/wp-json/tutor/v1/quizzes/{quiz_id}
Type: POST, PUT, PATCH
6. Quiz Delete
URL: https://yourdomain.com/wp-json/tutor/v1/quizzes/{quiz_id}
Type: DELETE
7. Question Create
URL: https://yourdomain.com/wp-json/tutor/v1/quiz-questions
Type: POST
8. Question Update
URL: https://yourdomain.com/wp-json/tutor/v1/quiz-questions/{question_id}
Type: POST, PUT, PATCH
9. Question Delete
URL: https://yourdomain.com/wp-json/tutor/v1/quiz-questions/{question_id}
Type: Delete
10. Quiz Details
URL: https://yourdomain.com/wp-json/tutor/v1/quizzes/{quiz_id}
Type: PUT
Quiz Attempt API
You can use the Quiz Attempt API to collect students quiz attempt data.
Here are the attributes of quiz attempt API:
Attributes | Type | Requirement | Description |
---|---|---|---|
course_id | Numeric | Required | Unique id for the attempted quiz’s course |
student_id | Numeric | Required | ID of the student who attempted the quiz |
quiz_id | Numeric | Required | ID of the quiz attempted by the student |
quiz_question_answers | Array | Required | Answers provided for each question in the quiz |
question_id | Numeric | Required | Specific ID of each question |
question_type | String | Required | Type of quiz question selected |
answer | String | Array | Int | Required | Correct answer for the quiz |
Here’s the JSON file of Assignment API:
{
"course_id": 5708,
"student_id": 2,
"quiz_id": 5766,
"quiz_question_answers": [
{
"question_id": 204,
"question_type": "true_false",
"answer": 461
},
{
"question_id": 205,
"question_type": "fill_in_the_blanks",
"answer": ["large", "dust", "traffic"]
},
{
"question_id": 206,
"question_type": "multiple_choice",
"answer": [460, 465]
}
]
}
1. Attempt Create
URL: https://yourdomain.com/wp-json/tutor/v1/quiz-attempts
Type: POST
2. Single Attempt
URL: https://yourdomain.com/wp-json/tutor/v1/quiz-attempts/{attempt_id}
Type: GET
3. Quiz Attempts
URL: https://yourdomain.com/wp-json/tutor/v1/quiz-attempts?quiz_id={quiz_id}&student_id={student_id}
Type: GET
Enrollment API
The enrollment API facilitates seamless onboarding of the users in a Tutor LMS course.
Here are the attributes of enrollment API:
Attributes | Type | Requirement | Description |
---|---|---|---|
user_id | Numeric | Required | Enroll in a specific course by User ID |
course_id | Numeric | Required | Input course ID for user enrollment |
enrollment_id | Numeric | Required (only for enrollment status) | Set enrollment ID |
Here’s the JSON file of Assignment API:
{
"user_id": 2,
"course_id": 5607
}
1. Do Enrollment
URL: https://yourdomain.com/wp-json/tutor/v1/enrollments
Type: POST
2. Update Enrollment Status
URL: https://yourdomain.com/wp-json/tutor/v1/enrollments/completed
Type: PUT
Note: The available enrollment statuses are cancel, completed, expired, failed, on-hold, pending, processing, and refunded.
3. Get Enrolled Users
URL: https://yourdomain.com/wp-json/tutor/v1//enrollments?course_id={course_id}
Type: GET
Wishlist API
The Wishlist API enables users to add courses to their wishlist. It requires the user’s ID and the ID of the course they want to add.
Here are the attributes of Tutor LMS Wishlist API:
Attributes | Type | Requirement | Description |
---|---|---|---|
user_id | Numeric | Required | Input the unique user ID |
course_id | Numeric | Required | Input the unique identifier for courses |
Here’s the JSON file of Wishlist API:
{
"user_id": 3,
"course_id": 7398
}
1. Student Wishlist List
URL: https://yourdomain.com/wp-json/tutor/v1/wishlists?user_id={user_id}
Type: GET
2. Student Wishlist Add
URL: https://yourdomain.com/wp-json/tutor/v1/wishlists
Type: POST
3. Student Wishlist Delete
URL: https://yourdomain.com/wp-json/tutor/v1/wishlists?user_id={user_id}&course_id={course_id}
Type: DELETE
Review API
The Review API can be used to get the list of course reviews or add, delete, and update the student’s review for a specific course.
Here are the attributes of Tutor LMS Review API:
Attributes | Type | Requirement | Description |
---|---|---|---|
user_id | Numeric | Required | Input the unique user ID |
course_id | Numeric | Required | Input course ID to get the reviews |
rating | Numeric | Required | Get course rating |
review | String | Required | Get course review |
Here’s the JSON file of Review API:
{
"user_id": 3,
"course_id": 7461,
"rating": 5,
"review": "Great lessons"
}
1. User Review List
URL: https://yourdomain.com/wp-json/tutor/v1/reviews?user_id={user_id}
Type: GET
2. User Review Add
URL: https://yourdomain.com/wp-json/tutor/v1/reviews
Type: POST
3. User Review Update
URL: https://yourdomain.com/wp-json/tutor/v1/reviews/{course_id}
Type: POST
4. Delete Review
URL: https://yourdomain.com/wp-json/tutor/v1/reviews/{course_id}?user_id={user_id}
Type: POST
Student Dashboard API
URL: https://yourdomain.com/wp-json/tutor/v1/students/{student_id}/dashboard
Type: GET
Calendar API
URL: https://yourdomain.com/wp-json/tutor/v1/students/{student_id}/calendar
Type: GET
Get Student Course List API
URL: https://yourdomain.com/wp-json/tutor/v1/students/{student_id}/courses
Type: GET
Instructor API
URL: https://yourdomain.com/wp-json/tutor/v1/become-instructor/{user_id}
Type: PUT
Order History API
URL: https://yourdomain.com/wp-json/tutor/v1/students/{student_id}/order-histories
Type: GET
Profile Management API
1. Quiz Attempts Get
URL: https://yourdomain.com/wp-json/tutor/v1/profile/{user_id}
Type: GET
2. Update Profile
URL: https://yourdomain.com/wp-json/tutor/v1/update-profile
Type: PUT
3. Upload Photo
URL: https://yourdomain.com/wp-json/tutor/v1/upload-photo/profile-photo
Type: POST
4. Delete Photo
URL: https://yourdomain.com/wp-json/tutor/v1/delete-photo/profile-photo/{user_id}
Type: DEL
5. Update Password
URL: https://yourdomain.com/wp-json/tutor/v1/update-password
Type: PUT
Q&A API
The Q&A API is used to get the student’s Q&A list and update, delete, or add new Q&A.
Here are the attributes of Tutor LMS Q&A API:
Attributes | Type | Requirement | Description |
---|---|---|---|
user_id | Numeric | Required | Input the unique user ID |
course_id | Numeric | Required | Input course ID to get the Q&A |
question_id | Numeric | Required | Input the unique question ID |
qna_text | String | Required | Get the Q&A text |
Here’s the JSON file of Review API:
{
"user_id": 3,
"course_id": 7378,
"question_id": 0,
"qna_text": "Write your reply here."
}
1. User QA List
URL: https://yourdomain.com/wp-json/tutor/v1/qna?user_id={user_id}&offset={offset}&limit={limit}
Type: GET
2. User QA Add Update
URL: https://yourdomain.com/wp-json/tutor/v1/qna
Type: POST
3. User QA Mark Read Undread
URL: https://yourdomain.com/wp-json/tutor/v1/qna-mark-read-unread/{comment_id}
Type: POST, PUT, PATCH
4. Delete QA
URL: https://yourdomain.com/wp-json/tutor/v1/qna/{comment_id}?user_id={user_id}
Type: DEL