Forum Discussion

omygoodness's avatar
7 years ago

How to get a role UID?

Hello,

I would like to add roles using api v1 but for this operation I need role UID.

I am trying to use post query which is here:
https://community.lithium.com/t5/Developer-Documentation/bd-p/dev-doc-portal?section=commv1&leaf-id=Role.users.add#Role.users.add

 

It looks like this:
http://community.lithium.com/community-name/restapi/vc/roles/id/[id] /users/add

 

For now I have "normal" ID of role but it is not working.

I get error: No role with the specified uid.

 

Is it possible to get UID of a role? 

 

  • omygoodness

    UID is something for lithium internal use, they do not expose them. Normal id will work here but it seems you are using a role id which does not exist.

    You can get all the role using below API

    http://community.lithium.com/community-name/restapi/vc/roles

    Check if the ID you are using exists or not. 

    Here is the call to add a role

    <#assign addRole = restadmin("/roles/id/${roleID}/users/add?role.user=id/${user.id}") />