Search code examples
desire2learnvalence

Valence: get course by Offering Code


Given just the offering code (something like ZZ_ZZ666-CLASS_ZZ1_16M5W1), how can I get the id of a course? For my purposes, there is no user ID to work from, as I don't have access to the roster.

Also, this is being done via a service account, so myenrollments won't help.

This question from a few years back is relevant, but not helpful, as the suggested solution requires a user id.

Any help, D2L folks?


Solution

  • Upon submitting my question, my google-fu instantly leveled up and I found an answer here

    I'm going to leave this answer here, because I don't think it's been answered on SO yet...

    The call:

    /d2l/api/lp/1.4/orgstructure/?orgUnitCode=ZZ_ZZ666-CLASS_ZZ1_15M5W1

    Which is...blindingly simple, really. You can also search by course name.

    Documentation here