Skip to main content

Notifications

Announcements

No record found.

Dynamics 365 general forum
Answered

RetrieveUserPrivilegeByPrivilegeName missing parameter Exception

Posted on by 5

I am trying to check if a user has a privilege by using the web API standard function RetrieveUserPrivilegeByPrivilegeName. 

After building the request in Typescript, the generated Request URL looks like this:

/api/data/v9.0/systemusers(29474CB3-0F57-EA11-90FE-00155D01A962)/Microsoft.Dynamics.CRM.RetrieveUserPrivilegeByPrivilegeName(PrivilegeName=@PrivilegeName)?@PrivilegeName=%27prvCreatewp_CourseMembers%27

However, i get this error:

"message":"Request message has unresolved parameters.","type":"Microsoft.Crm.CrmHttpException"

I read the documentation and looked for examples to check if i set properly the PrivilegeName parameter and everything seems to be ok. What do i do wrong?
  • Verified answer
    meelamri Profile Picture
    meelamri 13,198 User Group Leader on at
    RE: RetrieveUserPrivilegeByPrivilegeName missing parameter Exception

    I got the same error in an on-premise environment.

  • meelamri Profile Picture
    meelamri 13,198 User Group Leader on at
    RE: RetrieveUserPrivilegeByPrivilegeName missing parameter Exception

    Nice, I will try in an on-premise environment too !

  • Suggested answer
    Catalin Ilie Profile Picture
    Catalin Ilie 5 on at
    RE: RetrieveUserPrivilegeByPrivilegeName missing parameter Exception

    It seems it doesn't work in an on-premise environment. I tried in an online environment (which i suspect you did also) and there it works. So on v9.0 on-premise, it doesn't work. I have a fetchXml alternative, but i would have rather used this function. 

    pastedimage1616686667590v1.png

  • Catalin Ilie Profile Picture
    Catalin Ilie 5 on at
    RE: RetrieveUserPrivilegeByPrivilegeName missing parameter Exception

    pastedimage1616685426583v1.png

  • meelamri Profile Picture
    meelamri 13,198 User Group Leader on at
    RE: RetrieveUserPrivilegeByPrivilegeName missing parameter Exception

    I don't think so, but it should work with v9.0

    pastedimage1616685139785v1.png

    Please give it a try within your Browser and share your request again with some screenshots. 

  • Catalin Ilie Profile Picture
    Catalin Ilie 5 on at
    RE: RetrieveUserPrivilegeByPrivilegeName missing parameter Exception

    It still doesn't work for me. I noticed you're using api v9.1, whereas i have 9.0, could this be the problem?

  • Suggested answer
    meelamri Profile Picture
    meelamri 13,198 User Group Leader on at
    RE: RetrieveUserPrivilegeByPrivilegeName missing parameter Exception

    Hi, 

    it looks like your request is correct. Can you please try the same request within your browser: 

    pastedimage1616684689076v3.png

    this is my req: 

    https://xxx.crm.dynamics.com/api/data/v9.1/systemusers(D7585EA2-1137-EB11-A813-002248069AAF)/Microsoft.Dynamics.CRM.RetrieveUserPrivilegeByPrivilegeName(PrivilegeName=@PrivilegeName)?@PrivilegeName='prvReadContact'

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Anton Venter – Community Spotlight

Kudos to our October Community Star of the month!

Announcing Our 2024 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Dynamics 365 Community Newsletter - September 2024

Check out the latest community news

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,552 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,552 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans