What is the path to get org unit paths?

Options

This API route - PUT /d2l/api/lp/(version)/orgstructure/(orgUnitId) - requires Path as part of the OrgUnit.OrgUnitProperties

{
    "Identifier": <string:D2LID>,
    "Name": <string>,
    "Code": <string>|null,
    "Path": <string>,
    "Type": { <composite:OrgUnit.OrgUnitTypeInfo> }
}

However, the similar GET call does not return Path.

The Organizational Units data set does not include path.

The API route - GET /d2l/api/lp/(version)/orgstructure/ - does include path. However, it is paged result set that only returns 10 records per page, at least when using the query string ?orgUnitType=2.

If there are thousands or tens of thousands of an org unit type where the path is needed, what is the best way to get paths, in addition to name, code, orgunitid, and type?


Thanks

Answers

  • Viktor.H.147
    Options

    This is indeed a challenge with the Learning Framework API, and it seems like a good candidate for an enhancement request around the orgstructure API that retrieves the data for a single org unit by ID. However, you can use other filters on the orgstructure collection route which might assist in this case: you can use exactOrgUnitCode or exactOrgUnitName to narrow the search down to the precise org unit in question if you already have its code or name -- you can also use the more general orgUnitCode and orgUnitName to search for a list of org units with sub-string you provide in their Code or Name. These might be more useful to you than orgUnitType as a filter in this case.

  • Michael.C.540
    Options

    Would this GET request serve?

    GET /d2l/api/lp/(version)/courses/(orgUnitId)

    https://

    docs.valence.desire2learn.com/res/course.html#get--d2l-api-lp-(version)-courses-(orgUnitId)

    It does return PATH:

    Course.CourseOffering

    The service’s fundamental information block for course offerings. Notice that the some fields in this block include BasicOrgUnit blocks for the related org units.

    {
        "Identifier": <string:D2LID>,
        "Name": <string>,
        "Code": <string>,
        "IsActive": <boolean>,
        "Path": <string>,
        "StartDate": <string:UTCDateTime>|null,
        "EndDate": <string:UTCDateTime>|null,
        "CourseTemplate": { <composite:Course.BasicOrgUnit> }|null,
        "Semester": { <composite:Course.BasicOrgUnit> }|null,
        "Department": { <composite:Course.BasicOrgUnit> }|null,
        "Description": { <composite:RichText> },
        "CanSelfRegister": <boolean>
    }
    

    -mike

  • Charles.K.718
    Options

    Thanks for the replies!

    Course Templates are the specific org unit type in this case, with the aim of updating both name and code for many, many, instances.

    Looks like getting the list of orgunitids for CTs and then getting the data one by one.