Forum Discussion

surendrakalapa's avatar
surendrakalapa
Contributor
3 years ago

How to update an user role to a user through an API call

Tried updating the user role to an user by using an API call
put: {{khoros_base_uri}}/api/2.0/users/295
BODy:
"data": {
"type": "user",
"roles_to_add": ["t:'ECMS 2'"]
}}

responce: 200 success

Now i used a Get call to check the role is updated in the user profile.
Get: {{khoros_base_uri}}/api/2.0/search?q=SELECT * FROM roles WHERE users.id = '295'

Response : 200 success

But the role is not added to the user data in get call

 please let me know


Thanks
surendra