-
Notifications
You must be signed in to change notification settings - Fork 8
User Management
js.sevestre edited this page Nov 13, 2019
·
20 revisions
Obtain the apiclient̀
object using the Authentication method explained in Getting Started or in Authentication and connection
api '/user/list'
(use pagination)
users = api_client.get_call("user", "list")
for user in users:
print(user.get("uid))
Save a user by providing %email%, %first_name%, %last_name%
api '/user/save'
, minimal payload : email
, firstName
, lastName
, and accountType
(must be 'external')
user ={
"email": %email%,
"firstName": %first_name%,
"lastName": %last_name%,
"accountType": "external"
}
# if you want to set a password, add `password` and `rePassword` to the user
saved_user = api_client.get_call("user", "save", body=user)
saved_user_id, saved_user_name = saved_user.get("id"), saved_user.get("fullName")
print("User {} [{}] saved".format(saved_user_name, saved_user_id))
You can update basic information this way :
- firstName
- lastName
- status (enabled/disabled)
- isHidden (this correspond to "visible in search and user director" in the admin)
api '/user/get'
, can by used with email
or user uid
api '/user/save'
, payload, the user object retrieve with user/get
call
user = api_client.get_call("user", "get", email="sample@email.com")
# or
user = api_client.get_call("user", "get", uid="123456789")
user['lastName'] = "new lastName"
user = api_client.get_call("user", "save", body=user)
For profile data update, see User Profile Update
For group assignations, see Group Management