> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.tangerine365.com/llms.txt.
> For full documentation content, see https://docs.tangerine365.com/llms-full.txt.

# Course List

POST https://localhost:8090//api/course/courses
Content-Type: application/x-www-form-urlencoded

The API endpoint `{{baseUrl}}/api/course/courses` is a POST request that is used to retrieve a list of courses.

### Request

- Method: POST
    
- Base URL: {{baseUrl}}
    
- Path: /api/course/categories
    
- Headers:
    
    - Content-Type: application/x-www-form-urlencoded
        

### Request Body

The request body for this endpoint is of type x-www-form-urlencoded.

- `idst` (string): User ID
    
- `auth` (string): Authentication token.
    
- `category` (string): Category ID
    
- `page` (string): Page number to return
    
- `limit` (string): Number of records to return.
    

### Response

Upon a successful execution of the request, the API returns a JSON response with a status code of 200. The `courses` key in the response contains an array of course objects. Each course object consists of the following fields:

- `course_id` (string): The unique identifier for the course.
    
- `code` (string): The code associated with the course.
    
- `course_name` (string): The name of the course.
    
- `course_description` (string): The description of the course.
    
- `course_box_description` (string): The box description of the course.
    
- `status` (string): The status of the course.
    
- `selling` (string): The selling status of the course.
    
- `price` (string): The price of the course.
    
- `subscribe_method` (string): The method for subscribing to the course.
    
    - `0` - Only Admin can subscribe users to the course
        
    - `1` - Subscription requires admin approval
        
    - `2` - Subscription is free to all
        
- `unsubscribe_method` (string): The method for unsubscribing from the course.
    
    - `0` - Only Admin can unsubscribe users to the course
        
    - `1` - Unsubscription requires admin approval
        
    - `2` - Unsubscription is free to all
        
- `course_edition` (string): The edition of the course.
    
- `course_type` (string): The type of the course.
    
- `can_subscribe` (string): The subscription availability status.
    
    - `0` - Subscription is closed
        
    - `1` - Subscription is open at all times
        
    - `2` - Subscription is open only when the current date is within the subscription start and end date set on the course (Key: sub_start_date sub_end_date
        
- `sub_start_date` (string): The start date for subscription.
    
- `sub_end_date` (string): The end date for subscription.
    
- `date_begin` (string): The start date of the course.
    
- `date_end` (string): The end date of the course.
    
- `course_link` (string): The link to the course.
    
- `img_course` (string): The image associated with the course.
    
- `category_id` (string): The unique identifier for the category of the course.
    
- `category` (string): The category of the course.
    
- `enrolled` (string): The enrollment status of the course.
    
- `dates` (array): An array of dates associated with the course.
    

Each field in the `courses` response object represents a specific attribute of the course and is accompanied by its respective data type.

Reference: https://docs.tangerine365.com/tangerine-365-enterprise/course-list

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: Tangerine365 Enterprise
  version: 1.0.0
paths:
  //api/course/courses:
    post:
      operationId: course-list
      summary: Course List
      description: >-
        The API endpoint `{{baseUrl}}/api/course/courses` is a POST request that
        is used to retrieve a list of courses.


        ### Request


        - Method: POST
            
        - Base URL: {{baseUrl}}
            
        - Path: /api/course/categories
            
        - Headers:
            
            - Content-Type: application/x-www-form-urlencoded
                

        ### Request Body


        The request body for this endpoint is of type x-www-form-urlencoded.


        - `idst` (string): User ID
            
        - `auth` (string): Authentication token.
            
        - `category` (string): Category ID
            
        - `page` (string): Page number to return
            
        - `limit` (string): Number of records to return.
            

        ### Response


        Upon a successful execution of the request, the API returns a JSON
        response with a status code of 200. The `courses` key in the response
        contains an array of course objects. Each course object consists of the
        following fields:


        - `course_id` (string): The unique identifier for the course.
            
        - `code` (string): The code associated with the course.
            
        - `course_name` (string): The name of the course.
            
        - `course_description` (string): The description of the course.
            
        - `course_box_description` (string): The box description of the course.
            
        - `status` (string): The status of the course.
            
        - `selling` (string): The selling status of the course.
            
        - `price` (string): The price of the course.
            
        - `subscribe_method` (string): The method for subscribing to the course.
            
            - `0` - Only Admin can subscribe users to the course
                
            - `1` - Subscription requires admin approval
                
            - `2` - Subscription is free to all
                
        - `unsubscribe_method` (string): The method for unsubscribing from the
        course.
            
            - `0` - Only Admin can unsubscribe users to the course
                
            - `1` - Unsubscription requires admin approval
                
            - `2` - Unsubscription is free to all
                
        - `course_edition` (string): The edition of the course.
            
        - `course_type` (string): The type of the course.
            
        - `can_subscribe` (string): The subscription availability status.
            
            - `0` - Subscription is closed
                
            - `1` - Subscription is open at all times
                
            - `2` - Subscription is open only when the current date is within the subscription start and end date set on the course (Key: sub_start_date sub_end_date
                
        - `sub_start_date` (string): The start date for subscription.
            
        - `sub_end_date` (string): The end date for subscription.
            
        - `date_begin` (string): The start date of the course.
            
        - `date_end` (string): The end date of the course.
            
        - `course_link` (string): The link to the course.
            
        - `img_course` (string): The image associated with the course.
            
        - `category_id` (string): The unique identifier for the category of the
        course.
            
        - `category` (string): The category of the course.
            
        - `enrolled` (string): The enrollment status of the course.
            
        - `dates` (array): An array of dates associated with the course.
            

        Each field in the `courses` response object represents a specific
        attribute of the course and is accompanied by its respective data type.
      tags:
        - ''
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Course List_Response_200'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                auth:
                  type: string
                idst:
                  type: string
                page:
                  type: string
                limit:
                  type: string
                category:
                  type: string
              required:
                - auth
                - idst
                - page
                - limit
                - category
servers:
  - url: https://localhost:8090
components:
  schemas:
    ApiCourseCoursesPostResponsesContentApplicationJsonSchemaMeta:
      type: object
      properties:
        total_items:
          type: string
        total_pages:
          type: integer
        current_page:
          type: integer
      required:
        - total_items
        - total_pages
        - current_page
      title: ApiCourseCoursesPostResponsesContentApplicationJsonSchemaMeta
    ApiCourseCoursesPostResponsesContentApplicationJsonSchemaCoursesItems:
      type: object
      properties:
        code:
          type: string
        dates:
          type: array
          items:
            description: Any type
        price:
          type: string
        status:
          type: string
        selling:
          type: string
        category:
          type: string
        date_end:
          description: Any type
        enrolled:
          type: string
        course_id:
          type: string
        date_begin:
          description: Any type
        img_course:
          type: string
          format: uri
        category_id:
          type: string
        course_link:
          type: string
          format: uri
        course_name:
          type: string
        course_type:
          type: string
        sub_end_date:
          description: Any type
        can_subscribe:
          type: string
        course_edition:
          type: string
        sub_start_date:
          description: Any type
        subscribe_method:
          type: string
        course_description:
          type: string
        unsubscribe_method:
          type: string
        course_box_description:
          type: string
      required:
        - code
        - dates
        - price
        - status
        - selling
        - category
        - enrolled
        - course_id
        - img_course
        - category_id
        - course_link
        - course_name
        - course_type
        - can_subscribe
        - course_edition
        - subscribe_method
        - course_description
        - unsubscribe_method
        - course_box_description
      title: ApiCourseCoursesPostResponsesContentApplicationJsonSchemaCoursesItems
    Course List_Response_200:
      type: object
      properties:
        meta:
          $ref: >-
            #/components/schemas/ApiCourseCoursesPostResponsesContentApplicationJsonSchemaMeta
        courses:
          type: array
          items:
            $ref: >-
              #/components/schemas/ApiCourseCoursesPostResponsesContentApplicationJsonSchemaCoursesItems
        success:
          type: boolean
      required:
        - meta
        - courses
        - success
      title: Course List_Response_200

```

## SDK Code Examples

```python Course List_example
import requests

url = "https://localhost:8090//api/course/courses"

payload = ""
headers = {"Content-Type": "application/x-www-form-urlencoded"}

response = requests.post(url, data=payload, headers=headers)

print(response.json())
```

```javascript Course List_example
const url = 'https://localhost:8090//api/course/courses';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/x-www-form-urlencoded'},
  body: new URLSearchParams('')
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Course List_example
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://localhost:8090//api/course/courses"

	req, _ := http.NewRequest("POST", url, nil)

	req.Header.Add("Content-Type", "application/x-www-form-urlencoded")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Course List_example
require 'uri'
require 'net/http'

url = URI("https://localhost:8090//api/course/courses")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/x-www-form-urlencoded'

response = http.request(request)
puts response.read_body
```

```java Course List_example
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://localhost:8090//api/course/courses")
  .header("Content-Type", "application/x-www-form-urlencoded")
  .asString();
```

```php Course List_example
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://localhost:8090//api/course/courses', [
  'form_params' => null,
  'headers' => [
    'Content-Type' => 'application/x-www-form-urlencoded',
  ],
]);

echo $response->getBody();
```

```csharp Course List_example
using RestSharp;

var client = new RestClient("https://localhost:8090//api/course/courses");
var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/x-www-form-urlencoded");
IRestResponse response = client.Execute(request);
```

```swift Course List_example
import Foundation

let headers = ["Content-Type": "application/x-www-form-urlencoded"]

let request = NSMutableURLRequest(url: NSURL(string: "https://localhost:8090//api/course/courses")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```