La création d'un utilisateur couvre toutes les actions nécessaire pour créer un utilisateur opérationnel :
Méthode | URL | |
---|---|---|
PUT | https://<domain>/api/users/<domain>/<uid> | |
domain = le domaine uid = identifiant unique de l'utilisateur | ||
Body | ||
|
curl -X GET --header 'Content-Type: application/json' --header 'X-BM-ApiKey: <auth_key>' --header 'Accept: application/json' --header 'X-BM-ApiKey: <auth_key>' -d '{ "emails": [{ "address": "john@<domain>", "allAliases": false, "isDefault": true }], "login": "john", "password": "doe", "contactInfos": { "identification": { "name": { "familyNames": "Doe", "givenNames": "John" }, "photo": false } }, "routing": "internal", "accountType": "FULL" }' https://<domain>/api/users/<domain>/<uid> |
IUser userService = serviceProvider.instance(IUser.class, domain); User user = new User(); user.login = "john"; user.password = "doe"; user.routing = Routing.internal; user.emails = Arrays.asList(Email.create(login + "@" + domain, true)); user.contactInfos = new VCard(); user.contactInfos.identification.name = new Name(); user.contactInfos.identification.name.givenNames = login; String userUid = UUID.randomUUID().toString(); userService.create(userUid, user); |