The endpoints of this API allows you to manipulate CurriculumActivity records.

Those records describe the content of a Page, Path, or Collection activity (i.e. CoursePage, CourseCurriculum or CourseCollection record).

They are two kind of records, one can distinguish them with the course_id attribute:

  1. section: its course_id attribute is empty
  2. activity: its course_id attribute is present, it contains the id of a Course record

A Path activity must have at least one non optional section. A section can contain only activities, it can not contain other sections. A section can be empty.

Sections are ordered within a path, and activities within a section are ordered too.

Various settings on sections and activities influence how students can progress in a path and complete it, see below.



Description of the CurriculumActivity attributes

  • id (integer): internal id of the record
  • name (string): the name of the section or activity displayed to the student (defaults to the activity name unless it is a section)
  • parent_id(integer):
    • for a section: empty
    • for an activity: the CurriculumActivity record id of the section to which the activity belongs
  • lft and rgt(integers):
    • for a section: indicates its position within the path
    • for an activity: indicates its position within the section
  • curriculum_id (integer): the CourseCurriculum record id to which is attached the record
  • course_id (integer)
    • for a section: empty
    • for an activity: the id of the Course record
  • account_id (integer): the id of account to which is attached the record
  • updated_by (integer): the id of the User record of the last admin which created or updated this record through the UI
  • updated_on (datetime): last time the record was updated
  • due_days (integer): unused
  • weight (integer):
    • used only for SCORM, AICC and Assessment activities
    • corresponds to the “Count this activity towards the score of the Path” option in the admin UI
    • null value is “No”, 1 value is “Yes”
  • exempt_if_mastered (boolean):
    • used only for SCORM, AICC and Assessment activities
    • corresponds to the “Exempt a student from the rest of the path if this activity is passed” option in the admin UI
    • false and nil values are “No”, true is “Yes”
  • description (text):
    • for sections: optional textual description of the section, displayed to the students in their enrollment pages
    • for activities: unused
  • lock_until (date):
    • for sections: when set, students can enroll in the activities of this section only after the date specified
    • for activities: unused
  • code (string): internal code
  • initial_view (string):
    • for sections: indicates whether the section is displayed as collapsed (value collapsed) or not-collapsed (value full, set by default)
    • for activities: unused
  • required_for_specified_control_mode (boolean):
    • for sections: unused
    • for activities:
      • used only when the parent section control_mode value is specified
      • corresponds to the “Required activity” option in the admin UI
      • false value is “No” (set by default), true value is “Yes”
  • skip_interstitial_page (boolean):
    • for sections: unused
    • for activities:
      • used only for URL activities, File activities, SCORM activities, AICC activities, Assessment activities
      • corresponds to the “Launch directly into content” option in the admin UI
  • sequence_attributes["control_mode"] (string):
    • for sections: indicates how the section can be completed. Possible values:
      • flow: “complete in order”
      • choice: “complete in any order” option (default value)
      • optional: “optional” option
    • for activities: unused
  • sequence_attributes["completions_min"] (integer):
    • for sections: used only when sequence_attributes["control_mode"] value is choice. When set indicates the number of activities to complete within the section ("x of y" in the admin UI).
    • for activities: unused
  • sequence_attributes["attempts_max"] (integer):
    • for sections: unused
    • for activities: used only by SCORM, AICC and assessment activities. Corresponds to the "Max Attempts" option in the UI. 0 is "none" (default value), 1 is "1", 2 is "2", etc.




List

Resource: /api/v2/curriculum_activities

HTTPS Request Method: GET

Description: The list of CurriculumActivities records of the account. This endpoint is paginated and returns 50 results per page (see optional parameters below) except when filtering on curriculum_activity[curriculum_id] to fetch only the records of a unique CourseCurriculum record , in this case there is no pagination.

Required parameters:

  • api_key (string): the account API key

Optional parameters:

  • page (integer): the page you want to request. Every page is 50 records long at most. If not present, page 1 is assumed.
  • you can filter the results on the following CurriculumActivity attributes: id name parent_id lft rgt curriculum_id course_id updated_by updated_on lock_until initial_view. For example:
    • curriculum_activity[curriculum_id] (integer): return only the records mapped to the CourseCurriculum record whose id value is passed in this parameter. When it is used, the API does not paginate the results.
    • curriculum_activity[updated_on] (datetime): Dates and datetimes should be in YYYY-MM-DD or YYYY-MM-DD HH:MM:SS format and can be given as ranges if separated by a comma.
  • you can also filter the results on attributes of the CourseCurriculum record itself. They are the attributes listed in the Activities API List endpoint optional parameters. For example:
    • course[in_catalog] (integer): when value is true, return only the CurriculumActivity records mapped to CourseCurriculum records which are displayed in the catalog.

Response:

  • on success: a 200 HTTP code and an array of the found records in the body
  • on failure: a 422 HTTP code and an array of the errors in the body

Example requests:

  • Get 50 first CurriculumActivities records of the account: curl -H "Content-type: application/json" -H "Accept: application/json" https://your-domain.exceedlms.com/api/v2/curriculum_activities?api_key=your-domain-api-key-value
  • Get 50 first CurriculumActivities records mapped to CourseCurriculum with id 11: curl -H "Content-type: application/json" -H "Accept: application/json" https://your-domain.exceedlms.com/api/v2/curriculum_activities?api_key=your-domain-api-key-value&curriculum_activity\[curriculum_id\]=11"
  • Get CurriculumActivities records updated between two dates: curl -H "Content-Type: application/json" -H "Accept: application/json" "https://your-domain.exceedlms.com/api/v2/curriculum_activities?api_key=your-domain-api-key-value&curriculum_activity%5Bupdated_on%5D=2017-01-12,%202017-01-13"




Create

Resource: /api/v2/curriculum_activities

HTTPS Request Method: POST

Description: create a new CurriculumActivity record.

Required parameters:

  • api_key (string): the account API key
  • curriculum_id (integer): the id of the CourseCurriculum record to which will be attached the new CurriculumActivity record
  • to create an activity mapped to Course record (i.e. not sections):
    • parent_id: the id of the CurriculumActivity record section into which will be inserted the created record
    • course_id: the id of a Course record (can not be a path or a survey)

Optional parameters:

  • see the section "Description of the CurriculumActivity attributes", except the following attributes which can't be set through the API: account_id, updated_by, updated_on, lft, rgt
  • the "sequence" attributes (control_mode, completions_min, attempts_max) must be nested in a sequence_attributes hash (see example below)

Note: The following parameters are limited to 255 characters:

  • name

Response:

  • on success: a 200 HTTP code and the created record in the body
  • on failure: a 422 HTTP code and an array of the errors in the body

Example requests:

  • Add an optional section named "My Section" to a path having id 55: curl -H "Content-type: application/json" -H "Accept: application/json" -X POST -d '{ "curriculum_activity": {"curriculum_id": "55", "name": "My Section", "sequence_attributes": { "control_mode": "optional" } } }' https://your-domain.exceedlms.com/api/v2/curriculum_activities?api_key=your-domain-api-key-value

  • Insert the existing Course record with id 10 within the section having the id 20 into the path having id 55: curl -H "Content-type: application/json" -H "Accept: application/json" -X POST -d '{ "curriculum_activity": {"curriculum_id": "55", "course_id": "10", "parent_id": 20 } }' https://your-domain.exceedlms.com/api/v2/curriculum_activities?api_key=your-domain-api-key-value




Update

Resource: /api/v2/curriculum_activities/ (id being the id attribute of the CurriculumActivity record to update)

HTTPS Request Method: PUT or PATCH (we handle PUT and PATCH requests in the same exact way)

Description: update the attributes of an existing CurriculumActivity record

Required parameters:

  • api_key (string): the account API key
  • id (integer): the id of the CurriculumActivity record to update

Optional parameters:

  • Same as the Create endpoint optional parameters, with those additional restrictions:
    • a section can't be changed into an activity
    • an activity can't be changed into a section
    • curriculum_id can not be changed
    • course_id can not be changed
    • parent_id can not be changed (see the Update Position endpoint below to move an existing activity into another section)

For instance if there is a CurriculumActivity record pointing to a Link Activity A that one needs to replace to point to another Link Activity B, one needs to follow the same steps than in the LMS admin UI:

  1. insert the Link Activity B in the same section (using the Create endpoint)
  2. move it below or above the record pointing to the Link Activity A (using the Update Position endpoint)
  3. destroy the record pointing to the Link Activity A (using the Destroy endpoint)

Response:

  • on success: a 200 HTTP code and the updated record in the body
  • on failure: a 422 HTTP code and an array of the errors in the body

Example request:

  • update the name of section having id 20: curl -H "Content-type: application/json" -H "Accept: application/json" -X PUT -d '{ "curriculum_activity": { "name": "My New Name" } }' https://your-domain.exceedlms.com/api/v2/curriculum_activities/20?api_key=your-domain-api-key-value




Update Position

Resource: /api/v2/curriculum_activities//update_position (id being the id attribute of the CurriculumActivity record to move)

HTTPS Request Method: PUT or PATCH (we handle PUT and PATCH requests in the same exact way)

Description: change the position of an existing CurriculumActivity record within the path.

Required parameters:

  • api_key (string): the account API key
  • id (integer): the id of the CurriculumActivity record to move
  • target_id (integer): the id of another existing CurriculumActivity record near which the record to move will be moved
    • when the record to move is a section, target_id must points to another section
    • when the record to move is an activity, target_id must points to another activity, except when using the orientation "inside" value
  • orientation (string):
    • if value is "above" the record will be moved above the target
    • if value is "below" the record will be moved below the target
    • if value is "inside" the record will be moved into the target (target must be an empty section)

Optional parameters: none.

Response:

  • on success: a 200 HTTP code and an empty body
  • on failure: a 422 HTTP code and an array of the errors in the body

Example requests:

  • moving the section with id 30 after the section with id 40: curl -H "Content-type: application/json" -H "Accept: application/json" -X PUT -d '{ "target_id": "40", orientation: "below" }' https://your-domain.exceedlms.com/api/v2/curriculum_activities/30/update_position?api_key=your-domain-api-key-value

  • moving the path activity with id 20 before the path activity with id 10: curl -H "Content-type: application/json" -H "Accept: application/json" -X PUT -d '{ "target_id": "10", orientation: "above" }' https://your-domain.exceedlms.com/api/v2/curriculum_activities/20/update_position?api_key=your-domain-api-key-value




Destroy

Resource: /api/v2/curriculum_activities/ (id being the id attribute of the CurriculumActivity record to destroy)

HTTPS Request Method: DELETE way)

Description: destroy an existing CurriculumActivity record. Destroying a section will also destroy all the CurriculumActivity records nested within.

Required parameters:

  • api_key (string): the account API key
  • id (integer): the id of the CurriculumActivity record to destroy

**Optional parameters: **none.

Response:

  • on success: a 200 HTTP code and an empty body
  • on failure: a 422 HTTP code and an array of the errors in the body

Example requests:

  • destroy the record with id 30: curl -H "Content-type: application/json" -H "Accept: application/json" -X DELETE https://your-domain.exceedlms.com/api/v2/curriculum_activities/20?api_key=your-domain-api-key-value