Get user

ENDPOINT /api/v0-user/id/[userid] (GET)

When generating URLs, [userid] is the id of a user SecurityPrincipal

Returns

This request can respond with following kinds, in addition to the generic kinds (see Introduction):

Kind Meaning
haplo:api-v0:user:details The request was successful and a user’s details have been returned
haplo:api-v0:user:no-such-user No user could be found with the requested id. Returns with HTTP status 400

Along with the standard success and kind fields (see Introduction for explanation), the response has the following structure:

  • user
    • id
    • nameFirst
    • nameLast
    • name
    • code
    • email
    • ref
    • isGroup
    • isActive
    • isSuperUser
    • isServiceUser
    • isAnonymous
    • localeId
    • directGroupMembership

Apart from directGroupMembership, all the fields correspond directly to the equivalent field on the SecurityPrincipal. directGroupMembership is the equivalent of directGroupIds, but returns an array of group API codes instead of group IDs.

Example response

{
    "success": true,
    "kind": "haplo:api-v0:user:details",
    "user": {
        "id":130,
        "nameFirst":"First",
        "nameLast":"Last",
        "name":"First Last",
        "code":null,
        "email":"first.last@example.com",
        "ref":null,
        "isGroup":false,
        "isActive":true,
        "isSuperUser":false,
        "isServiceUser":false,
        "isAnonymous":false,
        "localeId":"en",
        "directGroupMembership":[
            "haplo:group:example", 
            "group:123"
        ]
    }
}