> 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.

# Assigned Course List

POST https://localhost:8090//api/user/userCourses
Content-Type: application/x-www-form-urlencoded

The `POST /api/user/userdetailsbyuserid` endpoint is used to retrieve user assigned courses based on the user ID.

### Request

- Method: POST
    
- Base URL: {{baseUrl}}
    
- Path: /api/user/userCourses
    
- Headers:
    
    - Content-Type: application/x-www-form-urlencoded
        
- Body:
    
    - `idst` (text): The user ID for which details are to be retrieved.
        
    - `auth` (text): The authentication token for the request.
        

### Response

- The response will be in JSON format with the following structure:
    
    - `success` (boolean): Indicates the success of the request.
        
    - `courses` (array): An array of user courses.
        
        - `course_info` (object): Information about the course.
            
            - `code` (string): The code of the course.
                
            - `course_id` (string): The ID of the course.
                
            - `course_type` (string): The type of the course.
                
            - `course_name` (string): The name of the course.
                
            - `course_image` (string): The image of the course.
                
            - `course_description` (string): The description of the course.
                
            - `course_link` (string): The link to the course.
                
            - `user_status` (string): The status of the user in the course.
                
            - `waiting` (string): The waiting status.
                
            - `enrolled` (number): The number of users enrolled in the course.
                
            - `date_end` (string): The end date of the course.
                
            - `can_enter` (object): Information about user's access to the course.
                
                - `can` (boolean): Indicates if the user can enter the course.
                    
                - `reason` (string): The reason for access denial.
                    
                - `expiring_in` (boolean): Indicates if the access is expiring soon.
                    
            - `date_subscribed` (string): The date of subscription to the course.
                
            - `date_first_access` (string): The date of the first access to the course.
                
            - `course_stats` (object): Statistics about the course.
                
                - `status` (string): The status of the course.
                    
                - `date_first_access` (string): The date of the first access to the course.
                    
                - `date_complete` (string): The date of course completion.
                    
            - `dates` (array): An array of dates related to the course.

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

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: Tangerine365 Enterprise
  version: 1.0.0
paths:
  //api/user/userCourses:
    post:
      operationId: assigned-course-list
      summary: Assigned Course List
      description: >-
        The `POST /api/user/userdetailsbyuserid` endpoint is used to retrieve
        user assigned courses based on the user ID.


        ### Request


        - Method: POST
            
        - Base URL: {{baseUrl}}
            
        - Path: /api/user/userCourses
            
        - Headers:
            
            - Content-Type: application/x-www-form-urlencoded
                
        - Body:
            
            - `idst` (text): The user ID for which details are to be retrieved.
                
            - `auth` (text): The authentication token for the request.
                

        ### Response


        - The response will be in JSON format with the following structure:
            
            - `success` (boolean): Indicates the success of the request.
                
            - `courses` (array): An array of user courses.
                
                - `course_info` (object): Information about the course.
                    
                    - `code` (string): The code of the course.
                        
                    - `course_id` (string): The ID of the course.
                        
                    - `course_type` (string): The type of the course.
                        
                    - `course_name` (string): The name of the course.
                        
                    - `course_image` (string): The image of the course.
                        
                    - `course_description` (string): The description of the course.
                        
                    - `course_link` (string): The link to the course.
                        
                    - `user_status` (string): The status of the user in the course.
                        
                    - `waiting` (string): The waiting status.
                        
                    - `enrolled` (number): The number of users enrolled in the course.
                        
                    - `date_end` (string): The end date of the course.
                        
                    - `can_enter` (object): Information about user's access to the course.
                        
                        - `can` (boolean): Indicates if the user can enter the course.
                            
                        - `reason` (string): The reason for access denial.
                            
                        - `expiring_in` (boolean): Indicates if the access is expiring soon.
                            
                    - `date_subscribed` (string): The date of subscription to the course.
                        
                    - `date_first_access` (string): The date of the first access to the course.
                        
                    - `course_stats` (object): Statistics about the course.
                        
                        - `status` (string): The status of the course.
                            
                        - `date_first_access` (string): The date of the first access to the course.
                            
                        - `date_complete` (string): The date of course completion.
                            
                    - `dates` (array): An array of dates related to the course.
      tags:
        - ''
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Assigned Course List_Response_200'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                auth:
                  type: string
                idst:
                  type: string
              required:
                - auth
                - idst
servers:
  - url: https://localhost:8090
components:
  schemas:
    ApiUserUserCoursesPostResponsesContentApplicationJsonSchemaCoursesItemsCourseInfoCanEnter:
      type: object
      properties:
        can:
          type: boolean
        reason:
          type: string
        expiring_in:
          type: boolean
      required:
        - can
        - reason
        - expiring_in
      title: >-
        ApiUserUserCoursesPostResponsesContentApplicationJsonSchemaCoursesItemsCourseInfoCanEnter
    ApiUserUserCoursesPostResponsesContentApplicationJsonSchemaCoursesItemsCourseInfoCourseStats:
      type: object
      properties:
        status:
          type: string
        date_complete:
          description: Any type
        date_first_access:
          description: Any type
      required:
        - status
      title: >-
        ApiUserUserCoursesPostResponsesContentApplicationJsonSchemaCoursesItemsCourseInfoCourseStats
    ApiUserUserCoursesPostResponsesContentApplicationJsonSchemaCoursesItemsCourseInfo:
      type: object
      properties:
        code:
          type: string
        dates:
          type: array
          items:
            description: Any type
        waiting:
          type: string
        date_end:
          description: Any type
        enrolled:
          type: integer
        can_enter:
          $ref: >-
            #/components/schemas/ApiUserUserCoursesPostResponsesContentApplicationJsonSchemaCoursesItemsCourseInfoCanEnter
        course_id:
          type: string
        course_link:
          type: string
          format: uri
        course_name:
          type: string
        course_type:
          type: string
        user_status:
          type: string
        course_image:
          type: string
          format: uri
        course_stats:
          $ref: >-
            #/components/schemas/ApiUserUserCoursesPostResponsesContentApplicationJsonSchemaCoursesItemsCourseInfoCourseStats
        date_subscribed:
          type: string
        date_first_access:
          description: Any type
        course_description:
          type: string
        course_full_description:
          type: string
      required:
        - code
        - dates
        - waiting
        - enrolled
        - can_enter
        - course_id
        - course_link
        - course_name
        - course_type
        - user_status
        - course_image
        - course_stats
        - date_subscribed
        - course_description
        - course_full_description
      title: >-
        ApiUserUserCoursesPostResponsesContentApplicationJsonSchemaCoursesItemsCourseInfo
    ApiUserUserCoursesPostResponsesContentApplicationJsonSchemaCoursesItems:
      type: object
      properties:
        course_info:
          $ref: >-
            #/components/schemas/ApiUserUserCoursesPostResponsesContentApplicationJsonSchemaCoursesItemsCourseInfo
      required:
        - course_info
      title: ApiUserUserCoursesPostResponsesContentApplicationJsonSchemaCoursesItems
    Assigned Course List_Response_200:
      type: object
      properties:
        courses:
          type: array
          items:
            $ref: >-
              #/components/schemas/ApiUserUserCoursesPostResponsesContentApplicationJsonSchemaCoursesItems
        success:
          type: boolean
      required:
        - courses
        - success
      title: Assigned Course List_Response_200

```

## SDK Code Examples

```python Assigned Course List_example
import requests

url = "https://localhost:8090//api/user/userCourses"

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

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

print(response.json())
```

```javascript Assigned Course List_example
const url = 'https://localhost:8090//api/user/userCourses';
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 Assigned Course List_example
package main

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

func main() {

	url := "https://localhost:8090//api/user/userCourses"

	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 Assigned Course List_example
require 'uri'
require 'net/http'

url = URI("https://localhost:8090//api/user/userCourses")

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 Assigned Course List_example
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

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

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

$client = new \GuzzleHttp\Client();

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

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

```csharp Assigned Course List_example
using RestSharp;

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

```swift Assigned Course List_example
import Foundation

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

let request = NSMutableURLRequest(url: NSURL(string: "https://localhost:8090//api/user/userCourses")! 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()
```