Update the settings of a course lesson.

Open in ChatGPT Open in ChatGPT to ask questions about this page
Open in Claude Open in Claude to ask questions about this page
Copy as MarkdownCopy this page as markdown to use with AI assistants
View as Markdown Open this page as markdown in a new tab

Turns free preview, file download and the discussion on or off for a course lesson. Only the keys you send in sessionSetting are changed.

Endpoint

put https://{TrainerCentral-API-Domain}/tc/api/v1/trainer/sessionSettings/{sessionId}.json

OAuth Scope

TrainerCentral.sessionapi.UPDATECopied!

Headers

tc-orgIdstring(Required)

ID of the academy (orgId).

Example
51517414

Path Parameters

sessionIdstring(Required)

ID of the course lesson (sessionId).

Request Body

application/json
sessionSettingJSON Object(Required)

Lesson settings to change; send only the keys to change.

Hide Sub-Attributes
makeDownloadableboolean(Optional)

true lets enrolled learners download the lesson files.

allowFreePreviewboolean(Optional)

true lets visitors who are not enrolled preview the lesson.

enableDiscussionboolean(Optional)

true turns on the lesson discussion; false turns it off.

Request Example

cURL
cURL
Java
Python
Deluge
Copied!
curl --request PUT \
  --url https://trainercentral.zoho.com/tc/api/v1/trainer/sessionSettings/{sessionId}.json \
  --header 'Authorization: Zoho-oauthtoken d92d4xxxxxxxxxxxxx15f52' \
  --header 'content-type: application/json' \
  --header 'tc-orgId: 51517414' \
  --data '{"sessionSetting":{"allowFreePreview":true,"makeDownloadable":true}}'

Body Parameters

Turn on free preview and download.

Turn on free preview and download.

Turn on the lesson discussion.

Copied!
  {
    "sessionSetting": {
      "allowFreePreview": true,
      "makeDownloadable": true
    }
  }
                
  {
    "sessionSetting": {
      "enableDiscussion": true
    }
  }
                
▼ Show full

Response Parameters

sessionSettingJSON Object

Settings of the lesson after the update.

Hide Sub-Attributes
idstring

ID of the lesson (sessionId).

sessionIdstring

ID of the lesson (sessionId).

allowFreePreviewstring

true when visitors who are not enrolled can preview the lesson.

makeDownloadablestring

true when enrolled learners can download the files of the lesson.

enableDiscussionstring

true when the lesson discussion is turned on.

errorJSON Object

Error details.

Hide Sub-Attributes
codestring

Deprecated numeric error code (for example ST_202). Prefer codeStr; omitted from doc samples.

codeStrstring

Error code name (ShowtimeErrorCode / err_code_str), for example MISSING_PARAMETER.

messagestring

Error message.

Possible Error Codes

HTTP CodeError CodeDescription
500ST_79

INVALID_SESSION - The sessionId does not match a session in this academy. Pass a valid sessionId. Do not retry unchanged.

ST_401

SESSION_DELETED - The session was deleted. Use a session that is not deleted. Do not retry unchanged.

ST_102

UNAUTHORISED_ACCESS - The user is not an academy owner or admin or a course admin or trainer, or the plan does not include session settings. Use one of these roles or upgrade the plan; do not retry unchanged.

ST_406

FEATURE_NOT_AVAILABLE - A setting sent (such as enableDiscussion) is not on the academy plan. Upgrade the plan or leave the key out. Do not retry unchanged.

ST_591

PERMISSION_DENIED_FOR_THE_SHOWTIME_MODULE - The discussion group for the lesson could not be created. Retry later.

ST_65

ERROR_WHILE_CREATING_SETTINGS_FOR_TALK - The settings could not be saved, for example enableDiscussion was sent for a session that is not a course lesson. Pass a course lesson; if it still fails, retry later.

Response Example

Response after turning on free preview and download.

200
200
400
500
Copied!
  {
    "sessionSetting": {
      "id": "3000000000040",
      "sessionId": "3000000000040",
      "allowFreePreview": "true",
      "makeDownloadable": "true",
      "enableDiscussion": "false"
    }
  }
                
  {
    "error": {
      "code": "string",
      "codeStr": "string",
      "message": "string"
    }
  }
                
500 Request failed; see the error code.
▼ Show full