The User Data Service
Used to retrieve information about a user using a rest api.
Rest API
By default the user data service is deployed alongside the content service, at http://ace-content-service:8081/user, but this may change in the future and should be considered a wholly different URL from the content service's.
The API is similar to the content Web Service API, using a token in the same manner.
Here is a curl example, with the token as an environment variable TOKEN.
curl -H "Content-Type: application/json" -H "X-Auth-Token: $TOKEN" http://ace-content-service:8081/user/{loginName}
The service requires that the logged in user has permission to read the content for the user see Permissions, otherwise a fallback response will be returned with a matching format, but the only field returned is the loginName.
A typical response json when a content exists for the user
{
"_type" : "atex_UserDataContent",
"acePassport" : {
"_type" : "acePassport",
"phoneNumber" : "1234567890",
"loginName" : "bob",
"name" : "Bob Content",
"avatar" : "http://example.com/nisse.jpg",
"email" : "bob@content.xyz"
}
}
Type used by the service
The type used by this serivce is called acePassport and has the following fields.
| Name | Type | Optional | Description |
|---|---|---|---|
| loginName | string | The username/loginname | |
| name | string | * | The full name of the user |
| string | * | An email address | |
| avatar | string | * | URL to avatar image |
| phoneNumber | string | * | A phone number |
To add user data for a user, create a content of this type with the user information
and give it the alias _userdata/{loginName}.
If no content can be found for a {loginname}, a fallback is available. In the future other sources than content may be used to fill the user information.
Additional information can be stored and retrieved for a user by adding aspects on the content and mapping it in the variant aceUserData on the type acePassport.