Here is a version of User as JSON entity that is returned by GET /v1/social/users/{username}:
{
"id": "13979fcc7f0001016236f7a4a2b1e043",
"href": "http://localhost:8080/rest/v1/social/users/mary",
"identity": "http://localhost:8080/rest/v1/social/identities/13979f2b7f0001012c0a9eab6606475f",
"username": "mary",
"firstname": "Mary",
"lastname": "Williams",
"fullname": "Mary Williams",
"gender": "female",
"position": "developer",
"email": "mary@ex.com",
"avatar": "/rest/private/jcr/repository/social/production/soc%3Aproviders/soc%3Aorganization/soc%3Amary/soc%3Aprofile/soc%3Aavatar/?upd=1443512489914",
"phones": [
{
"phoneType": "work",
"phoneNumber": "+849877777777"
}
],
"experiences": [
{
"company": "eXo cooking zone",
"description": "Write menu \r\nBuy foods\r\nCook",
"position": "Talent novice",
"skills": "Holly dagger",
"isCurrent": false,
"startDate": "09/07/2015",
"endDate": "09/16/2015"
}
],
"ims": [
{
"imType": "gtalk",
"imId": "marylovescandies"
}
],
"urls": [
{
"url": "http://marylovescandies.com"
},
{
"url": "http://maryhatescandies.com"
}
],
"deleted": false
}On Create and Update, only some of those fields are handled. So an effective version should be:
{
"username": "mary",
"firstname": "Mary",
"lastname": "Williams",
"fullname": "Mary Williams",
"email": "mary@ex.com"
}
You cannot update other fields currently. However, password can be set in Create. It can be updated also:
PUT /v1/social/users/mary
{"password":"new_password"}On Create and Update, there are some noticeable rules:
username and email must be unique.
username, email, firstName and lastName are mandatory.
If you omit password field in Create method, the default password exo is used.
You can delete a user logically. A deleted user will be no longer returned by GET /v1/social/users
but still can be queried by GET /v1/social/users/{username}.
Username and Identity Id
From a returned User JSON, you can get username and also extract an Identity Id from the "identity" field. Both have their usage in particular.