<aside> 💡 The various API methods for accessing user information.

</aside>

Me

Find out who the currently logged in user is, based off the access key you're authenticating with. Mainly useful for restoring state, i.e. finding out who the logged in user is without having to store their unique identifier.

Endpoint

GET v1/me

Response Codes

200 OK Successfully retrieved the logged in user

Response Body

If the request is successful, the details of the currently logged in user will be returned as the response.

field type description
id string The unique identifier of the user
email string The user's email address
first_name string The user's first name
last_name string The user's last name
avatar_url string The URL to the user's square avatar
sign_up_date string The date (in format YYYY-MM-DD HH:MM:SS) when the user registered
last_active_date string The date (in format YYYY-MM-DD HH:MM:SS) when the user last used Hail
wants_organisation_emails boolean Whether the user wishes to receive organisation-related email notifications
wants_promotion_emails boolean Whether the user wishes to receive promotion emails from Hail

Example Response Body

{
    "id": "rp2x5yn",
    "email": "[email protected]",
    "first_name": "Buck",
    "last_name": "Robel",
    "avatar_url": "http:\\/\\/lorempixel.com\\/150\\/150\\/",
    "sign_up_date": "2014-01-01 01:02:03",
    "last_active_date": "2014-01-02 04:43:33",
    "wants_organisation_emails": true,
    "wants_promotion_emails": true
}

Get a user

Get a user's information. If the user happens to be the currently logged in user, this call will mimmic that of v1/me above. If not, a subset of that information will be returned that is suitable for public access.

Endpoint

GET v1/users/{id}

Response Codes

200 OK Successful request

Response Body

If the request was successful, and the user requested is the logged in user, the response body will be the same as v1/me above. If not, the subset will be returned: