Is it possible add/remove role to/from user via API?
@Andy Thanks for your query. We will consider to add those APIs in later release. Meanwhile, there are couple other user-related APIs just available recently. Like Add user, enable/disable user or delete user. Please check our API documentation for available APIs. I will keep you posted for new updates. Thanks!
@Renger I checked the API documentation - “System user is also a List that you can use API of Lists to query or update a system user.” , What is the list ID to be used to query or update a system user? Thanks.
@Andy As I know, there are no effective way to gain the list id of this user list. Here is a way which you might have a try:
- Accessing User Management from the admin center: /home/Settings#/organization-person
- Hit F12 keyboard shortcut to open developer tool window (recommend to use Chrome or Edge web browser). In network log, you can find a request similar to: _API/Ver(3.0)//api/crafts/list?ListID=1110770707350032384&AppID=30
You can find AppID and ListID in this request.
@Renger , I can find the list ID now, and able to enquiry the user information via API. But, when I tried to update it, it returns “user list not allowed operation”.
For the user related setup, it would be great if organization, location, position, etc can be managed by API.
Please keep us posted. Thanks.
@Renger , when I try to use API enable/disable user, it returns below. what’s going wrong? Thanks.
"Data": null, "Status": 401, "Message": "Access denied", "TotalCount": null
Error 401 indicates that authentication failed. Check that the API token is correct and passed in the header.