Skip to content

User Management

aureldent edited this page Oct 17, 2019 · 20 revisions

The SDK includes a helper to easily manipulate the users

To list all the users of your Lumapps plateform

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))

To create a user

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))
Clone this wiki locally