-
Notifications
You must be signed in to change notification settings - Fork 8
User Management
aureldent edited this page Oct 17, 2019
·
20 revisions
The SDK includes a helper to easily manipulate the users
Obtain the api object using the Authentication method explained in Getting Started or in Authentication and connection
api = ... # previously obtained
users = api.get_call("user", "list")
for user in users:
print(user.get("uid))
Save a user by providing %email%, %first_name%, %last_name%
api = ... # previously obtained
user ={
"email": %email%,
"firstName": %first_name%,
"lastName": %last_name%,
"accountType": "external"
}
saved_user = api.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))