Test Users and Roles

Riaan.O.139
Riaan.O.139 Posts: 3 🔍
edited January 17 in Development

Good evening, I have 2 questions:

  1. The API Test Tool site ( https://apitesttool.desire2learnvalence.com/ ) states that you can use the DevCoPStudent account to test API calls to the test D2L site (devcop.brightspace.com). I am doing this successfully. Are there any other test accounts I can use to call the API, particularly a user that is a lecturer, not a student; and
  2. My application requires that I be able to identify whether the authenticated user is a Student or Lecturer. How do I do this with the API? How do I identify the role of an authenticated user? Most of the API calls on the DevCoPStudent account returns Forbidden, which complicates my investigation further. I have read through the API docs around 354 times, but cannot find a possible solution.

Thank you, Riaan.

Tagged:

Answers

  • Steve.B.446
    Steve.B.446 Posts: 79

    I think this has been lost in the move to the new Community, the used to be in a box on the sidebar of the old Developer group on the old Community. I can't see them on the new equivalent group, but somebody there is asking the same question.

  • Riaan.O.139
    Riaan.O.139 Posts: 3 🔍

    Thanks, although it unfortunately does not answer the questions. Any solutions would be appreciated.

  • Luke.M.9485
    Luke.M.9485 Posts: 2 🔍

    Did yall ever figure out a way to get if a user is a Lecturer or Student?

  • Hi Riaan & Luke

    Thank you for reaching out to us through the community!

    Here are the answers to your queries raised.

    Question 1 :

    The API Test Tool site ( https://apitesttool.desire2learnvalence.com/  ) states that you can use the DevCoPStudent account to test API calls to the test D2L site (devcop.brightspace.com). I am doing this successfully. Are there any other test accounts I can use to call the API, particularly a user that is a lecturer, not a student

    Answer:

    We are in the process of phasing out the Developer Community of Practice test instance. The environment is cluttered with a lot of historic testing data from partners and developers, and not a reliable space that we want to encourage testing and development against.

    As a replacement, we encourage customers to use their test/dev/qa Brightspace environments to perform development testing and exploration against. For partners, I'd encourage you to engage with our wonderful Partners team and they can help provide support and other resources related to building integrations with Brightspace ( https://www.d2l.com/partners/enroll/

     The same query as yours was answered in

    https://community.d2l.com/brightspace/discussion/4409/where-are-the-developer-instance-credentials-pdf-for-d2l-brightspace#latest

    Question2

    My application requires that I be able to identify whether the authenticated user is a Student or Lecturer. How do I do this with the API? How do I identify the role of an authenticated user?

    Answer:

    We don't have a single API call with which you can determine the role of the authenticated user.

    Valence provides a “whoami” call that applications can use to determine the D2L ID for the user that’s currently logged in

    That user ID could then maybe get passed to the enrollment API to get the role of the user in the given orgunit , say Org level or course level

    Steps are as follows

    https://docs.valence.desire2learn.com/res/enroll.html#get--d2l-api-lp-(version)-enrollments-orgUnits-(orgUnitId)-users-(userId)

    Thanks

    Sreelakshmi

  • Luke.M.9485
    Luke.M.9485 Posts: 2 🔍

    Ok that's what I figured, Thanks Sreelakshmi!