I'm attempting to get all OrgUnits using Valence that are the "Department" type. When I do the call to /d2l/api/lp/1.4/orgstructure/?orgunittype=Department
, I get a paged result set containing all the OrgUnits
The docs are a little unclear. They specify that
You can use the orgUnitType, orgUnitCode, and orgUnitName query parameters as filters to further narrow the list of org units this action retrieves.
and also
orgUnitType (string) – Optional. Filter to org units of this type.
However, "string" is a bit ambiguous considering OrgUnitType is a composite type with both a code and a name as a string. Both my Code and my Name for this type is "Department yet it still gives me everything.
You should provide an org unit type identified by a valid orgUnitTypeId
(for course offerings, this will be 3
.
For custom org unit types, like "Department", the value will most likely vary LMS to LMS:
You can use the call to retrieve the list of all known org unit types to determine the type corresponding to "Department" for your LMS.
Or, because "Department" is one of the very common custom org unity types, you can use the specific get department-org-unit-type call to find out what the ID is for that type on your LMS (there's also a specific call like this to get the type ID for "semester" org units).