Controllers

  • The collection of /api/v3/admin route endpoints and handler functions related to admin tasks.

    All routes in this group should be restricted to users with administrator priviliges. This controller returns data of a privledged nature, and has control endpoints for setting overall server state.

    See more

    Declaration

    Swift

    struct AdminController : APIRouteCollection
  • The collection of alert endpoints, with routes for: - getting server time,, - getting public address-style announcements,, - getting notifications on alertwords, - getting notificaitons on incoming Fez messages.

    See more

    Declaration

    Swift

    struct AlertController : APIRouteCollection
  • The collection of /api/v3/auth/* route endpoints and handler functions related to authentication.

    API v3 requires the use of either HTTP Basic Authentication (RFC7617) or HTTP Bearer Authentication (based on RFC6750) for virtually all endpoint access, with very few exceptions carved out for fully public data (such as the Event Schedule).

    This means that essentially all HTTP requests must contain an Authorization header.

    Important

    The query-based &key= scheme used in v2 is not supported at all.

    A valid HTTP Basic Authentication header resembles:

    Authorization: Basic YWRtaW46cGFzc3dvcmQ=

    The data value in a Basic header is the base64-encoded utf-8 string representation of the user’s username and password, separated by a colon. In Swift, a one-off version might resemble something along the lines of:

    var request = URLRequest(…) let credentials = “username:password”.data(using: .utf8).base64encodedString() request.addValue(“Basic (credentials)”, forHTTPHeaderField: “Authorization”) …

    Successful execution of sending this request to the login endpoint returns a JSON-encoded token string:

    { “token”: “y+jiK8w/7Ta21m/O8F2edw==” }

    which is then used in HTTP Bearer Authentication for all subsequent requests:

    Authorization: Bearer y+jiK8w/7Ta21m/O8F2edw==

    A generated token string remains valid across all clients on all devices until the user explicitly logs out, or it otherwise expires or is administratively deleted. If the user explicitly logs out on any client on any device, the token is deleted and the /api/v3/auth/login endpoint will need to be hit again to generate a new one.

    See more

    Declaration

    Swift

    struct AuthController : APIRouteCollection
  • Methods for accessing the list of boardgames available in the onboard Games Library.

    See more

    Declaration

    Swift

    struct BoardgameController : APIRouteCollection
  • The collection of /api/v3/client/* route endpoints and handler functions that provide bulk retrieval services for registered API clients.

    See more

    Declaration

    Swift

    struct ClientController : APIRouteCollection
    extension ClientController: FezProtocol
  • The collection of /api/v3/events/* route endpoints and handler functions related to the event schedule.

    See more

    Declaration

    Swift

    struct EventController : APIRouteCollection
  • The collection of /api/v3/fez/* route endpoints and handler functions related to Looking For Group and Seamail chats.

    See more

    Declaration

    Swift

    struct FezController : APIRouteCollection
  • The collection of /api/v3/forum/* route endpoints and handler functions related to forums.

    See more

    Declaration

    Swift

    struct ForumController : APIRouteCollection
  • Declaration

    Swift

    struct ImageController : APIRouteCollection
  • Methods for accessing the list of boardgames available in the onboard Games Library.

    See more

    Declaration

    Swift

    struct KaraokeController : APIRouteCollection
  • Methods for accessing the list of boardgames available in the onboard Games Library.

    See more

    Declaration

    Swift

    struct MicroKaraokeController : APIRouteCollection
  • The collection of /api/v3/mod/ route endpoints and handler functions related to moderation tasks.

    All routes in this group should be restricted to users with moderation priviliges. This controller returns data of a privileged nature, including contents of user reports, edit histories of user content, and log data about moderation actions.

    Note that some moderation actions aren’t in this file. Most such endpoints have a handler method allowing a user to operate on their own content, but also allowing a mod to operate on other users’ content. For example, twarrtUpdateHandler lets a user edit a twarrt they wrote, but also lets mods edit any user’s twarrt.

    The routes in this controller that return data on various Reportable content types are designed to return everything a Mod might need to make moderation decisions, all in one call. In many cases that means calls return multiple array types with no paging or array limits. In non-degenerate cases the arrays should less than ~20 elements. Additionally, there are few moderators and they won’t be calling these methods multiple times per second.

    See more

    Declaration

    Swift

    struct ModerationController : APIRouteCollection
  • The collection of /api/v3/phone/* route endpoints and handler functions related to phone call management..

    See more

    Declaration

    Swift

    struct PhonecallController : APIRouteCollection
  • The collection of /api/v3/test/* route endpoints and handler functions for unit testing and benchmarking purposes.

    Note

    These endpoints are NOT intended as API for client development.
    See more

    Declaration

    Swift

    struct TestController : APIRouteCollection
  • The collection of /api/v3/twitarr/* route endpoint and handler functions related to the twit-arr stream.

    See more

    Declaration

    Swift

    struct TwitarrController : APIRouteCollection
  • The collection of /api/v3/user/* route endpoints and handler functions related to a user’s own data.

    Separating these from the endpoints related to users in general helps make for a cleaner collection, since use of User.parameter in the paths here can be avoided entirely.

    See more

    Declaration

    Swift

    struct UserController : APIRouteCollection
  • The collection of /api/v3/user/* route endpoints and handler functions related to a user’s own data.

    Separating these from the endpoints related to users in general helps make for a cleaner collection, since use of User.parameter in the paths here can be avoided entirely.

    See more

    Declaration

    Swift

    struct UsersController : APIRouteCollection