Embed a link to a lesson API

Embed a link to a lesson API


Description: To embed a link (a link to any content material) to any lesson hosted under a course

Request URL: /api/v4/<orgId>/sessionMaterials.json (How to get my OrgId?)

Method: POST

OAuth scope: TrainerCentral.sessionapi.CREATE

Params

  1. {
  2. "sessionMaterial":{
  3.                                 "resourceType":7,
  4.                                 "sessionId":"<sessionId>",
  5.                                 "viewType":0,
  6.                                 "linkTitle":"<title link>",
  7.                                 "linkAddress":"<link>"
  8.                                }
  9. }

Parameterss - description:


1. sessionId - The Id of the lesson (hosted under a course) to which the link is to be embedded. 
2. linkTitle - A title for the embedded link. 
3. linkAddress - The link to be embedded. 

4. resourceType - 7 for embed link.

Sample response for embed link

  1. {
  2.   "sessionMaterialSettings": 
  3.     [
  4.      {
  5.        "sessionMaterialSettingsId”:<sessionMaterialSettingId>,
  6.        "sessionMaterial”:<sessionMaterialId>,
  7.        "createdTime":"1646217085987",
  8.        "id”:<emberdLinkId>,
  9.        "sessionId”:<sessionId>,
  10.        "value":"https://trainercentral.com",
  11.        "key":"LINK_ADDRESS",
  12.        "sessionMaterialId”:<sessionMaterialId>
  13.      },
  14.     {
  15.       "sessionMaterialSettingsId”:<sessionMaterialSettingId>,
  16.        "sessionMaterial”:<sessionMaterialId>,
  17.        "createdTime":"1646217085987",
  18.        "id”:<emberdLinkId>,
  19.        "sessionId”:<sessionId>,
  20.        "value”:”Title”,
  21.      "key":"LINK_TITLE",
  22.      "sessionMaterialId”:<sessionMaterialId>
  23.     }
  24.   ],
  25.   "sessionMaterials":
  26.    [
  27.      {
  28. "session”:<sessionId>,
  29. "viewType":"0",
  30. "topic":"title",
  31. "sessionMaterialIndex":"0",
  32. "time":"1646217085987",
  33. "id”:<sessionId>,
  34. "sessionMaterialId”:<sessionMaterialId>,
  35. "resourceType":"7"
  36.      }
  37.   ]
  38. }


    • Related Articles

    • List of all TrainerCentral APIs

      Getting Started Get Oauth token API Course APIs Create chapter API Edit chapter API Create course API Edit course API Create lesson API Edit lesson API Create assignment API Delete lesson/live workshop/assignment API Delete chapter API Delete course ...
    • Edit lesson API

      Description: To edit a lesson inside a course. Request URL: <domain>/api/v4/<orgId>/sessions/<sessionId>.json Method: PUT OAuth Scope: TrainerCentral.sessionapi.UPDATE Parameters: NA Request Body:  {   "session": {      "name":"<lesson name>",     ...
    • Create lesson API

      Description: To create a lesson under a course in an academy. Request URL: /api/v4/<orgId>/sessions.json (How do I get my orgId?) Method: POST OAuth scope: TrainerCentral.sessionapi.CREATE Parameters for creating an on-demand lesson { "session":{ ...
    • Delete lesson/live workshop/assignment API

      Description: To delete a lesson or live workshop or assignment in a course. Request URL: <domain>/api/v4/<orgId>/sessions/<sessionId>.json [where <sessionId> refers to lesson ID or live workshop ID or assignment ID] Method: DELETE OAuth Scope: ...
    • Upload lesson content in a course

      In TrainerCentral, you can provide materials like texts, documents, audio, videos, PDFs, spreadsheets, images, and external links to learners. You can also offer downloadable handouts to enhance learners understanding. Configuring tests enable you to ...