Fetch Single Course API

This API is used to fetch single course info

Request URL:

https://people.zoho.com/api/v1/courses/<courseId>

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
batchId <batchId>-Specify the batch for blended learning course

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/YOUR_COURSE_ID")
            .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/YOUR_COURSE_ID";

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/YOUR_COURSE_ID" \
     -H "Authorization: Zoho-oauthtoken YOUR_ACCESS_TOKEN"
Copiedurl = "https://people.zoho.com/api/v1/courses/YOUR_COURSE_ID";
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/YOUR_COURSE_ID"

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

Header:

CopiedAuthorization: Zoho-oauthtoken 1000.8cb99dxxxxxxxx9be93.9b8xxxxxxf

Response:

Copied{
    "code": "200",
    "course": {
        "canUserRequestToJoin": false,
        "canUserAddLearners": true,
        "durationAsDisplayString": null,
        "courseCode": null,
        "description": null,
        "courseURL": "https://people.zoho.com/peoplelms/zp/lmscourse#lms-learner/course/219225000000642002/overview",
        "type": "1",
        "canUserGiveFeedback": true,
        "canUserShare": true,
        "canUserDelete": true,
        "permissionSettings": {
            "whenAModuleIsConsideredAsCompleted": "2",
            "whoCanEnroll": [
                "admin",
                "courseAdmin",
                "learner"
            ],
            "whenAnEntityIsConsideredAsCompleted": "1",
            "whenACourseIsConsideredAsCompleted": "4",
            "whoCanUnenroll": [
                "admin",
                "courseAdmin"
            ]
        },
        "hasUserCompleted": false,
        "canUserUnpublish": true,
        "canUserSuggest": false,
        "currentUserRole": {
            "settingsAdmin": false,
            "courseOwner": true,
            "trainer": false,
            "sharedUser": false,
            "learner": false,
            "admin": true,
            "courseAdmin": true,
            "dataAdmin": false
        },
        "canUserShareCourseURL": false,
        "isSuggestedCourse": false,
        "isDisabled": false,
        "categories": [
            {
                "name": "General",
                "categoryId": "219225000000170981"
            }
        ],
        "isFavourite": false,
        "courseId": "219225000000642002",
        "aboutCourse": "<div><b><span class=\"size\" style=\"font-size:24px\">Learning outcomes</span></b><span class=\"size\" style=\"font-size:24px\"></span><br></div><div><span class=\"size\" style=\"font-size:16px\">What will the learner gain by attending this course. List the key learning takeaways.</span><br></div><div><br></div><div><br></div><div><b><span class=\"size\" style=\"font-size:24px\">About course</span></b><span class=\"size\" style=\"font-size:24px\"></span><br></div><div><span class=\"size\" style=\"font-size:16px\">Explain what is covered in the course along with details on the course content.</span><br></div><div><br></div>",
        "publishStatus": "published",
        "hasUserStarted": true,
        "introFiles": [
            {
                "resourceId": "219225000000645041",
                "extension": "html",
                "isDownloadable": false,
                "previewURL": "https://downloadcc-accl.zoho.com/webdownload?x-service=people&event-id=104752004_ZPEOPLE_LMS_1572&x-cli-msg=%7B%22mode%22%3A%22LMS%22%2C%22portalId%22%3A%2226484356%22%2C%22isInline%22%3Atrue%2C%22isThumbnail%22%3Afalse%2C%22type%22%3A5%2C%22fileId%22%3A219225000000645041%7D",
                "size": "38",
                "name": "Test Content",
                "type": "text&#x2f;html"
            },
            {
                "resourceId": "219225000000645181",
                "extension": "png",
                "isDownloadable": false,
                "size": "127648",
                "name": "Test File",
                "type": "image&#x2f;png"
            },
            {
                "resourceId": "219225000000645195",
                "extension": "png",
                "isDownloadable": false,
                "size": "288019",
                "name": "Another test file",
                "type": "image&#x2f;png"
            },
            {
                "resourceId": "219225000000648115",
                "extension": "png",
                "isDownloadable": false,
                "size": "127648",
                "name": "File API Testing_update",
                "type": "image&#x2f;png"
            }
        ],
        "canUserFavourite": true,
        "progressAsDisplayString": "0 of 15 Completed",
        "canUserDisable": false,
        "typeAsDisplayString": "Self paced learning",
        "isSharedCourse": false,
        "canUserDeleteLearners": true,
        "percentageOfProgress": 0,
        "courseOwners": [
            {
                "erecno": "219225000000036453",
                "displayName": "Henry",
                "employeeId": "0001",
                "emailId": "henry@zohotest.com",
                "displayPictureURL": "https://contacts.zoho.com/file?ID=2232855&fs=thumb"
            }
        ],
        "canUserStartDiscussion": true,
        "canUserComplete": false,
        "statusAsDisplayString": "Published",
        "canUserUnEnroll": true,
        "canUserUnfavourite": true,
        "canUserRevokeCompletion": false,
        "courseImageURL": "https://people.zoho.com/newhr/images/lmsbg/cat31.png",
        "canUserPublish": true,
        "name": "Public API Testing(SP)",
        "courseAdmins": [
            {
                "erecno": "219225000000036453",
                "displayName": "Henry",
                "employeeId": "0001",
                "emailId": "henry@zohotest.com",
                "displayPictureURL": "https://contacts.zoho.com/file?ID=2232855&fs=thumb"
            }
        ],
        "canUserEnroll": true,
        "canUserPreview": true,
        "status": 1
    },
    "message": "success"
}