Is there an API call to retrieve list of all courses with orgUnitId's?

Robert.R.757
Robert.R.757 Posts: 7 🌱
edited November 2022 in Development

 I am looking for a specific non-course and I need a way to dynamically retrieve the orgUnitIds.

Tagged:

Answers

  • Naren.Kalyanasundaram8289
    edited November 2022

    Hi @Bobby Ross​  I dont think we have one. We will have to use the data sets in Data Hub.

  • Robert.R.757
    Robert.R.757 Posts: 7 🌱
    edited November 2022

    Thank you for the response Naren. I'll look into that.

  • Sergio.Sepúlveda3681
    Sergio.Sepúlveda3681 Posts: 8 🌱
    edited November 2022

    May be this: http://docs.valence.desire2learn.com/res/orgunit.html#get--d2l-api-lp-(version)-orgstructure-, you can filter by typeID = 3 (I think this is for Course Offering).

    Notice the result is paged and you'll need "Can Create and Edit Org Units" permission in "Org Unit Editor" tool for your user-api rol.

  • Naren.Kalyanasundaram8289
    edited November 2022

    Hi @Sergio Sepúlveda​ : That is correct and a good find. The reason I did not mention that was because of the complexity around taking the information you want as it gives the properties of all the org units. Compared to this, Data Hub is a lot easier. Again, a good find.😊

  • Andy.F.437
    Andy.F.437 Posts: 37 🌱
    edited November 2022

    @Phyllis Shen​ might have some advice as well.

  • Phyllis.S.916
    Phyllis.S.916 Posts: 3 🧭
    edited November 2022

    Call several APIs:

    1. Find your organization orgUnitId: /d2l/api/lp/1.9/organization/info
    2. Retrieve orgstructure: /d2l/api/lp/1.9/orgstructure/
    3. Retrieve outypes: /d2l/api/lp/1.9/outypes/
    4. Retrieve a list of all semesters: /api/lp/1.9/orgstructure/6606/descendants/?ouTypeId=5 (for example, root organization orgUnitId 6606, semester ouTypeId )
    5. List courses during a particular semester: /d2l/api/lp/1.9/orgstructure/41207/children/ (semester Winter 2017 Identifier: 41207)

     

    Additionally, list courses from Department, course template structure:

    1. List department: /api/lp/1.9/orgstructure/6606/descendants/?ouTypeId=101 (department ouTypeId 101)
    2. Retrieve the course templates within a department: /d2l/api/lp/1.9/orgstructure/6607/children/ (Administration department 6607)
    3. List the courses listed within a department, a course template: /d2l/api/lp/1.9/orgstructure/6607/descendants/?ouTypeId=3 (by specifying the ouTypeId for a course template)