Skip to product menu
Skip to main content

Fetch My Courses API

This API is used to fetch all the courses that you have joined

Request URL:

https://people.zoho.com/api/v1/courses/mycourses

Header:

Authorization: Zoho-oauthtoken 1000.8cb99dxxxxxxxx9be93.9b8xxxxxxf

Scope:

ZOHOPEOPLE.training.ALL
OR
ZOHOPEOPLE.training.READ

Possible Operation Types:

ALL - Complete access to data
READ - Only to read data

Method:

GET

Request Parameters

ParametersValues AllowedDefault ValueDescription
startIndex<Integer>0Specify from which record the response should be fetched
search<String>-Specify the string to check match with course name
type1|2|3-1-> Self paced
2-> Blended
3-> E-mat course
categoryId<CategoryId> | "MyfavouriteCategories"-Specify the categoryId
trainerId<TrainerId>-Specify the trainer id
statedrafted | published | disabled-Specify the course state
sortByname | -name-sortBy=name -> ascending order of name (A-Z)
sortBy=-name -> descending order of name (Z-A)
startDate<DateInMillis>-Specify start date to filter courses
endDate<DateInMillis>-Specify end date to filter courses
sharedToMetrue|false--
suggestedToMetrue|false--

Error Codes and Descriptions

Status CodesDescription
400Invalid parameter value/input parameter missing
403Sorry! You are not authorized to do this operation
404Not found
422Maximum limit exceeded
500Sorry! Server error occured

View complete list of LMS API error codes

Threshold Limit: 30 requests | Lock period: 5 minutes

Threshold Limit - Number of API calls allowed within a minute.
Lock Period - Wait time before consecutive API requests.

Request

Copiedimport okhttp3.*;

public class Main {
    public static void main(String[] args) {
        OkHttpClient client = new OkHttpClient();

        Request request = new Request.Builder()
            .url("https://people.zoho.com/api/v1/courses/mycourses")
            .get()
            .addHeader("Authorization", "Zoho-oauthtoken YOUR_ACCESS_TOKEN")
            .build();

        try (Response response = client.newCall(request).execute()) {
            System.out.println(response.body().string());
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
Copiedconst url = "https://people.zoho.com/api/v1/courses/mycourses";

const headers = {
    "Authorization": "Zoho-oauthtoken YOUR_ACCESS_TOKEN"
};

fetch(url, {
    method: "GET",
    headers: headers
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error("Error:", error));
Copiedcurl -X GET "https://people.zoho.com/api/v1/courses/mycourses" \
     -H "Authorization: Zoho-oauthtoken YOUR_ACCESS_TOKEN"
Copiedurl = "https://people.zoho.com/api/v1/courses/mycourses";
headers = map();
headers.put("Authorization", "Zoho-oauthtoken YOUR_ACCESS_TOKEN");

response = invokeurl
[
    url : url
    type : GET
    headers: headers
];

info response;
Copiedimport requests

url = "https://people.zoho.com/api/v1/courses/mycourses"

headers = {
    "Authorization": "Zoho-oauthtoken YOUR_ACCESS_TOKEN"
}

response = requests.get(url, headers=headers)

try:
    print(response.json())  # Handle potential empty responses or errors
except ValueError:
    print(response.text)  # Print raw response if JSON decoding fails

Show full

Show less

Header:

CopiedAuthorization: Zoho-oauthtoken 1000.8cb99dxxxxxxxx9be93.9b8xxxxxxf

Response:

Copied{
    "courses": [
        {
            "durationAsDisplayString": null,
            "canUserDisable": false,
            "isSharedCourse": false,
            "typeAsDisplayString": "Blended learning",
            "description": null,
            "type": "2",
            "canUserShare": true,
            "canUserDelete": true,
            "statusAsDisplayString": "Published",
            "currentUserRole": {
                "settingsAdmin": false,
                "courseOwner": true,
                "trainer": true,
                "sharedUser": false,
                "learner": false,
                "admin": true,
                "courseAdmin": true,
                "dataAdmin": false
            },
            "courseImageURL": "https://people.zoho.com/newhr/images/lmsbg/cat32.png",
            "name": "Public API Testing (BL)",
            "isDisabled": false,
            "isFavourite": false,
            "courseId": "219225000000645203",
            "publishStatus": "published",
            "status": 1
        },
        {
            "durationAsDisplayString": null,
            "canUserDisable": false,
            "isSharedCourse": false,
            "typeAsDisplayString": "Self paced learning",
            "description": null,
            "type": "1",
            "canUserShare": true,
            "canUserDelete": true,
            "statusAsDisplayString": "Published",
            "currentUserRole": {
                "settingsAdmin": false,
                "courseOwner": true,
                "trainer": false,
                "sharedUser": false,
                "learner": false,
                "admin": true,
                "courseAdmin": true,
                "dataAdmin": false
            },
            "courseImageURL": "https://people.zoho.com/newhr/images/lmsbg/cat31.png",
            "name": "Public API Testing(SP)",
            "isDisabled": false,
            "isFavourite": false,
            "courseId": "219225000000642002",
            "publishStatus": "published",
            "status": 1
        },
        {
            "durationAsDisplayString": null,
            "canUserDisable": false,
            "isSharedCourse": false,
            "typeAsDisplayString": "E-Material",
            "description": null,
            "type": "3",
            "canUserShare": true,
            "canUserDelete": true,
            "statusAsDisplayString": null,
            "currentUserRole": {
                "settingsAdmin": false,
                "courseOwner": true,
                "trainer": false,
                "sharedUser": false,
                "learner": false,
                "admin": true,
                "courseAdmin": true,
                "dataAdmin": false
            },
            "courseImageURL": "https://people.zoho.com/newhr/images/lmsbg/cat11.png",
            "name": "ABCDEFG - EMAT",
            "isDisabled": false,
            "isFavourite": false,
            "courseId": "219225000000234001",
            "publishStatus": null,
            "status": 2
        },
        {
            "durationAsDisplayString": null,
            "canUserDisable": false,
            "isSharedCourse": false,
            "typeAsDisplayString": "Self paced learning",
            "description": "THIS IS COURSE DESCRIPTION.",
            "type": "1",
            "canUserShare": true,
            "canUserDelete": true,
            "statusAsDisplayString": "Published",
            "currentUserRole": {
                "settingsAdmin": false,
                "courseOwner": true,
                "trainer": false,
                "sharedUser": false,
                "learner": false,
                "admin": true,
                "courseAdmin": true,
                "dataAdmin": false
            },
            "courseImageURL": "https://people.zoho.com/newhr/images/lmsbg/cat1.png",
            "name": "B123",
            "isDisabled": false,
            "isFavourite": true,
            "courseId": "219225000000172466",
            "publishStatus": "published",
            "status": 1
        }
    ],
    "code": "200",
    "message": "success",
    "hasMoreRecords": false
}

Show full

Show less