Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,6 @@ assets/.rsdoctor

*storybook.log
storybook-static

# Bruno Local Environment
docs/api/environments/local.bru
63 changes: 63 additions & 0 deletions docs/api/Courses/course-announcement-{id}.bru
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
meta {
name: course-announcement/{id}
type: http
seq: 4
}

get {
url: {{base_url}}/course-announcement/1
body: none
auth: basic
}

auth:basic {
username: {{api_key}}
password: {{api_secret}}
}

docs {
# Get Course Announcements

Retrieves all broadcast announcements published by the course instructors for a specific course.

## HTTP Method & Route
- **Method:** `GET`
- **Route:** `/wp-json/tutor/v1/course-announcement/:id`

## Authentication
- **Type:** Basic Auth (`api_key` / `api_secret`)
- **Required Permission:** `Read` or `All`

## Path Parameters

| Parameter | Type | Required | Description |
| :--- | :--- | :--- | :--- |
| `id` | `integer` | **Yes** | The WordPress Post ID of the course. |

## Responses

### 200 OK (Success)
```json
{
"code": "success",
"message": "Announcement retrieved successfully",
"data": [
{
"ID": 401,
"post_title": "Welcome to the Course & Live Q&A Session Schedule",
"post_content": "We will be hosting a weekly live stream every Friday at 3 PM UTC.",
"post_name": "welcome-live-qa-schedule"
}
]
}
```

### 404 Not Found
```json
{
"code": "not_found",
"message": "Announcement not found for given ID",
"data": []
}
```
}
78 changes: 78 additions & 0 deletions docs/api/Courses/course-contents-{id}.bru
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
meta {
name: course-contents/{id}
type: http
seq: 3
}

get {
url: {{base_url}}/course-contents/1
body: none
auth: basic
}

auth:basic {
username: {{api_key}}
password: {{api_secret}}
}

docs {
# Get Course Contents Tree

Retrieves the complete hierarchical curriculum structure for a course, grouping topics and their nested child items (lessons, quizzes, assignments).

## HTTP Method & Route
- **Method:** `GET`
- **Route:** `/wp-json/tutor/v1/course-contents/:id`

## Authentication
- **Type:** Basic Auth (`api_key` / `api_secret`)
- **Required Permission:** `Read` or `All`

## Path Parameters

| Parameter | Type | Required | Description |
| :--- | :--- | :--- | :--- |
| `id` | `integer` | **Yes** | The WordPress Post ID of the course. |

## Responses

### 200 OK (Success)
```json
{
"code": "success",
"message": "Course contents retrieved successfully",
"data": [
{
"id": 201,
"title": "Module 1: Introduction to Web APIs",
"summary": "Overview of REST architecture and HTTP fundamentals.",
"contents": [
{
"ID": 301,
"post_title": "Lesson 1: What is a REST API?",
"post_content": "Detailed overview text...",
"post_name": "what-is-a-rest-api",
"post_type": "lesson"
},
{
"ID": 302,
"post_title": "Quiz 1: HTTP Basics",
"post_content": "Test your knowledge of status codes.",
"post_name": "quiz-1-http-basics",
"post_type": "tutor_quiz"
}
]
}
]
}
```

### 404 Not Found
```json
{
"code": "not_found",
"message": "Contents for this course with the given course id not found",
"data": []
}
```
}
86 changes: 86 additions & 0 deletions docs/api/Courses/course-rating-{id}.bru
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
meta {
name: course-rating/{id}
type: http
seq: 5
}

get {
url: {{base_url}}/course-rating/1
body: none
auth: basic
}

params:query {
~offset: 0
~limit: 10
}

auth:basic {
username: {{api_key}}
password: {{api_secret}}
}

docs {
# Get Course Ratings & Reviews

Retrieves overall rating statistics (count, average rating, star breakdown) and a paginated list of approved student reviews for a course.

## HTTP Method & Route
- **Method:** `GET`
- **Route:** `/wp-json/tutor/v1/course-rating/:id`

## Authentication
- **Type:** Basic Auth (`api_key` / `api_secret`)
- **Required Permission:** `Read` or `All`

## Path Parameters

| Parameter | Type | Required | Description |
| :--- | :--- | :--- | :--- |
| `id` | `integer` | **Yes** | The WordPress Post ID of the course. |

## Query Parameters

| Parameter | Type | Default | Description |
| :--- | :--- | :--- | :--- |
| `offset` | `integer` | `0` | Offset for pagination of reviews. |
| `limit` | `integer` | `10` | Number of reviews to return per request. |

## Responses

### 200 OK (Success)
```json
{
"code": "success",
"message": "Course rating retrieved successfully",
"data": {
"rating_count": 8,
"rating_avg": 4.88,
"five_star_count": 7,
"four_star_count": 1,
"three_star_count": 0,
"two_star_count": 0,
"one_star_count": 0,
"reviews": [
{
"comment_ID": "85",
"comment_post_ID": "105",
"comment_author": "Alex Smith",
"comment_content": "Exceptional course! Very clear and concise.",
"rating": 5,
"review_title": "Great practical examples"
}
]
}
}
```

### 404 Not Found
```json
{
"code": "not_found",
"message": "Rating not found for given ID",
"data": []
}
```
}
76 changes: 76 additions & 0 deletions docs/api/Courses/courses-{id}.bru
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
meta {
name: courses/{id}
type: http
seq: 2
}

get {
url: {{base_url}}/courses/1
body: none
auth: basic
}

auth:basic {
username: {{api_key}}
password: {{api_secret}}
}

docs {
# Get Course Details

Retrieves detailed metadata, settings, requirements, benefits, target audience, and video settings for a single course.

## HTTP Method & Route
- **Method:** `GET`
- **Route:** `/wp-json/tutor/v1/courses/:id`

## Authentication
- **Type:** Basic Auth (`api_key` / `api_secret`)
- **Required Permission:** `Read` or `All`

## Path Parameters

| Parameter | Type | Required | Description |
| :--- | :--- | :--- | :--- |
| `id` | `integer` | **Yes** | The WordPress Post ID of the course. |

## Responses

### 200 OK (Success)
```json
{
"code": "course_detail",
"message": "Course detail retrieved successfully",
"data": {
"course_settings": {
"maximum_students": "100",
"is_public": "no"
},
"course_price_type": "paid",
"course_duration": {
"hours": "4",
"minutes": "30"
},
"course_level": "all_levels",
"course_benefits": "Learn modern web development principles and build complete apps.",
"course_requirements": "Basic knowledge of HTML and CSS.",
"course_target_audience": "Beginner developers looking to expand their frontend skills.",
"course_material_includes": "Source code repository access, Certificate of Completion.",
"video": {
"source": "youtube",
"source_youtube": "https://www.youtube.com/watch?v=example"
},
"disable_qa": false
}
}
```

### 404 / Not Found
```json
{
"code": "course_detail",
"message": "Detail not found for given ID",
"data": []
}
```
}
Loading
Loading