### Short Answer Quiz Question Example Source: https://docs.themeum.com/tutor-lms/developer-documentation/rest-apis-for-tutor-lms-pro/index An example JSON object for a 'short_answer' quiz question. This type requires a brief textual response from the user. ```json { "quiz_id": 5598, "question_title": "Write a short answer about Software Engineering", "question_type": "short_answer", "answer_required": 1, "randomize_question": 1, "question_mark": 1.00, "show_question_mark": 1, "answer_explanation": "\n\nAnswer explanation\n\n", "question_description": "\n\nDummy description\n\n" } ``` -------------------------------- ### Matching Quiz Question Example Source: https://docs.themeum.com/tutor-lms/developer-documentation/rest-apis-for-tutor-lms-pro/index An example JSON object for a 'matching' quiz question. It includes two lists ('left' and 'right') for items to be matched and a 'correct_answer' object mapping them. ```json { "quiz_id": 5594, "question_title": "Match the following programming languages with their primary use", "question_type": "matching", "matching_options": { "left": ["HTML", "Python", "CSS", "SQL"], "right": ["Styling", "Database", "Markup", "Scripting"] }, "correct_answer": { "HTML": "Markup", "Python": "Scripting", "CSS": "Styling", "SQL": "Database" }, "answer_required": 1, "randomize_question": 1, "question_mark": 2.00, "show_question_mark": 1, "answer_explanation": "\n\nAnswer explanation\n\n", "question_description": "\n\nDummy description\n\n" } ``` -------------------------------- ### Single Choice Quiz Question Example Source: https://docs.themeum.com/tutor-lms/developer-documentation/rest-apis-for-tutor-lms-pro/index An example JSON object for a 'single_choice' quiz question. It features a list of options and specifies the correct answer from those options. ```json { "quiz_id": 5592, "question_title": "Choose the NoSQL database from the list below", "question_type": "single_choice", "options": ["MySQL", "Mongo DB", "postgreSQL"], "correct_answer": "Mongo DB", "answer_required": 1, "randomize_question": 1, "question_mark": 1.00, "show_question_mark": 1, "answer_explanation": "\n\nAnswer explanation\n\n", "question_description": "\n\nDummy description\n\n" } ``` -------------------------------- ### Open Ended Quiz Question Example Source: https://docs.themeum.com/tutor-lms/developer-documentation/rest-apis-for-tutor-lms-pro/index An example JSON object for an 'open_ended' quiz question. This type allows for a more detailed, free-form response from the user. ```json { "quiz_id": 5591, "question_title": "Describe your understanding of Data Structures with examples", "question_type": "open_ended", "answer_required": 1, "randomize_question": 1, "question_mark": 2.00, "show_question_mark": 1, "answer_explanation": "\n\nAnswer explanation\n\n", "question_description": "\n\nDummy description\n\n" } ``` -------------------------------- ### Fill in the Blanks Quiz Question Example Source: https://docs.themeum.com/tutor-lms/developer-documentation/rest-apis-for-tutor-lms-pro/index An example JSON object for a 'fill_in_the_blank' quiz question. It uses placeholders within the question text and provides the correct answers separated by '|'. ```json { "quiz_id": 5597, "question_title": "Fill up the gaps", "question_type": "fill_in_the_blank", "question": "Dhaka city has a {dash} population. It is well known for its diverse {dash} & bustling {dash}. ", "correct_answer": "large|cuisine|commerce", "answer_required": 1, "randomize_question": 1, "question_mark": 1.00, "show_question_mark": 1, "answer_explanation": "\n\nAnswer explanation\n\n", "question_description": "\n\nDummy description\n\n" } ``` -------------------------------- ### Multiple Choice Quiz Question Example Source: https://docs.themeum.com/tutor-lms/developer-documentation/rest-apis-for-tutor-lms-pro/index An example JSON object for a 'multiple_choice' quiz question. It allows for multiple correct answers from a provided list of options. ```json { "quiz_id": 5596, "question_title": "Choose the SQL databases from the below list", "question_type": "multiple_choice", "options": ["MySQL", "Mongo DB", "PostgreSQL"], "correct_answer": ["MySQL", "PostgreSQL"], "answer_required": 1, "randomize_question": 1, "question_mark": 1.00, "show_question_mark": 1, "answer_explanation": "\n\nAnswer explanation\n\n", "question_description": "\n\nDummy description\n\n" } ``` -------------------------------- ### True/False Quiz Question Example Source: https://docs.themeum.com/tutor-lms/developer-documentation/rest-apis-for-tutor-lms-pro/index An example JSON object for a 'true_false' quiz question. It includes the question title, correct answer, and standard quiz question attributes. ```json { "quiz_id": 5595, "question_title": "Mark is the owner of FB", "question_type": "true_false", "correct_answer": "true", "answer_required": 1, "randomize_question": 1, "question_mark": 1.00, "show_question_mark": 1, "answer_explanation": "\n\nAnswer explanation\n\n", "question_description": "\n\nDummy description\n\n" } ``` -------------------------------- ### Course API: Get Course Details, Topic, and Sorting Source: https://docs.themeum.com/tutor-lms/developer-documentation/rest-apis-for-tutor-lms-pro/index This set of endpoints provides specific functionalities for courses. You can retrieve detailed information about a single course, access its associated topics, sort courses by price, and get course ratings based on the course ID. These GET requests are essential for displaying course-related information. ```http GET https://yourdomain.com/wp-json/tutor/v1/course-topic/{course_id} GET https://yourdomain.com/tutor/wp-json/tutor/v1/course-sorting-by-price?order=asc&page=1 GET https://yourdomain.com/tutor/wp-json/tutor/v1/course-rating/{course_id} ``` -------------------------------- ### Manage Student Assignments (GET, POST) Source: https://docs.themeum.com/tutor-lms/developer-documentation/rest-apis-for-tutor-lms-pro/index These API endpoints facilitate student assignment management. Retrieve student assignment submissions using a GET request with student and assignment IDs. Submit new assignments or update existing ones using POST requests to the respective endpoints. The `assignment-submit` endpoint is used for submissions, while `assignment-submit/{assignment_id}` can be used for updates. ```http GET https://yourdomain.com/wp-json/tutor/v1/assignments?student_id={student_id}&assignment_id={assignment_id} POST https://yourdomain.com/wp-json/tutor/v1/assignment-submit POST https://yourdomain.com/wp-json/tutor/v1/assignment-submit/{assignment_id} ``` -------------------------------- ### Manage Course Assignments (GET, POST, PUT, PATCH, DELETE) Source: https://docs.themeum.com/tutor-lms/developer-documentation/rest-apis-for-tutor-lms-pro/index These API endpoints allow for the management of course assignments. You can retrieve an assignment by its ID using a GET request, create a new assignment using POST, and update or delete existing assignments using POST, PUT, PATCH, or DELETE requests respectively. Ensure you replace placeholders like {assignment_id} with actual values. ```http GET https://yourdomain.com/wp-json/tutor/v1/course-assignment/{assignment_id} POST https://yourdomain.com/wp-json/tutor/v1/assignments/ POST, PUT, PATCH https://yourdomain.com/wp-json/tutor/v1/assignments/{assignment_id} DELETE https://yourdomain.com/wp-json/tutor/v1/assignments/{assignment_id} ``` -------------------------------- ### Assignment API (Student Section) - Get Student Assignment Submit Source: https://docs.themeum.com/tutor-lms/developer-documentation/rest-apis-for-tutor-lms-pro/index Retrieves assignment submission details for a specific student and assignment. ```APIDOC ## GET /wp-json/tutor/v1/assignments?student_id={student_id}&assignment_id={assignment_id} ### Description Retrieves assignment submission details for a specific student and assignment. ### Method GET ### Endpoint /wp-json/tutor/v1/assignments ### Parameters #### Query Parameters - **student_id** (integer) - Required - The ID of the student. - **assignment_id** (integer) - Required - The ID of the assignment. ### Response #### Success Response (200) - **assignment_id** (integer) - The ID of the assignment. - **assignment_answer** (string) - The student's submitted answer. - **student_id** (integer) - The ID of the student. - **attached_assignment_files** (array) - An array of attached assignment files. #### Response Example ```json { "assignment_id": "7651", "assignment_answer": "Student’s assignment answer", "student_id": 3, "attached_assignment_files": [ "file1.pdf", "file2.docx" ] } ``` ``` -------------------------------- ### Get Quiz Questions Answer by Quiz ID API Endpoint Source: https://docs.themeum.com/tutor-lms/developer-documentation/rest-apis-for-tutor-lms-pro/index This API endpoint retrieves the answers for quiz questions associated with a specific quiz ID. It uses the GET method. ```http URL: https://yourdomain.com/wp-json/tutor/v1/quiz-question-answer/{quiz_id} Type: GET ``` -------------------------------- ### Student Wishlist Retrieval API Source: https://docs.themeum.com/tutor-lms/developer-documentation/rest-apis-for-tutor-lms-pro/index Retrieves a list of courses in a user's wishlist. This endpoint uses the GET method and requires the user_id as a query parameter. ```bash curl -X GET https://yourdomain.com/wp-json/tutor/v1/wishlists?user_id={user_id} ``` -------------------------------- ### Enrolled Users Retrieval API Source: https://docs.themeum.com/tutor-lms/developer-documentation/rest-apis-for-tutor-lms-pro/index Retrieves a list of users enrolled in a specific course. This endpoint uses the GET method and requires the course_id as a query parameter. ```bash curl -X GET https://yourdomain.com/wp-json/tutor/v1//enrollments?course_id={course_id} ``` -------------------------------- ### Student Course List Retrieval API Source: https://docs.themeum.com/tutor-lms/developer-documentation/rest-apis-for-tutor-lms-pro/index Retrieves a list of courses a specific student is enrolled in. This endpoint uses the GET method and requires the student_id in the URL. ```bash curl -X GET https://yourdomain.com/wp-json/tutor/v1/students/{student_id}/courses ``` -------------------------------- ### User Review List Retrieval API Source: https://docs.themeum.com/tutor-lms/developer-documentation/rest-apis-for-tutor-lms-pro/index Retrieves a list of reviews submitted by a specific user. This endpoint uses the GET method and requires the user_id as a query parameter. ```bash curl -X GET https://yourdomain.com/wp-json/tutor/v1/reviews?user_id={user_id} ``` -------------------------------- ### Become Instructor API Source: https://docs.themeum.com/tutor-lms/developer-documentation/rest-apis-for-tutor-lms-pro/index Allows a user to apply to become an instructor. ```APIDOC ## PUT /tutor/v1/become-instructor/{user_id} ### Description Submits an application for a user to become an instructor. ### Method PUT ### Endpoint /tutor/v1/become-instructor/{user_id} ### Parameters #### Path Parameters - **user_id** (integer) - Required - The ID of the user applying to be an instructor. ### Response #### Success Response (200) - **message** (string) - Confirmation message indicating the instructor application has been submitted. #### Response Example { "message": "Instructor application submitted successfully." } ``` -------------------------------- ### Get Quiz by ID API Endpoint Source: https://docs.themeum.com/tutor-lms/developer-documentation/rest-apis-for-tutor-lms-pro/index This API endpoint allows you to retrieve quiz details using its unique quiz ID. It is a GET request. ```http URL: https://yourdomain.com/wp-json/tutor/v1/quiz/{quiz_id} Type: GET ``` -------------------------------- ### Lesson API: Create, Read, Update, Delete Lessons Source: https://docs.themeum.com/tutor-lms/developer-documentation/rest-apis-for-tutor-lms-pro/index The Lesson API enables the management of individual lessons within a course. You can create new lessons, retrieve lessons by their ID, update lesson details, and delete lessons. The API supports various attributes including content, video, and attachments. ```json { "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 } ``` ```http POST https://yourdomain.com/wp-json/tutor/v1/lessons/ GET https://yourdomain.com/wp-json/tutor/v1/lesson/{lesson_id} POST, PUT, PATCH https://yourdomain.com/wp-json/tutor/v1/lessons/{lesson_id} DELETE https://yourdomain.com/wp-json/tutor/v1/lessons/{lesson_id} ``` -------------------------------- ### Lesson API: Mark Lesson as Complete Source: https://docs.themeum.com/tutor-lms/developer-documentation/rest-apis-for-tutor-lms-pro/index This endpoint allows users to mark a specific lesson as complete. It is a POST request and is essential for tracking student progress through course materials. ```http POST https://yourdomain.com/wp-json/tutor/v1/lesson-mark-complete ``` -------------------------------- ### Enrollment Creation API Source: https://docs.themeum.com/tutor-lms/developer-documentation/rest-apis-for-tutor-lms-pro/index Enrolls a user into a course. This endpoint accepts POST requests and requires a JSON payload with user_id and course_id. ```json { "user_id": 2, "course_id": 5607 } ``` ```bash curl -X POST https://yourdomain.com/wp-json/tutor/v1/enrollments -d '{"user_id": 2, "course_id": 5607}' ``` -------------------------------- ### Become Instructor API Source: https://docs.themeum.com/tutor-lms/developer-documentation/rest-apis-for-tutor-lms-pro/index Updates a user's role to become an instructor. This endpoint uses the PUT method and requires the user_id in the URL. ```bash curl -X PUT https://yourdomain.com/wp-json/tutor/v1/become-instructor/{user_id} ``` -------------------------------- ### Get Quiz Attempts Details by Quiz ID API Endpoint Source: https://docs.themeum.com/tutor-lms/developer-documentation/rest-apis-for-tutor-lms-pro/index This API endpoint allows you to fetch the details of quiz attempts for a given quiz ID. It is accessed via a GET request. ```http URL: https://yourdomain.com/wp-json/tutor/v1/quiz-attempt/{quiz_id} Type: GET ``` -------------------------------- ### Course API: Mark Course as Complete Source: https://docs.themeum.com/tutor-lms/developer-documentation/rest-apis-for-tutor-lms-pro/index This API endpoint allows users to mark a course as complete. It is a POST request and is crucial for tracking user progress within the Tutor LMS platform. ```http POST https://yourdomain.com/wp-json/tutor/v1/course-mark-complete ``` -------------------------------- ### Lesson API Source: https://docs.themeum.com/tutor-lms/developer-documentation/rest-apis-for-tutor-lms-pro/index The Lesson API enables the creation, updating, and deletion of lesson data within Tutor LMS. It also supports sorting lessons and marking them as complete. ```APIDOC ## Lesson Create ### Description Creates a new lesson. ### Method POST ### Endpoint /wp-json/tutor/v1/lessons/ ### Request Body - **topic_id** (integer) - Required - The ID of the topic to which the lesson belongs. - **lesson_title** (string) - Required - The title of the lesson. - **lesson_content** (string) - Optional - The content of the lesson. - **thumbnail_id** (integer) - Optional - The ID of the thumbnail image for the lesson. - **lesson_author** (integer) - Optional - The ID of the lesson author. - **video** (object) - Optional - Video details for the lesson. - **source_type** (string) - Type of video source (e.g., 'youtube'). - **source** (string) - URL of the video. - **runtime** (object) - **hours** (string) - Video runtime in hours. - **minutes** (string) - Video runtime in minutes. - **seconds** (string) - Video runtime in seconds. - **attachments** (array) - Optional - Array of attachment IDs. - **preview** (boolean) - Optional - Whether the lesson is available for preview. ### Response #### Success Response (200) Returns the created lesson data. #### Response Example ```json { "lesson_id": 1, "topic_id": 5608, "lesson_title": "Introduction to Mathematics.", "lesson_content": "...", "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 } ``` ## Lesson by Topic ID ### Description Retrieves a specific lesson by its ID. ### Method GET ### Endpoint /wp-json/tutor/v1/lesson/{lesson_id} ### Path Parameters - **lesson_id** (integer) - Required - The ID of the lesson to retrieve. ### Response #### Success Response (200) Returns the data for the specified lesson. #### Response Example ```json { "lesson_id": 1, "lesson_title": "Introduction to Mathematics.", "lesson_content": "..." } ``` ## Lesson Update ### Description Updates an existing lesson. ### Method POST, PUT, PATCH ### Endpoint /wp-json/tutor/v1/lessons/{lesson_id} ### Path Parameters - **lesson_id** (integer) - Required - The ID of the lesson to update. ### Request Body (Same structure as Lesson Create, with fields to be updated) ### Response #### Success Response (200) Returns the updated lesson data. #### Response Example ```json { "lesson_id": 1, "lesson_title": "Updated Lesson Title", "lesson_content": "Updated lesson content..." } ``` ## Lesson Delete ### Description Deletes a lesson. ### Method DELETE ### Endpoint /wp-json/tutor/v1/lessons/{lesson_id} ### Path Parameters - **lesson_id** (integer) - Required - The ID of the lesson to delete. ### Response #### Success Response (200) Returns a success message indicating the lesson was deleted. #### Response Example ```json { "message": "Lesson deleted successfully." } ``` ## Lesson Mark as Complete ### Description Marks a lesson as complete for a student. ### Method POST ### Endpoint /wp-json/tutor/v1/lesson-mark-complete ### Request Body - **lesson_id** (integer) - Required - The ID of the lesson to mark as complete. - **student_id** (integer) - Required - The ID of the student. ### Response #### Success Response (200) Returns a success message indicating the lesson was marked as complete. #### Response Example ```json { "message": "Lesson marked as complete." } ``` ``` -------------------------------- ### Review API Source: https://docs.themeum.com/tutor-lms/developer-documentation/rest-apis-for-tutor-lms-pro/index APIs for managing course reviews. ```APIDOC ## GET /tutor/v1/reviews?user_id={user_id} ### Description Retrieves a list of reviews submitted by a specific user. ### Method GET ### Endpoint /tutor/v1/reviews ### Query Parameters - **user_id** (integer) - Required - The ID of the user. ### Response #### Success Response (200) - **reviews** (array) - A list of reviews submitted by the user. #### Response Example { "reviews": [ { "course_id": 7461, "rating": 5, "review": "Great lessons" } ] } ``` ```APIDOC ## POST /tutor/v1/reviews ### Description Adds a review for a course by a user. ### Method POST ### Endpoint /tutor/v1/reviews ### Request Body - **user_id** (integer) - Required - The ID of the user submitting the review. - **course_id** (integer) - Required - The ID of the course being reviewed. - **rating** (integer) - Required - The rating given to the course (e.g., 1-5). - **review** (string) - Optional - The text content of the review. ### Response #### Success Response (200) - **message** (string) - Confirmation message indicating the review was added. #### Response Example { "message": "Review added successfully." } ``` ```APIDOC ## POST /tutor/v1/reviews/{course_id} ### Description Updates an existing review for a course. ### Method POST ### Endpoint /tutor/v1/reviews/{course_id} ### Parameters #### Path Parameters - **course_id** (integer) - Required - The ID of the course for which the review is being updated. ### Request Body - **user_id** (integer) - Required - The ID of the user whose review is being updated. - **rating** (integer) - Optional - The updated rating. - **review** (string) - Optional - The updated review text. ### Response #### Success Response (200) - **message** (string) - Confirmation message indicating the review was updated. #### Response Example { "message": "Review updated successfully." } ``` ```APIDOC ## POST /tutor/v1/reviews/{course_id}?user_id={user_id} ### Description Deletes a specific review for a course made by a user. ### Method POST ### Endpoint /tutor/v1/reviews/{course_id} ### Parameters #### Path Parameters - **course_id** (integer) - Required - The ID of the course. #### Query Parameters - **user_id** (integer) - Required - The ID of the user whose review is to be deleted. ### Response #### Success Response (200) - **message** (string) - Confirmation message indicating the review was deleted. #### Response Example { "message": "Review deleted successfully." } ``` -------------------------------- ### Student Dashboard Retrieval API Source: https://docs.themeum.com/tutor-lms/developer-documentation/rest-apis-for-tutor-lms-pro/index Retrieves the dashboard data for a specific student. This endpoint uses the GET method and requires the student_id in the URL. ```bash curl -X GET https://yourdomain.com/wp-json/tutor/v1/students/{student_id}/dashboard ``` -------------------------------- ### Student Calendar Retrieval API Source: https://docs.themeum.com/tutor-lms/developer-documentation/rest-apis-for-tutor-lms-pro/index Retrieves the calendar data for a specific student. This endpoint uses the GET method and requires the student_id in the URL. ```bash curl -X GET https://yourdomain.com/wp-json/tutor/v1/students/{student_id}/calendar ``` -------------------------------- ### Enrollment API Source: https://docs.themeum.com/tutor-lms/developer-documentation/rest-apis-for-tutor-lms-pro/index APIs for managing course enrollments. ```APIDOC ## POST /tutor/v1/enrollments ### Description Enrolls a user into a course. ### Method POST ### Endpoint /tutor/v1/enrollments ### Request Body - **user_id** (integer) - Required - The ID of the user to enroll. - **course_id** (integer) - Required - The ID of the course to enroll in. ### Response #### Success Response (200) - **message** (string) - Confirmation message indicating successful enrollment. #### Response Example { "message": "User enrolled successfully." } ``` ```APIDOC ## PUT /tutor/v1/enrollments/completed ### Description Updates the enrollment status of a user to 'completed'. ### Method PUT ### Endpoint /tutor/v1/enrollments/completed ### Request Body - **user_id** (integer) - Required - The ID of the user. - **course_id** (integer) - Required - The ID of the course. ### Response #### Success Response (200) - **message** (string) - Confirmation message indicating the enrollment status was updated. #### Response Example { "message": "Enrollment status updated to completed." } ``` ```APIDOC ## GET /tutor/v1/enrollments?course_id={course_id} ### Description Retrieves a list of users enrolled in a specific course. ### Method GET ### Endpoint /tutor/v1/enrollments ### Query Parameters - **course_id** (integer) - Required - The ID of the course. ### Response #### Success Response (200) - **enrolled_users** (array) - A list of users enrolled in the course. #### Response Example { "enrolled_users": [ { "user_id": 2, "course_id": 5607, "enrollment_date": "2023-10-27T10:00:00Z" } ] } ``` -------------------------------- ### Student Order History Retrieval API Source: https://docs.themeum.com/tutor-lms/developer-documentation/rest-apis-for-tutor-lms-pro/index Retrieves the order history for a specific student. This endpoint uses the GET method and requires the student_id in the URL. ```bash curl -X GET https://yourdomain.com/wp-json/tutor/v1/students/{student_id}/order-histories ``` -------------------------------- ### Question Creation API Source: https://docs.themeum.com/tutor-lms/developer-documentation/rest-apis-for-tutor-lms-pro/index Creates a new question for a quiz. This endpoint accepts POST requests and is used to add new quiz questions. ```bash curl -X POST https://yourdomain.com/wp-json/tutor/v1/quiz-questions ``` -------------------------------- ### Q&A API Endpoints and Data Structure Source: https://docs.themeum.com/tutor-lms/developer-documentation/rest-apis-for-tutor-lms-pro/index Details the Q&A API for managing student questions and answers. Includes endpoints for retrieving, adding, updating, marking as read/unread, and deleting Q&A entries. A sample JSON structure for Q&A data is provided. ```JSON { "user_id": 3, "course_id": 7378, "question_id": 0, "qna_text": "Write your reply here." } ``` ```REST GET https://yourdomain.com/wp-json/tutor/v1/qna?user_id={user_id}&offset={offset}&limit={limit} POST https://yourdomain.com/wp-json/tutor/v1/qna POST, PUT, PATCH https://yourdomain.com/wp-json/tutor/v1/qna-mark-read-unread/{comment_id} DEL https://yourdomain.com/wp-json/tutor/v1/qna/{comment_id}?user_id={user_id} ``` -------------------------------- ### Assignment API - Create Assignment Source: https://docs.themeum.com/tutor-lms/developer-documentation/rest-apis-for-tutor-lms-pro/index Creates a new assignment. ```APIDOC ## POST /wp-json/tutor/v1/assignments ### Description Creates a new assignment. ### Method POST ### Endpoint /wp-json/tutor/v1/assignments ### Parameters #### Request Body - **topic_id** (integer) - Required - The ID of the topic the assignment belongs to. - **assignment_title** (string) - Required - The title of the assignment. - **assignment_author** (integer) - Required - The ID of the assignment author. - **assignment_content** (string) - Optional - The content of the assignment (HTML format). - **attachments** (array) - Optional - An array of attachment IDs. - **assignment_options** (object) - Optional - Options related to the assignment. - **time_duration** (object) - Time duration settings for the assignment. - **value** (integer) - The duration value. - **unit** (string) - The unit of duration (e.g., 'weeks', 'days'). - **total_mark** (integer) - The total marks for the assignment. - **pass_mark** (integer) - The passing marks for the assignment. - **upload_files_limit** (integer) - The maximum number of files that can be uploaded. - **upload_file_size_limit** (integer) - The maximum size limit for uploaded files. ### Request Example ```json { "topic_id": 5587, "assignment_title": "Math Assignment 1", "assignment_author": 1, "assignment_content": "

Assignment content

", "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 } } ``` ### Response #### Success Response (200) - **id** (integer) - The ID of the newly created assignment. - **message** (string) - A success message. #### Response Example ```json { "id": 123, "message": "Assignment created successfully." } ``` ``` -------------------------------- ### User Review Addition API Source: https://docs.themeum.com/tutor-lms/developer-documentation/rest-apis-for-tutor-lms-pro/index Adds a review for a course by a user. This endpoint accepts POST requests and requires a JSON payload with user_id, course_id, rating, and review text. ```json { "user_id": 3, "course_id": 7461, "rating": 5, "review": "Great lessons" } ``` ```bash curl -X POST https://yourdomain.com/wp-json/tutor/v1/reviews -d '{"user_id": 3, "course_id": 7461, "rating": 5, "review": "Great lessons"}' ``` -------------------------------- ### Single Quiz Attempt Retrieval API Source: https://docs.themeum.com/tutor-lms/developer-documentation/rest-apis-for-tutor-lms-pro/index Retrieves details of a specific quiz attempt. This endpoint uses the GET method and requires the attempt ID in the URL. ```bash curl -X GET https://yourdomain.com/wp-json/tutor/v1/quiz-attempts/{attempt_id} ``` -------------------------------- ### Quiz Attempts Retrieval API Source: https://docs.themeum.com/tutor-lms/developer-documentation/rest-apis-for-tutor-lms-pro/index Retrieves a list of quiz attempts for a specific quiz and student. This endpoint uses the GET method and accepts quiz_id and student_id as query parameters. ```bash curl -X GET https://yourdomain.com/wp-json/tutor/v1/quiz-attempts?quiz_id={quiz_id}&student_id={student_id} ``` -------------------------------- ### Topic API Source: https://docs.themeum.com/tutor-lms/developer-documentation/rest-apis-for-tutor-lms-pro/index The Topic API allows for the creation, retrieval, updating, and deletion of Tutor LMS course topics. ```APIDOC ## Topics Create ### Description Creates a new topic for a course. ### Method POST ### Endpoint /wp-json/tutor/v1/topics ### Request Body - **topic_course_id** (integer) - Required - The ID of the course to which the topic belongs. - **topic_title** (string) - Required - The title of the topic. - **topic_summary** (string) - Optional - A summary of the topic. - **topic_author** (integer) - Optional - The ID of the author of the topic. ### Response #### Success Response (200) Returns the created topic data. #### Response Example ```json { "topic_id": 1, "topic_course_id": 5607, "topic_title": "Introduction to Mathematics.", "topic_summary": "...", "topic_author": 1 } ``` ## Topics Read ### Description Retrieves a list of topics for a specific course. ### Method GET ### Endpoint /wp-json/tutor/v1/topics ### Query Parameters - **course_id** (integer) - Required - The ID of the course whose topics are to be retrieved. ### Response #### Success Response (200) Returns a list of topics for the specified course. #### Response Example ```json [ { "topic_id": 1, "topic_title": "Module 1: Basics" } ] ``` ## Topics Update ### Description Updates an existing topic. ### Method POST, PUT, PATCH ### Endpoint /wp-json/tutor/v1/topics/{topic_id} ### Path Parameters - **topic_id** (integer) - Required - The ID of the topic to update. ### Request Body - **topic_title** (string) - Optional - The new title for the topic. - **topic_summary** (string) - Optional - The new summary for the topic. ### Response #### Success Response (200) Returns the updated topic data. #### Response Example ```json { "topic_id": 1, "topic_title": "Updated Topic Title", "topic_summary": "Updated summary." } ``` ## Topics Delete ### Description Deletes a topic. ### Method DELETE ### Endpoint /wp-json/tutor/v1/topics/{topic_id} ### Path Parameters - **topic_id** (integer) - Required - The ID of the topic to delete. ### Response #### Success Response (200) Returns a success message indicating the topic was deleted. #### Response Example ```json { "message": "Topic deleted successfully." } ``` ``` -------------------------------- ### Course API: Create, Read, Update, Delete Courses Source: https://docs.themeum.com/tutor-lms/developer-documentation/rest-apis-for-tutor-lms-pro/index The Course API allows for comprehensive management of course data. You can create new courses, retrieve existing ones (individually or in lists), update course details, and delete courses. The API supports various query parameters for sorting and filtering. ```json { "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 } ``` ```http POST https://yourdomain.com/wp-json/tutor/v1/courses GET https://yourdomain.com/wp-json/tutor/v1/courses?order=desc&orderby=ID&paged=1 POST, PUT, PATCH https://yourdomain.com/wp-json/tutor/v1/courses/{course_id} DELETE https://yourdomain.com/wp-json/tutor/v1/courses/{course_id} GET https://yourdomain.com/wp-json/tutor/v1/courses/{course_id} ``` -------------------------------- ### Quiz Creation API Source: https://docs.themeum.com/tutor-lms/developer-documentation/rest-apis-for-tutor-lms-pro/index Creates a new quiz. This endpoint accepts POST requests and is used to add new quiz content to the system. ```bash curl -X POST https://yourdomain.com/wp-json/tutor/v1/quizzes ``` -------------------------------- ### Course API Source: https://docs.themeum.com/tutor-lms/developer-documentation/rest-apis-for-tutor-lms-pro/index The Course API allows for the creation, retrieval, updating, and deletion of course data. It also supports sorting courses, providing course ratings, and fetching detailed course information. ```APIDOC ## Course Create ### Description Creates a new course. ### Method POST ### Endpoint /wp-json/tutor/v1/courses ### Request Body - **post_author** (integer) - The ID of the author for the course. - **post_date** (string) - The publication date of the course. - **post_date_gmt** (string) - The GMT publication date of the course. - **post_content** (string) - The main content of the course. - **post_title** (string) - The title of the course. - **post_excerpt** (string) - A short excerpt for the course. - **post_status** (string) - The status of the course (e.g., 'publish', 'draft'). - **comment_status** (string) - The comment status for the course. - **post_password** (string) - Password for password-protected courses. - **post_modified** (string) - The last modified date of the course. - **post_modified_gmt** (string) - The GMT last modified date of the course. - **post_content_filtered** (string) - Filtered content of the course. - **additional_content** (object) - Additional details about the course. - **course_benefits** (string) - Benefits of taking the course. - **course_target_audience** (string) - Target audience for the course. - **course_duration** (object) - **hours** (string) - Duration in hours. - **minutes** (string) - Duration in minutes. - **course_material_includes** (string) - What the course material includes. - **course_requirements** (string) - Prerequisites for the course. - **video** (object) - Video information for the course. - **source_type** (string) - Type of video source (e.g., 'youtube'). - **source** (string) - URL of the video. - **course_level** (string) - Difficulty level of the course (e.g., 'beginner', 'intermediate'). - **course_categories** (array) - Array of category IDs. - **course_tags** (array) - Array of tag IDs. - **thumbnail_id** (integer) - The ID of the thumbnail image. ### Response #### Success Response (200) Returns the created course data. #### Response Example ```json { "id": 123, "post_author": 1, "post_date": "2023-01-01 12:00:00", "post_date_gmt": "2023-01-01 00:00:00", "post_content": "...", "post_title": "Introduction to Mathematics", "post_excerpt": "...", "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 } ``` ## Course Read ### Description Retrieves a list of courses with optional sorting and pagination. ### Method GET ### Endpoint /wp-json/tutor/v1/courses ### Query Parameters - **order** (string) - Optional - The order of the results (e.g., 'asc', 'desc'). - **orderby** (string) - Optional - The field to order the results by (e.g., 'ID', 'title'). - **paged** (integer) - Optional - The page number for pagination. ### Response #### Success Response (200) Returns a list of courses. #### Response Example ```json [ { "id": 123, "post_title": "Introduction to Mathematics", "post_content": "..." } ] ``` ## Course Update ### Description Updates an existing course. ### Method POST, PUT, PATCH ### Endpoint /wp-json/tutor/v1/courses/{course_id} ### Path Parameters - **course_id** (integer) - Required - The ID of the course to update. ### Request Body (Same structure as Course Create, with fields to be updated) ### Response #### Success Response (200) Returns the updated course data. #### Response Example ```json { "id": 123, "post_title": "Updated Course Title", "post_content": "Updated course content..." } ``` ## Course Delete ### Description Deletes a course. ### Method DELETE ### Endpoint /wp-json/tutor/v1/courses/{course_id} ### Path Parameters - **course_id** (integer) - Required - The ID of the course to delete. ### Response #### Success Response (200) Returns a success message indicating the course was deleted. #### Response Example ```json { "message": "Course deleted successfully." } ``` ## Course Detail ### Description Retrieves the details of a specific course. ### Method GET ### Endpoint /wp-json/tutor/v1/courses/{course_id} ### Path Parameters - **course_id** (integer) - Required - The ID of the course to retrieve. ### Response #### Success Response (200) Returns the detailed data for the specified course. #### Response Example ```json { "id": 123, "post_title": "Introduction to Mathematics", "post_content": "...", "additional_content": { "course_benefits": "Course benefits" } } ``` ## Course Topic ### Description Retrieves all topics associated with a specific course. ### Method GET ### Endpoint /wp-json/tutor/v1/course-topic/{course_id} ### Path Parameters - **course_id** (integer) - Required - The ID of the course whose topics are to be retrieved. ### Response #### Success Response (200) Returns a list of topics for the specified course. #### Response Example ```json [ { "topic_id": 1, "topic_title": "Module 1: Basics" } ] ``` ## Course Mark as Complete ### Description Marks a course as complete for a student. ### Method POST ### Endpoint /wp-json/tutor/v1/course-mark-complete ### Request Body - **course_id** (integer) - Required - The ID of the course to mark as complete. - **student_id** (integer) - Required - The ID of the student. ### Response #### Success Response (200) Returns a success message indicating the course was marked as complete. #### Response Example ```json { "message": "Course marked as complete." } ``` ## Course Sorting by Price ### Description Retrieves courses sorted by price, with pagination. ### Method GET ### Endpoint /tutor/wp-json/tutor/v1/course-sorting-by-price ### Query Parameters - **order** (string) - Optional - The order of sorting (e.g., 'asc', 'desc'). - **page** (integer) - Optional - The page number for pagination. ### Response #### Success Response (200) Returns a list of courses sorted by price. #### Response Example ```json [ { "id": 123, "post_title": "Course A", "price": 50 } ] ``` ## Course Rating by Course ID ### Description Retrieves the ratings for a specific course. ### Method GET ### Endpoint /tutor/wp-json/tutor/v1/course-rating/{course_id} ### Path Parameters - **course_id** (integer) - Required - The ID of the course whose ratings are to be retrieved. ### Response #### Success Response (200) Returns the ratings for the specified course. #### Response Example ```json [ { "rating": 4.5, "user_id": 101 } ] ``` ``` -------------------------------- ### Manage Assignment Attachments (POST) Source: https://docs.themeum.com/tutor-lms/developer-documentation/rest-apis-for-tutor-lms-pro/index This API endpoint allows for the uploading of assignment attachments. Use a POST request to the `assignment-attachment` endpoint, providing the assignment ID and the file name as query parameters. This is useful for associating files with specific assignments. ```http POST https://yourdomain.com/wp-json/tutor/v1/assignment-attachment/{assignment_id}?file_name={file_name} ``` -------------------------------- ### Wishlist Addition API Source: https://docs.themeum.com/tutor-lms/developer-documentation/rest-apis-for-tutor-lms-pro/index Adds a course to a user's wishlist. This endpoint accepts POST requests and requires a JSON payload with user_id and course_id. ```json { "user_id": 3, "course_id": 7398 } ``` ```bash curl -X POST https://yourdomain.com/wp-json/tutor/v1/wishlists -d '{"user_id": 3, "course_id": 7398}' ``` -------------------------------- ### Wishlist API Source: https://docs.themeum.com/tutor-lms/developer-documentation/rest-apis-for-tutor-lms-pro/index APIs for managing user wishlists. ```APIDOC ## GET /tutor/v1/wishlists?user_id={user_id} ### Description Retrieves the list of courses added to a user's wishlist. ### Method GET ### Endpoint /tutor/v1/wishlists ### Query Parameters - **user_id** (integer) - Required - The ID of the user. ### Response #### Success Response (200) - **wishlist_items** (array) - A list of courses in the user's wishlist. #### Response Example { "wishlist_items": [ { "course_id": 7398, "course_title": "Advanced Course" } ] } ``` ```APIDOC ## POST /tutor/v1/wishlists ### Description Adds a course to a user's wishlist. ### Method POST ### Endpoint /tutor/v1/wishlists ### Request Body - **user_id** (integer) - Required - The ID of the user. - **course_id** (integer) - Required - The ID of the course to add. ### Response #### Success Response (200) - **message** (string) - Confirmation message indicating the course was added to the wishlist. #### Response Example { "message": "Course added to wishlist successfully." } ``` ```APIDOC ## DELETE /tutor/v1/wishlists?user_id={user_id}&course_id={course_id} ### Description Removes a course from a user's wishlist. ### Method DELETE ### Endpoint /tutor/v1/wishlists ### Query Parameters - **user_id** (integer) - Required - The ID of the user. - **course_id** (integer) - Required - The ID of the course to remove. ### Response #### Success Response (200) - **message** (string) - Confirmation message indicating the course was removed from the wishlist. #### Response Example { "message": "Course removed from wishlist successfully." } ```