Which endpoint to use to enable sections

Arald.d.320 Posts: 14 🌱


We use the API to enable sections. We use this endpoint to initialize the sections:

This works in version 1.36 but not in higher versions like 1.44. This most likely has to do with it being Deprecated but the information about the API versions for this route is very confusing. We have LMS version When I read the information I get that this route was introduced in version 1.35 but was deprecated in earlier versions? The given information also does not make clear why it works in version 1.36 but does not work in 1.44.

There is a second endpoint you can use to enable sections. It's:

Is this a replacement for the other one above? Is this the one we should use? It works but ther the other one it always creates at least one section while I am looking for a way to enable sections in one step and then create the secions we need using:
POST /d2l/api/lp/(version)/(orgUnitId)/sections/

That is more efficiënt and gives cleaner code than when you have to retrieve the sections created and update them to give them the names you want to use.

Is there a way to enable sections without immediately creating a section?

When I use Brightspace and check "This course has sections" sections are enabled without any sections being created and this is exactly what I want to achieve through the API as well.

There is alsso something very strange about the section API's. When I enable sections in BrightSpace I get this back through the API:

This is perfect and exactly what we need. When I want to enable sections through the API I only have 2 choices for EnrollmentStyle:

"NumberOfSectionsNoEnrollment" is no option and so I have to use the secondone and set AutoEnroll to "false". When do that and retrieve the settings I get:

and this is very confusing because the enrollmentStyle says AutoEnrollment while AutoEnroll is false.
Is there a way to use the API to enable sections in exactly the same way als when you switch them on in Brightspace, so with the EnrollmentStyle "NumberOfSectionsNoEnrollment" and without any section being created so we can create then ourself (instead of having to rename the default created section)?


  • Matt.W.287

    I believe what's needed here is a new property added to the Course Offering API call as this property is one of offerings and not the sections themselves. Unfortunately there's no such setting… but it could be added.

    I would recommend submitting a PIE item under "APIs & Extensibility" to have "CourseHasSections" added to the Course.CourseOffering data block. The default can be False (so that NULL leaves it as default/unchanged) and it otherwise leaves the Sections Settings alone. You can follow up with setting Section Properties using the existing sections APIs.

    I hope that's helpful.
    Learning Administration Manager