Users

The Users resource contains a list of all the users registered for access to a given tenant. A user must be registered with EMu before they are able to access the system. The source of a user’s information is the EMu registry, where the list of users is built, and the Parties module where the user details are kept. The link between the EMu registry username and the corresponding Parties record is via the AddEMuUserId field.

A typical user record looks like:

{
    "id": "emu:/museum/users/nick",
    "version": 1,
    "data": {
        "username": "nick",
        "locale": "en-GB",
        "roles": {
            "current": {
                "role": "emu:/museum/roles/Admin",
                "name": "Admin"
            },
            "list": [
                {
                    "role": "emu:/museum/roles/Admin",
                    "name": "Admin"
                }
            ]
        },
        "person": {
            "familyName": "Jones",
            "givenName": "Nick",
            "email": "Nick.Jones@museum.org",
            "address": {
                "addressLocality": "Washington",
                "addressRegion": "DC",
                "addressCountry": "USA"
            }
        }
    }
}

The properties are defined as:

Name Description
username userid required when logging in
locale Language to use for messages and error strings
roles List of the roles (EMu groups) associated with the user
roles/current Current role assigned when logged in
roles/current/role URI of the current role
roles/current/name EMu group name of current role
roles/list List of all roles the user could use
roles/list/role URI for the roles
roles/list/name EMu group name for the roles
person Information about the person
person/familyName User’s surname
person/givenName Users’ first name
person/email User’s email address
person/address User’s address details
person/address/streetAddress Number and stream name
person/address/postalCode Postal or zip code
person/address/addressLocality City or town
person/address/addressRegion State or province
person/address/addressCountry Country

The following requests are available for the users resource.

Retrieve

GET /{tenant}/users[?select={selectlist}]
GET /{tenant}/users/{username}[?select={selectlist}]

The GET method lists users registered for use with EMu and so with the shim. The first form lists all the users registered with EMu for the given tenant. The second forms lists the details for a single user. The list of users for a given tenant is not cached, so as new users are added to EMu they will be listed in the next request.

By default all values in the record are returned. You can limit the values returned using the select query parameter. The parameter takes a comma separated list of field names. The field names are that of the enveloped record so most field names will start with data.. The Select Syntax section provides a complete description of acceptable values for the select query parameter.

A 200 status is returned along with the user(s) details for successful requests.

Example URI

GET /tenant/users/barney

Headers

Authorization: Bearer {token}
Prefer: representation=minimal

Response 200

{
    "id": "emu:/museum/users/barney",
    "version": 1,
    "data": {
        "username": "barney",
        "locale": "en-GB",
        "roles": {
            "current": {
                "role": {
                    "id": "emu:/museum/roles/Admin",
                    "@controls": {
                        "self": {
                            "href": "http://swanston.melbourne.axiell.com:8084/museum/roles/Admin"
                        }
                    }
                },
                "name": "Admin"
            },
            "list": [
                {
                    "role": {
                        "id": "emu:/museum/roles/Admin",
                        "@controls": {
                            "self": {
                                "href": "http://swanston.melbourne.axiell.com:8084/museum/roles/Admin"
                            }
                        }
                    },
                    "name": "Admin"
                },
                {
                    "role": {
                        "id": "emu:/museum/roles/Conservation",
                        "@controls": {
                            "self": {
                                "href": "http://swanston.melbourne.axiell.com:8084/museum/roles/Conservation"
                            }
                        }
                    },
                    "name": "Conservation"
                },
                {
                    "role": {
                        "id": "emu:/museum/roles/Archives",
                        "@controls": {
                            "self": {
                                "href": "http://swanston.melbourne.axiell.com:8084/museum/roles/Archives"
                            }
                        }
                    },
                    "name": "Archives"
                }
            ]
        }
    },
    "@namespaces": {
        "emu": {
            "name": "http://axiell.com/emu#"
        }
    },
    "@controls": {
        "self": {
            "href": "http://swanston.melbourne.axiell.com:8084/museum/users/barney"
        },
        "start": {
            "method": "GET",
            "href": "http://swanston.melbourne.axiell.com:8084/"
        },
        "search": {
            "method": "GET",
            "href": "http://swanston.melbourne.axiell.com:8084/museum/users"
        }
    }
}

Response Headers

Content-Type: application/vnd.mason+json; charset=UTF-8
Authorization: Bearer {token}