Documentação da API do Resenha
O Resenha é a plataforma de comunidades da Nortweb: servidores, canais de texto e voz, cargos, bots e integrações. Com a API HTTP e o Gateway você cria bots, automações e clientes próprios.
A instância oficial fica em https://joinresenha.com.br. As páginas de referência abaixo estão em inglês.
| Seção | O que tem |
|---|---|
| API HTTP | Ler e alterar usuários, comunidades, canais e mensagens |
| Gateway | Receber eventos em tempo real por WebSocket |
| Voz | Entrar em chamadas de voz e compartilhar a tela |
| Proxy de mídia | Carregar mídias e enviar arquivos |
| API de administração | Gerenciar a instância com acesso de administrador |
Autenticação, erros, limites de requisição e idiomas descrevem o comportamento comum a todas as APIs. A maioria dos IDs são snowflakes.
Primeiros passos com um bot
Section titled “Primeiros passos com um bot”- Entre no Resenha e abra Configurações → Aplicativos → Criar aplicativo.
- Na página do aplicativo, crie o bot e copie o token. Guarde o token em segredo.
- Envie as requisições para
https://joinresenha.com.br/api/v1/...com o cabeçalhoAuthorization: Bot SEU_TOKEN. - Conecte-se ao Gateway em
wss://joinresenha.com.br/gatewaypara receber mensagens e eventos.
curl https://joinresenha.com.br/api/v1/users/@me \ -H "Authorization: Bot SEU_TOKEN"Os endereços oficiais da instância podem ser descobertos em https://joinresenha.com.br/.well-known/fluxer.
Field notation
Section titled “Field notation”In field tables, ? after a field name means optional. Before a type, it means nullable.
| Field | Type | Meaning |
|---|---|---|
name | string | Required and cannot be null |
name? | string | Optional, but cannot be null when present |
name | ?string | Required, but can be null |
name? | ?string | Can be omitted or set to null |
In a request body, leaving a field out and sending null can do different things, and the endpoint says which.
| Type | Meaning |
|---|---|
array[type] | An array of that type |
map[key, value] | A JSON object with keys of the first type and values of the second |
Endpoint discovery
Section titled “Endpoint discovery”Get /.well-known/fluxer on the instance origin to find its base URLs. It needs no authentication and allows cross-origin requests.
GET https://joinresenha.com.br/.well-known/fluxerBots, libraries and third-party clients send requests to endpoints.api_public from the endpoints object followed by a /v1 path, such as /v1/users/@me. Connect to the Gateway at endpoints.gateway. Don't build base URLs from the origin or hard-code Resenha domains. Send credentials in the Authorization header as described in Authentication.