View on GitHub

WPI User Hub

WPI User Hub

Endpoint Details

All Endpoints

The following information applies to most or all endpoints:

Tokens

Most endpoints require a token, provided by the auth endpoint. This should be stored and passed in the query string with a key of token. Alternatively, passing a header of Auth-User with the user ID of the current user also works. The latter is designed to work with the AWS API Gateway functionality.

Successful queries with a valid token refreshes it for an additional hour on all endpoints that require the token.

Errors with tokens are as follows:

Permissions

Some endpoints, mostly write ones, require the user associated with a given token to have a given role.

Endpoints that check permissions can accept an optional query string of useOffice equal to the ID of the office to use. This is useful where a user wants to act as a specific office, instead of the first available one.

Errors with permission errors are as follows:

Note: Users with the admin role pass all permission checks.