Valence v2.2

Courses (course offerings, templates, schemas)

«  Calendar (Events and scheduling)   ·  [   home  ·   reference   ·  index   ·  routing table   ·  modules   ]   ·  Dropboxes (Folders, categories, submissions, feedback)  »

Contents

With the courses resource you can retrieve information about existing courses, modify or remove them, and create new courses.

Attributes

Note that frequently the course-related JSON data blocks include a Path property – these contain a path to the course content published in the service’s content store.

Course.BasicOrgUnit

This composite contains basic information about an organizationl unit to which a course offering is related.

{
    "Identifier": "<string:D2LID>",
    "Name": "<string>",
    "Code": "<string>"
}
Course.CourseOffering

The service’s fundamental information block for course offerings. Notice that the last few fields for this block include BasicOrgUnit blocks for the related org units.

{
    "Identifier": "<string:D2LID>",
    "Name": "<string>",
    "Code": "<string>",
    "IsActive": "<boolean>",
    "Path": "<string>",
    "StartDate": "<string:UTCDateTime>|null",
    "EndDate": "<string:UTCDateTime>|null",
    "CourseTemplate": "{composite:Course.BasicOrgUnit}|null",
    "Semester": "{composite:Course.BasicOrgUnit}|null",
    "Department": "{composite:Course.BasicOrgUnit}|null"
}
Course.CourseOfferingInfo

When you use actions that update course information for a course offering, you should provide one of these blocks:

{
    "Name": "<string>",
    "Code": "<string>",
    "StartDate": "<string:UTCDateTime>|null",
    "EndDate": "<string:UTCDateTime>|null",
    "IsActive": "<boolean>"
}
Course.CreateCourseOffering

Block used to create a course.

{
    "Name": "<string>",
    "Code": "<string>",
    "Path": "<string>",
    "CourseTemplateId": "<number:D2LID>",
    "SemesterId": "<number:D2LID>|null",
    "StartDate": "<string:UTCDateTime>|null",
    "EndDate": "<string:UTCDateTime>|null",
    "LocaleId": "<number:D2LID>|null",
    "ForceLocale": "<boolean>",
    "ShowAddressBook": "<boolean>"
}
ForceLocale
Determines if the course should override the user’s saved locale preference.
Path
The root path to use for this course offering’s course content. Note that, if your back-end service has path enforcement set on for new org units, then you should leave this property as an empty string, and the back-end service can populate it for you.
SemesterId
Note that if CreateCourse form does not include the Semester element, then you should provide null for this property when creating a course.
ShowAddressBook
Determines if the email tool’s address book groups together the users enrolled in the course together.
Course.CourseTemplate
{
    "Identifier": "<string:D2LID>",
    "Code": "<string>",
    "Name": "<string>",
    "Path": "<string>"
}
Course.CourseTemplateInfo
{
    "Name": "<string>",
    "Code": "<string>"
}
Course.CreateCourseTemplate
{
    "Name": "<string>",
    "Code": "<string>",
    "Path": "<string>",
    "ParentOrgUnitIds": "[array:number:D2LID]"
}
Path
The root path to use for this course template’s course content. Note that, if your back-end service has path enforcement set on for new org units, then you should leave this property as an empty string, and the back-end service can populate it for you.
Course.SchemaElement

This block describes constraints for parent org units of course offerings (that is, whether particular org units are not permitted as parents for course offerings, or are required as parents for course offerings).

{
    "Type": "{composite:OrgUnit.OrgUnitTypeInfo}",
    "IsNotAllowed": "<boolean>",
    "IsRequired": "<boolean>"
}
Type
OrgUnit.OrgUnitTypeInfo composite block to describe the org unit type for a course schema.
IsNotAllowed
If true, the org unit type cannot be a parent to the org unit.
IsRequired
If true, the org unit type is required as a parent to the org unit. This value takes precedence over the IsNotAllowed property’s value.

Actions

DELETE /d2l/api/lp/(D2LVERSION: version)/courses/(D2LID: orgUnitId)

Delete a course offering.

Parameters:
Status Codes:
  • 200 – Action succeeded.
  • 403 – No permission to manage or delete courses.
  • 404 – Org unit not found or not a course offering.
API Versions:
  • 1.0+ – Route first appears in LMS v9.4.1.
GET /d2l/api/lp/(D2LVERSION: version)/courses/schema

Retrieve the list of parent org unit type constraints for course offerings.

Parameters:
Status Codes:
  • 200 – Action succeeded.
API Versions:
  • 1.0+ – Route first appears in LMS v9.4.1.

Return. This action returns a JSON array of SchemaElement blocks.

GET /d2l/api/lp/(D2LVERSION: version)/courses/(D2LID: orgUnitId)

Retrieve a course offering.

Parameters:
Status Codes:
  • 200 – Action succeeded.
  • 403 – No permission to see course offerings.
  • 404 – Org unit not found or not a course offering.
API Versions:
  • 1.0+ – Route first appears in LMS v9.4.1.

Return. This action returns a CourseOffering JSON block with the provided course’s information.

POST /d2l/api/lp/(D2LVERSION: version)/courses/

Create a new course offering.

Parameters:
Status Codes:
  • 200 – Action succeeded.
  • 400 – Invalid course data provided, or could not create new course.
  • 403 – No permission to manage or create courses.
  • 404 – Could not resolve org unit for created course to a known org unit.
API Versions:
  • 1.0+ – Route first appears in LMS v9.4.1.

Input. Provide a CreateCourseOffering JSON block describing the new courses information.

Return. This action returns a CourseOffering JSON block for the newly created course.

PUT /d2l/api/lp/(D2LVERSION: version)/courses/(D2LID: orgUnitId)

Update a current course offering.

Parameters:
Status Codes:
  • 200 – Action succeeded.
  • 400 – Invalid course data provided.
  • 403 – No permission to update courses.
  • 404 – Org unit not found or not a course offering.
API Versions:
  • 1.0+ – Route first appears in LMS v9.4.1.

Input. Provide a CourseOfferingInfo JSON block describing the course’s updated information; note that your provided block’s data replaces the associated course offering’s data on the service.

Course Templates

Course templates provide a way to gather sets of default properties for more efficient course offering creation.

DELETE /d2l/api/lp/(D2LVERSION: version)/coursetemplates/(D2LID: orgUnitId)

Delete a course template.

Parameters:
Status Codes:
  • 200 – Action succeeded.
  • 403 – No permission to manage or delete courses.
  • 404 – No such org unit, or not a course template.
API Versions:
  • 1.0+ – Route first appears in LMS v9.4.1.
GET /d2l/api/lp/(D2LVERSION: version)/coursetemplates/(D2LID: orgUnitId)

Retrieve a course template.

Parameters:
Status Codes:
  • 200 – Action succeeded.
  • 403 – No permission to see course info.
  • 404 – No such org unit, or not a course template.
API Versions:
  • 1.0+ – Route first appears in LMS v9.4.1.

Return. This action returns a CourseTemplate JSON block.

GET /d2l/api/lp/(D2LVERSION: version)/coursetemplates/schema

Retrieve the list of parent org unit type constraints for course offerings built on this template.

Parameters:
Status Codes:
  • 200 – Action succeeded.
API Versions:
  • 1.0+ – Route first appears in LMS v9.4.1.

Return. This action returns a JSON array of SchemaElement blocks.

POST /d2l/api/lp/(D2LVERSION: version)/coursetemplates/

Create a new course template.

Parameters:
Status Codes:
  • 200 – Action succeeded.
  • 400 – Invalid course template data provided, or could not create new course template.
  • 403 – No permission to manage or create courses and templates.
  • 404 – Could not resolve org unit for created course template to a known org unit.
API Versions:
  • 1.0+ – Route first appears in LMS v9.4.1.

Input. Provide post data containing a CreateCourseTemplate JSON block.

Return. This action retrieves a Course.CourseTemplate JSON block for the newly created course template.

PUT /d2l/api/lp/(D2LVERSION: version)/coursetemplates/(D2LID: orgUnitId)

Update the information for a course template.

Parameters:
Status Codes:
  • 200 – Action succeeded.
  • 400 – Invalid course template data provided.
  • 403 – No permission to manage courses.
  • 404 – No such org unit, or not a course template.
API Versions:
  • 1.0+ – Route first appears in LMS v9.4.1.

Input. Provide a Course.CourseTemplateInfo JSON block; notice that this action replaces the course template data with all the properties you provide.


comments powered by Disqus

«  Calendar (Events and scheduling)   ·  [   home  ·   reference   ·  index   ·  routing table   ·  modules   ]   ·  Dropboxes (Folders, categories, submissions, feedback)  »