Error 403 when creating a new user via API request

reynaldo.junior
reynaldo.junior Posts: 6 🌱
edited May 1 in Development

Hi,
I'm trying to create a new user using a Postman request, but I'm getting error 403 (Forbidden). I already tested the whoami request and was successful (status 200); my username has all the credentials to create a user, and I'm using the scope "core:: user::" when creating the token.

Is there something I am missing?

I really appreciate any help you can provide.

brigstspace1.png

postman1.png
Tagged:

Best Answers

  • Paul.P.783
    Paul.P.783 Posts: 13
    Answer βœ“

    Hello @reynaldo.junior,

    Generally speaking, a 403 error (not authorized) could point to any number of permissions. To identify the issue, you could either create a discussion with other developers in our Developers Group, found here, or submit a case to our Support team to get the details and take a look further. Or choose both, whatever works for you.

    Please keep us posted if you find a solution and completed your intended workflow.

    Hope this helps!

  • reynaldo.junior
    reynaldo.junior Posts: 6 🌱
    Answer βœ“

    Thanks @Paul.P.783

    I will do both.

Answers

  • Ian.P.710
    Ian.P.710 Posts: 31

    So looking at this the scope I think should be users:*:* not user:*:* Other than that is if you also need a OrgDefinedId some sites are setup to require one.

    However I would say change the scope and re authenticate as a first step.

  • reynaldo.junior
    reynaldo.junior Posts: 6 🌱

    Hi @Ian.P.710

    Thanks for your reply.

    You were right, the correct syntax should be "users:*:*", but unfortunately I'm getting the same error.

  • Heba.A.271
    Heba.A.271 Posts: 106

    Hi Reynaldo,

    Thank you for reaching Brightspace community.

    This error is related to your permission , meaning you don't have permission to create a new user over the system. Can you check your role permission for Users tool, 'Create a User in the Database' ?

    Hope this helps!

    Regards,

  • reynaldo.junior
    reynaldo.junior Posts: 6 🌱

    Hey @Heba.A.271 ,

    My role is Super Administrator, here is a screenshot with the database permision:

    image.png
  • reynaldo.junior
    reynaldo.junior Posts: 6 🌱

    Thanks @Paul.P.783

    I'll do both.

  • Abhishek.s.5601
    Abhishek.s.5601 Posts: 4 πŸ”

    Has anyone got the fix for above issue? I am also facing the same while creating user

  • Piero.d.211
    Piero.d.211 Posts: 24

    Hello, Abishek, how are you?

    Can you confirm that you are doing the same API call? That would be:

    POSTΒ /d2l/api/lp/1.46/users/


    When you do the "whoami" API call, what is the role of the User being used for the API calls? This action is subject to user privacy controls. The calling user context must belong to a Role granted permission to see all user fields via User Information Privacy, in addition to have the other Permissions required to create a new User.

    Please, let me know if you have any questions, okay?

    Thank you kindly,

    Piero de SΓ‘
    Bilingual Product Support Analyst