setting multiple courses to active using PUT /d2l/api/lp/(version)/courses/(orgUnitId)¶

35 views
Skip to first unread message

UCB VALENCE

unread,
Jul 11, 2014, 12:52:14 PM7/11/14
to valenc...@googlegroups.com
1) How do I set multiple courses to active using
PUT /d2l/api/lp/(version)/courses/(orgUnitId)


Here is the request :   /d2l/api/lp/1.1/courses/59865

Here is my current json block for a single course:

{
    "Name": 'This is a test Kevin',
    "Code": '59865',
    "StartDate": null,
    "EndDate": null,
    "IsActive": true
}

2) What is the format of the input file to activate multiple courses?

3) How do I activate the course but leave the course title and start/end dates as is with no change?

 

Desire2Learn Staff: Viktor

unread,
Jul 15, 2014, 10:15:08 AM7/15/14
to valenc...@googlegroups.com
Hello, here are some answers for your questions:

1) You cannot update properties for more than one course offering at once -- you will need to call the API route for updating a single course offering separately for each course offering you want to update.

2) See (1) -- you cannot update multiple courses at once, so you must provide the Course.CourseOfferingInfo structure for each course offering to update, as you make the call to update that course.

3) In nearly all Valence Learning Framework API areas, the PUT update routes will do complete updates from the JSON data you provide: we do not support PATCH calls yet, and partially updating entities would use PATCH not PUT. What this means is that when you use an update route, all the property values you pass will overwrite the existing properties in the back-end service.

If you want to "leave the course title and start/end dates as-is with no change", then to be as sure as possible, you should first fetch the properties for that course with the GET route, and use the values retrieved there to help you populate the CourseOfferingInfo structure you'll use for an update. (Providing null for the start/end dates, in particular, is a bad idea if you're working with a back-end service that has start and end dates for courses -- in particular, you'll want to preserve the values for these that you can get from the GET call.)
 

kkm...@colorado.edu

unread,
Jul 15, 2014, 5:34:31 PM7/15/14
to valenc...@googlegroups.com
thank you Viktor. I am at fusion this week and everything you told me matches up with what we went through in the extensibility lab. Kevin

Desire2Learn Staff: Viktor

unread,
Jul 15, 2014, 7:10:27 PM7/15/14
to valenc...@googlegroups.com
Glad to help. Have a great time at Fusion!
Reply all
Reply to author
Forward
0 new messages