User API
This page shows how to use and implement the User API.
Creating users
This covers all the actions required to create functional users:
- Creating users in the database
- Associating users to a domain
- Creating a mailbox
- Creating a default calendar
- Creating a default calendar view
- Creating "My contacts" and "Collected contacts" address books
HTTP example
Method | URL |
---|---|
PUT | https://"domain"/api/users/"domain"/"uid" |
domain = the domain | uid = unique user identifier |
Body | |
|
Curl example
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>
Java example (using the Bluemind generated client)
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);