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