SDKs
O WhatIsUp publica uma spec OpenAPI 3.1 em api.whatisup.dev/openapi.json. Gere um client tipado em qualquer linguagem com um comando.
TypeScript
pnpm add -D openapi-typescript
npx openapi-typescript https://api.whatisup.dev/openapi.json -o whatisup.d.tsDepois use com fetch:
import type { paths } from './whatisup';
type SendBody = paths['/v1/channels/{id}/messages']['post']['requestBody']['content']['application/json'];
const res = await fetch(`https://api.whatisup.dev/v1/channels/${id}/messages`, {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.WHATISUP_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({ type: 'text', to: '+155512345', text: 'hi' } satisfies SendBody),
});Python
pip install openapi-python-client
openapi-python-client generate --url https://api.whatisup.dev/openapi.jsonGo
go install github.com/oapi-codegen/oapi-codegen/v2/cmd/oapi-codegen@latest
curl https://api.whatisup.dev/openapi.json -o openapi.json
oapi-codegen -package whatisup -generate types,client openapi.json > whatisup.gen.goOutras linguagens
Qualquer coisa que consuma OpenAPI 3.1 funciona: Rust (openapi-generator-cli),
Ruby (openapi-generator), Java (openapi-generator), PHP, C#, Swift, Kotlin,
Elixir, Clojure.
llms.txt
Agents puxam uma descrição plana de toda a superfície a partir de whatisup.dev/llms.txt e a versão longa em whatisup.dev/llms-full.txt.
SDK oficial
Um SDK oficial em TypeScript está no roadmap. Até lá, a geração a partir da spec é o caminho recomendado — é exatamente o que a gente entregaria por baixo dos panos de qualquer forma.