Create lesson API

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


  1. {
  2. "session":{
  3.                  "name":"<session name>",
  4.                  "courseId":"<courseId>",
  5.                  "sectionId":"<sectionId>",
  6.                  "deliveryMode":4
  7.                  }
  8. }

Parameters - description


1. name - The name of the lesson (it can be on-demand or live)
2. courseId - The Id of the course under which the lesson has to be created. 
3. sectionId - The Id of the chapter under which session has to be created. 
4. deliveryMode - 4 for an on-demand session, 3 for a live session. 
5. scheduledTime - The scheduled start time of the live lesson in milliseconds. 
6. scheduledEndTime - The scheduled end time of the live lesson in milliseconds. 

7. timezone - The timezone set for the above mentioned start/end timings. 

 

Sample response for an on-demand lesson

  1. {
  2.   "ticketsInfo":
  3.     {
  4.       "tickets":
  5. {
  6.   "session”:<sessionId>,
  7.   "maximumPurchaseLimit":"1",
  8.           "paymentOrgId”:<paymentOrgId>,
  9.   "description”:<description>,
  10.   "orgId”:<orgId>,
  11.   "frequency":"1",
  12.   "paymentType":"0",
  13.   "createdTime":"1646208424732",
  14.   "lastUpdatedTime":"1646208424732",
  15.   "id”:<sessionId>,
  16.   "deletedTime":"-1",
  17.   "expiryDurationType":"0",
  18.   "lastUpdatedBy”:<userId>,
  19.   "amount":"0.0",
  20.   "isTaxable":"false",
  21.   "ticketType":"0",
  22.   "sessionId”:<sessionId>,
  23.   "isDefault":"true",
  24.   "createdBy”:<userId>,
  25.   "billingCycle":"-1",
  26.   "frequencyType":"-1",
  27.   "name”:<sessionName>,
  28.   "expiryDuration":"0",
  29.   "ticketId”:<sessionTicketId>,
  30.   "status":"1"
  31. }
  32.    },
  33. "sessionMembers":
  34. [
  35. {
  36. "country":"us",
  37. "role":"1",
  38. "encryptedSessionMemberId”:<encrytpedSessionMemberId>,
  39. "session”:<sessionId>,
  40. "sessionMemberId”:<sessionMemberId>,
  41. "language":"en",
  42. "emailId”:<userEmail>,
  43. "sessionId”:<sessionId>,
  44. "presenterImageUrl”:<presenterImageURL>,
  45. "userId”:<userId>,
  46. "orgId”:<orgId>,
  47. "name”:<userName>,
  48. "createdTime":"1646208424693",
  49. "time":"1646208424693",
  50. "id”:<sessionMemberId>
  51. }
  52. ],
  53. "session":
  54. {
  55. "sessionIndex":"0",
  56. "timezone”:<usertimezoneSet>,
  57. "attendeeLimit”:<attendeeLimit>,
  58. "createdbyName”:<userName>,
  59. "orgId”:<orgId>,
  60. "protoFlag":"1",
  61. "recurringType":"0",
  62. "deliveryMode":"4",
  63. "sessionType":"1",
  64. "course”:<courseId>,
  65. "createdTime":"1646208424680",
  66. "scheduledBy”:<userId>,
  67. "id”:<id>,
  68. "joinURL”:<session join url>,
  69. "deletedTime":"-1",
  70. "courseId”:<courseId>,
  71. "registeredCount":"0",
  72. "invitedCount":"0",
  73. "orgName”:<orgName>,
  74. "scheduledTime":"1646208424676",
  75. "presenterAutoStartUrl”:<presenterAutoStartURL>,
  76. "presenterUrl”:<presenterURL>,
  77. "uniqueKey”:<UniqueKey>,
  78. "sessionId”:<sessionId>,
  79. "attendedCount":"0",
  80. "paymentsHomePageURL”:<paymentsURL>,
  81. "referrer":"1",
  82. "scheduleType":"0",
  83. "createdBy”:<userId>,
  84. "name”:”<sessionName>,
  85. "zaid”:<zaid>,
  86. "memberRole":"2"
  87. },
  88. "talks":
  89. [
  90.   {
  91. "owner”:<userId>,
  92. "scheduledTime":"1646208424676",
  93. "deliveryMode":"4",
  94. "session”:<sessionId>,
  95. "sessionType":"1",
  96. "id”:<sessionId>,
  97. "sessionId”:<sessionId>,
  98. "talkId”:<talkId>,
  99. "orgId”:<orgId>,
  100. "status":"1",
  101. "registeredCount":"0"
  102. }
  103. ],
  104. "sessionCategories":[]
  105. }

 

Parameters for creating a live lesson under a course

  1. {
  2. "session":
  3.   {
  4.     "name":<sessionName>,
  5.     "scheduledTime":<session Start time>, 
  6.   "scheduledEndTime":<session end time>, 
  7.     "deliveryMode":3, 
  8.     "timezone":"Asia/Calcutta", 
  9.     "description":<session description>,
  10.   "courseId":"<courseId>",
  11.   "sectionId":"<sectionId>",
  12.   "sessionSettings":
  13.   {
  14.     "enableClientLogin":true,
  15.     "recurringType":0
  16.   }
  17. }
  18. }

Sample response for a live lesson hosted under a course

  1. {
  2.   "ticketsInfo":
  3.     {
  4.       "tickets":
  5.         {
  6.         "session”:<sessionId>,
  7.         "maximumPurchaseLimit":"1",
  8.         "paymentOrgId”:<paymentsOrgId>,
  9.         "description”:<description>,
  10.         "orgId”:<orgId>,
  11.         "frequency":"1",
  12.         "paymentType":"0",
  13.         "createdTime":"1646210370550",
  14.         "lastUpdatedTime":"1646210370550",
  15.         "id":"<ticketId>",
  16.         "deletedTime":"-1",
  17.         "expiryDurationType":"0",
  18.         "lastUpdatedBy”:<userId>,
  19.         "amount":"0.0",
  20.         "isTaxable":"false",
  21.         "ticketType":"0",
  22.         "sessionId”:<sessionId>,
  23.         "isDefault":"true",
  24.         "createdBy”:<userId>,
  25.         "billingCycle":"-1",
  26.         "frequencyType":"-1",
  27.         "name”:”<session name>,
  28.         "expiryDuration":"0",
  29.         "ticketId”:<ticketId>,
  30.         "status":"1"
  31.       }
  32.    },
  33.    "sessionMembers": 
  34.     [
  35.       {
  36.        "country":"us",
  37.        "role":"1",
  38. "encryptedSessionMemberId”:<encryptedSessionMemberId>,
  39. "session":<sessionId>,
  40. "sessionMemberId":<sessionMemberId>,
  41. "language":"en",
  42. "emailId”:<userEmaild>,
  43. "sessionId”:<sessionId>,
  44. "presenterImageUrl”:<userImageURL>,
  45. "userId”:<userId>,
  46. "orgId”:<orgId>,
  47. "name”:<userName>,
  48. "createdTime":"1646210370523",
  49. "time":"1646210370523",
  50. "id”:<sessionMemberId>
  51. }
  52.       ],
  53.       "session":
  54. {
  55.   "sessionIndex":"0",
  56.   "timezone”:<userTimeZoneSet>,
  57.           "description”:<description>,
  58.           "attendeeLimit":"100",
  59.           "createdbyName”:<userName>,
  60.           "orgId”:<orgId>,
  61.           "protoFlag":"1",
  62.           "recurringType":"0",
  63.           "descriptionId”:<descriptionId>,
  64.           "deliveryMode":"3",
  65.           "sessionType":"1",
  66.           "course”:<courseId>,
  67.           "createdTime":"1646210370510",
  68.           "scheduledBy”:<userId>,
  69.           "id”:”<sessionId>,
  70.           "joinURL”:<joinURL>,
  71.           "deletedTime":"-1",
  72.           "courseId”:<courseId>,
  73.           "registeredCount":"0",
  74.           "invitedCount":"0",
  75.           "orgName”:<orgName>,
  76.           "scheduledTime":"1646210400000",
  77.           "presenterAutoStartUrl”:<presenterAutoStartUrl>,
  78.           "presenterUrl”:<presenterURL>,
  79.           "uniqueKey”:<uniqueKey>,
  80.           "scheduledEndTime":"1646214000000",
  81.           "sessionId”:<sessionId>,
  82.           "attendedCount":"0",
  83.           "paymentsHomePageURL”:<paymentsURL>,
  84.           "referrer":"1",
  85.           "scheduleType":"0",
  86.           "createdBy”:<userId>,
  87.           "name”:<sessionName>,
  88.           "zaid”:<zaid>,
  89.           "memberRole":"2"
  90.      },
  91.     "talks":
  92.      [
  93.        {
  94. "owner”:<userId>,
  95. "scheduledTime":"1646210400000",
  96. "deliveryMode":"3",
  97. "session”:<sessionId>,
  98. "scheduledEndTime":"1646214000000",
  99. "sessionType":"1",
  100. "id”:<talkId>,
  101. "sessionId”:<sessionId>,
  102. "talkId”:<talkId>,
  103. "orgId”:<orgId>,
  104. "status":"1",
  105. "registeredCount":"0"
  106.        }
  107.     ],
  108.    "sessionCategories":[]
  109. }

      

 

 

  

 

 

 

 

 

 

 


    • 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 ...
    • Create a Group

      The Groups feature helps you create a group with a specific set of learners to monitor their course progress and certifications. The admin can assign a moderator for each group, and the moderator will be able to monitor the learners' progress. Let's ...
    • 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 { ...
    • Create chapter API

      Description: To create a chapter under a course in academy Request URL: /api/v4/<orgId>/sections.json (How do I get my orgId?) Method: POST OAuth scope: TrainerCentral.sectionapi.CREATE Parameters: { "section":{ "courseId": "<courseId>", "name": ...
    • 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>",     ...