Tagairt

REST API

Úsáid inneall cúil d'aipe ó aon chliant.

Nochtann gach aip REST API JSON — an ceann céanna a úsáideann an SDK gréasáin agus aipeanna Flutter.

Base URL: https://builder77.com/api/runtime/<PROJECT_ID>

Aimsigh ID do thionscadail in URL an tógálaí (/build/<PROJECT_ID>). Tá CORS cumasaithe do gach bunús.

Fíordheimhniú

Roghnach. Logáil isteach chun comhartha a fháil agus seol é mar Authorization: Bearer <token>.

ModhCosánCorpToradh
POST/auth/signup{ email, password, name }{ token, user }
POST/auth/signin{ email, password }{ token, user }
GET/auth/me—{ user }

Bunachar sonraí

ModhCosánNótaí
GET/db/<collection>Fiosrú: where (JSON ionchódaithe i URL), sort, limit, offset, mine=1 → { items }
GET/db/<collection>/_count→ { count }
GET/db/<collection>/<id>→ taifead nó 404
POST/db/<collection>Corp { data: {...} } → taifead
PATCH/db/<collection>/<id>Corp { data: {...} } (cumasc) → taifead
PUT/db/<collection>/<id>Corp { data: {...} } (ionadú) → taifead
DELETE/db/<collection>/<id>→ { ok: true }

AI, stóráil, ríomhphost

ModhCosánCorp
POST/ai{ messages: [{role, content}], system?, json? } → { text, data? }
POST/storage/uploadmultipart/form-data le file → { id, url, name, size }
POST/email/send{ to, subject, html } → { ok }
POST/payments/checkout{ items: [{name, amount, quantity}], currency?, returnUrl, metadata? } → { url, sessionId }
GET/payments/verify?session_id=→ { paid, payment }

Sampla

curl "https://builder77.com/api/runtime/PROJECT_ID/db/tasks?sort=-createdAt&limit=10"

curl -X POST "https://builder77.com/api/runtime/PROJECT_ID/db/tasks" \
  -H "Content-Type: application/json" \
  -d '{"data": {"title": "From the API", "done": false}}'

Earráidí

Tugann earráidí JSON { "error": "message" } ar ais le stádas 4xx/5xx. Ciallaíonn 429 gur bhain tú teorainn ráta amach; ciallaíonn 402 go bhfuil úinéir na haipe as creidmheasanna comhtháthaithe.