Forum Discussion

adsk_cmgrs's avatar
adsk_cmgrs
Director
11 years ago
Solved

Add User Role via API

Hello,

 

I know it's possible to add roles to a user via: http://community/restapi/vc/roles/name/<rolename>/users/add

 

Question, does this utilize a users username ex. adsk_cmgrs, or their userid ex. http://community.lithium.com/t5/user/viewprofilepage/user-id/23942?

4 Replies

  • adskdave's avatar
    adskdave
    Adept
    11 years ago

    Can you say what the base URL for this call would be?  I unserstand you pass the user href in the body of the post, but how do you specify which role you are adding them to?

     

    I tried posting to:

    https://[our-community]/restapi/vc/roles/id/[role-id-to-add-to-user]/user/add?restapi.session_key=[session-key]&restapi.response_format=json

     

    but I get a response with:

    {"code":501,"message":"Unknown path element at node 'role'."}

     

    Any help is appreciated!

  • adskdave's avatar
    adskdave
    Adept
    11 years ago
    Please disregard, I had /user/add, not users/add

    thanks again.