API to Retrieve and Update User's AOU/Department Level Role in Brightspace?

Kabir.H.527
Kabir.H.527 Posts: 12 Analytics Builder Transition

Is there an API in Brightspace that allows me to retrieve a user's role at the AOU (Authorised Operating Unit) or department level? Additionally, is there an API that allows updating a user's role at the AOU/department level? If so, could you please provide the endpoint details and any relevant documentation?

Best regards,

Kabir

Tagged:

Answers

  • Matt.W.287
    Matt.W.287 Posts: 67
    edited July 7

    Hi Kabir

    To retrieve the enrollment details for a given user at a given OU, use this:
    https://docs.valence.desire2learn.com/res/enroll.html#actions:~:text=LP%20API%20v1.26.-,GET%20/d2l/api/lp/(version)/enrollments/orgUnits/(orgUnitId)/users/(userId),-%C2%B6

    Enrollment Data looks like this:

    image.png

    To perform an enrollment, use this:
    https://docs.valence.desire2learn.com/res/enroll.html#actions:~:text=the%20user.-,POST%20/d2l/api/lp/(version)/enrollments/,-%C2%B6

    You will need to provide this JSON data block:

    image.png

    I hope that's helpful
    Matt
    Learning Administration Manager

  • Matt.W.287
    Matt.W.287 Posts: 67

    You can use the Users Brightspace Data Set (BDS) to look up UserId values, Organizational Units BDS to look up OU#s and the Role Details BDS to look up RoleId values (from the Data Hub tool).

    Matt