We recommend the “/bulkimports/courses?” endpoint for situations where you need to create or update multiple courses via the API. To update courses, be sure to provide the “CourseCode” value in the request body for each course record that needs to be updated in the import. This value needs to match the “Course code for importing people in bulk” as found under the course settings of each course record.
The POST method will be used to create and update course records. Both XML or JSON formats are accepted. The course bulk import invokes the same import process as the functionality available to Admin from the UI.
Create a new Course Bulk Import for an organization:
Important Notes:
-
Body size max is 2,000kb, the equivalent of nearly 2000 rows.
-
Course Name and Active are required fields.
-
Course Code is required to update existing course records. These codes can be located in the UI on the Course settings pages, otherwise they are available via the API GET /Courses? endpoint.
-
The AdvCourseCustomFields are based on org setup. If the org has mandatory custom fields, these become required in the import else they’re optional.
-
The field value for a course custom field must comply with the chosen field type, or the import will fail for courses without valid values. As such, please check your organization’s date format and any available drop-down values. An invalid data type or format will result in course import failure for that record.
-
If a course custom field provides a default value, this default value will be applied to any applicable column that contains an empty cell.
-
If a mandatory value is required for a course custom field, the course custom field value must be entered for each course or the associated courses won’t be processed. A missing value for a mandatory value will result in a course import failure for that record.
-
Querystring parameters:
“&sendmessage=[true/false]” set true if you want to receive notifications of the courses imported
“&format=json” sets json format
Request URI
POST /bulkimports/courses?&source={source}&sendmessage=(true/false}
Request Body (XML)
<CourseImports>
<CourseImport>
<CourseTitle>string [max length 255]</CourseTitle>
<Description>string [max length 2500]</Description>
<CourseCode>01234-A</CourseCode>
<Active>true</Active>
<ContentLibrary>false</ContentLibrary>
<Notifications>[Username]</Notifications>
<ModuleOrder>true</ModuleOrder>
<CourseInactivationDate>YYYY-MM-DD</CourseInactivationDate>
<CourseAccessExpirationDate>YYYY-MM-DD</CourseAccessExpirationDate>
<CourseAccessExpirationDateSpan>integer [max length 3 digits]</CourseAccessExpirationDateSpan>
<DueDate>YYYY-MM-DD</DueDate>
<DueDateSpan>integer [max length 3 digits]</DueDateSpan>
<ComplianceDateSpan>integer [max length 3 digits]</ComplianceDateSpan>
<ComplianceRetake>false</ComplianceRetake>
<Topic1>string [max length 200]</Topic1>
<Topic2>string [max length 200]</Topic2>
<Topic3>string [max length 200]</Topic3>
<Social>false</Social>
<DiscussionForum>false</DiscussionForum>
<CoursePrerequisite1>12345-A</CoursePrerequisite1>
<CoursePrerequisite2>23456-A</CoursePrerequisite2>
<CoursePrerequisite3>34567-A</CoursePrerequisite3>
<LearningPathPrerequisite1>12345-LP</LearningPathPrerequisite1>
<LearningPathPrerequisite2>23456-LP</LearningPathPrerequisite2>
<LearningPathPrerequisite3>34567-LP</LearningPathPrerequisite3>
<Language>en-US</Language>
<Tags>string [max length 30]</Tags>
<AdvCourseCustomField1></AdvCourseCustomField1>
<AdvCourseCustomField2></AdvCourseCustomField2>
<AdvCourseCustomField3></AdvCourseCustomField3>
<AdvCourseCustomField4></AdvCourseCustomField4>
<AdvCourseCustomField5></AdvCourseCustomField5>
<AdvCourseCustomField6></AdvCourseCustomField6>
<AdvCourseCustomField7></AdvCourseCustomField7>
<AdvCourseCustomField8></AdvCourseCustomField8>
<AdvCourseCustomField9></AdvCourseCustomField9>
<AdvCourseCustomField10></AdvCourseCustomField10>
<ReferenceCode>string [max length 50]</ReferenceCode>
</CourseImport>
</CourseImports>
Response Body (XML)
<CourseBulkImport xmlns:i=”http://www.w3.org/2001/XMLSchema-instance”>
<ImportId>AAa5LDhYz4s1</ImportId>
<ImportDate>2020-10-15T14:30:40</ImportDate>
<Status>Completed</Status>
<TotalRecords>1</TotalRecords>
<TotalCoursesCreated>1</TotalCoursesCreated>
<Failed>0</Failed>
</CourseBulkImport>
Request URI (JSON)
POST /bulkimports/courses?&source={source}&format=json
Request Body (JSON)
<CourseImports>
<CourseImport>
<CourseTitle>string [max length 255]</CourseTitle>
<Description>string [max length 2500]</Description>
<CourseCode>01234-A</CourseCode>
<Active>true</Active>
<ContentLibrary>false</ContentLibrary>
<Notifications>[Username]</Notifications>
<ModuleOrder>true</ModuleOrder>
<CourseInactivationDate>YYYY-MM-DD</CourseInactivationDate>
<CourseAccessExpirationDate>YYYY-MM-DD</CourseAccessExpirationDate>
<CourseAccessExpirationDateSpan>integer [max length 3 digits]</CourseAccessExpirationDateSpan>
<DueDate>YYYY-MM-DD</DueDate>
<DueDateSpan>integer [max length 3 digits]</DueDateSpan>
<ComplianceDateSpan>integer [max length 3 digits]</ComplianceDateSpan>
<ComplianceRetake>false</ComplianceRetake>
<Topic1>string [max length 200]</Topic1>
<Topic2>string [max length 200]</Topic2>
<Topic3>string [max length 200]</Topic3>
<Social>false</Social>
<DiscussionForum>false</DiscussionForum>
<CoursePrerequisite1>12345-A</CoursePrerequisite1>
<CoursePrerequisite2>23456-A</CoursePrerequisite2>
<CoursePrerequisite3>34567-A</CoursePrerequisite3>
<LearningPathPrerequisite1>12345-LP</LearningPathPrerequisite1>
<LearningPathPrerequisite2>23456-LP</LearningPathPrerequisite2>
<LearningPathPrerequisite3>34567-LP</LearningPathPrerequisite3>
<Language>en-US</Language>
<Tags>string [max length 30]</Tags>
<AdvCourseCustomField1></AdvCourseCustomField1>
<AdvCourseCustomField2></AdvCourseCustomField2>
<AdvCourseCustomField3></AdvCourseCustomField3>
<AdvCourseCustomField4></AdvCourseCustomField4>
<AdvCourseCustomField5></AdvCourseCustomField5>
<AdvCourseCustomField6></AdvCourseCustomField6>
<AdvCourseCustomField7></AdvCourseCustomField7>
<AdvCourseCustomField8></AdvCourseCustomField8>
<AdvCourseCustomField9></AdvCourseCustomField9>
<AdvCourseCustomField10></AdvCourseCustomField10>
<ReferenceCode>string [max length 50]</ReferenceCode>
</CourseImport>
</CourseImports>
Response Body (JSON)
<CourseBulkImport xmlns:i=”http://www.w3.org/2001/XMLSchema-instance”>
<ImportId>AAa5LDhYz4s1</ImportId>
<ImportDate>2020-10-15T14:30:40</ImportDate>
<Status>Completed</Status>
<TotalRecords>1</TotalRecords>
<TotalCoursesCreated>1</TotalCoursesCreated>
<Failed>0</Failed>
</CourseBulkImport>