Error 403 when creating a new user via API request
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.
Best Answers
-
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! -
Thanks @Paul.P.783
I will do both.
Answers
-
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. -
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.
-
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,
-
Hey @Heba.A.271 ,
My role is Super Administrator, here is a screenshot with the database permision:
-
Thanks @Paul.P.783
I'll do both.
-
Has anyone got the fix for above issue? I am also facing the same while creating user
-
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