Skip to content

User Management

Jean-Sébastien Sevestre edited this page Nov 16, 2018 · 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 authentification method explained in Getting Started or in Authentication and connection

from lumapps_api_sdk import user

api = ... # previously obtained
users = user.list(api)

for usr_dict, usr_obj in users:
    print(usr_obj.uid)

To create a user

save a user by providing %email%, %first_name%, %last_name%

from lumapps_api_sdk.user import User

api = ... # previously obtained
usr = User(
    api,
    email="%email%",
    representation ={"firstName":"%first_name%","lastName":"%lastName%"},
)
success, errors = usr.save()
print(success)
Clone this wiki locally