Update CanSelfRegister course offering
Hi all,
I'm trying to update an existing course offering via the Brightspace API, and I suspect the issue is related to the CanSelfRegister
field.
I'm sending the following JSON body in a PUT request to:
PUT /d2l/api/lp/1.51/courses/6671
Here is the body:
{
"Name": "Ruud Koopmans Sandbox",
"Code": "SB_r.p.m.koopmans",
"StartDate": null,
"EndDate": null,
"IsActive": true,
"Description": {
"Text": "",
"Html": ""
},
"CanSelfRegister": false
}
Is CanSelfRegister
supported for PUT requests on the /courses/{orgUnitId}
endpoint? Or is it only supported during course creation?
Any help or clarification would be appreciated.
Thanks a lot in advance!
Ruud
Comments
-
Hi Ruud,
I have an API tool that uses a PUT call to this endpoint: /d2l/api/lp/1.46/courses/OU# and it is working okay with the CanSelfRegister field. Two possible problems with your call 1. your version is 1.51 but the highest supported in the API reference is 1.46. Also, you'll need to adjust the structure of your JSON. I have this:
{
"Name":"Course Name",
"Code":"Course Code",
"StartDate":null,
"EndDate":null,
"IsActive":true,
"CanSelfRegister":true,
"Description":{
"Content":"",
"Type":"Text"
}
}
Seems to work just find for me. Hope this helps!Josh.
-
Hi Josh,
Thanks, this really helped!
The issue was indeed with the JSON structure. After correcting that, the request worked as expected.
Ruud -
@Joshua.G.520
I'm fairly new to working with APIs, but I'm wondering: are you familiar with updating theCanSelfRegister
field using a.csv
file in combination with the Postman Collection Runner? -
@Ruud.K.955 not at all unfortunately. All of my API work is in web apps using HTML and Javascript. I am not sure exactly what you are wanting to do but I do have an API tool that is purpose-built to update classes in bulk via .csv upload, including the CanSelfRegister field. You can find it here: and look for the Bulk Course Update folder. Maybe someone else has some Postman knowledge they can share :)
-
@Joshua.G.520 Iād like to perform a bulk update of the Discover field to avoid colleagues having to do this manually for 100 courses.
-
@Ruud.K.955 Okay that tool I mentioned is purpose-built for that exact scenario. Should work out for you if you try it :)
-
@Joshua.G.520
I have it now working with Postman Runner.
Thanks for your advice!