FNLB Devs

Developer Portal

Getting Started

FNLB Developer Documentation

Guides, the API reference, the gateway reference, and your applications all live in this portal. Use a guide when you need to know how something works. Open the reference when you need the exact request.

In this portal

  • Applications hold the OAuth2 client id, client secret, redirect URIs, and scopes for an app that acts on someone else's account. Open them from the sidebar.
  • Guides are these pages: authentication, OAuth2, rate limits, CDN assets and application icons, the gateway, the SDK, and self-hosting.
  • API reference is the interactive catalog for https://api.fnlb.net/v1. Each page shows the method, path, body, and responses, and you can try a request while you are signed in.
  • Gateway reference is the same kind of catalog for https://gateway.fnlb.net/v1. It shows bots that are connected right now, their parties, and the shards serving them.

The API is where a bot is created, configured, and told to run a command. The gateway is where you read what that bot is doing after it is online.

The same ids

These values show up in more than one place. Use the id from the first call as the path or query value on the next one.

ValueWhere you read itWhere you send it
Account idGET /user idGateway query FNLB_BUCKET_ID
Bot idGET /bots idCommand, friends, and GET /bots/{botId}
Category idGET /categories idBot parent, SDK categories, self-host CATEGORIES

A bot that is offline is still in the API list. It is missing from the gateway list until that process connects.

A call, then the live state

  1. Create an API token for your own account, or an OAuth2 access token after a user approves your application.
  2. GET /bots returns id and parent for each bot. parent is the category id.
  3. POST /bots/{botId}/commands/run runs a command on that id. The reply is text plus a format code, not the new party state.
  4. GET /bots/{botId} on the gateway, with your account id as FNLB_BUCKET_ID, returns the party and presence after the bot is connected.
  5. To run the process yourself, pass the category id to the Node.js SDK or to CATEGORIES in self-hosting. GET /shards then shows that cluster.

What you can build

Start here