Uzziņas
REST API
Izmanto savas lietotnes aizmugursistēmu no jebkura klienta.
Katra lietotne nodrošina JSON REST API — to pašu, ko izmanto tīmekļa SDK un Flutter lietotnes.
Base URL: https://builder77.com/api/runtime/<PROJECT_ID>Projekta ID atradīsi redaktora URL (/build/<PROJECT_ID>). CORS ir atļauts visiem avotiem.
Autentifikācija
Pēc izvēles. Piesakies, lai saņemtu tokenu, un sūti to kā Authorization: Bearer <token>.
| Metode | Ceļš | Ķermenis | Atgriež |
|---|---|---|---|
| POST | /auth/signup | { email, password, name } | { token, user } |
| POST | /auth/signin | { email, password } | { token, user } |
| GET | /auth/me | — | { user } |
Datubāze
| Metode | Ceļš | Piezīmes |
|---|---|---|
| GET | /db/<collection> | Parametri: where (URL kodēts JSON), sort, limit, offset, mine=1 → { items } |
| GET | /db/<collection>/_count | → { count } |
| GET | /db/<collection>/<id> | → ieraksts vai 404 |
| POST | /db/<collection> | Ķermenis { data: {...} } → ieraksts |
| PATCH | /db/<collection>/<id> | Ķermenis { data: {...} } (sapludināšana) → ieraksts |
| PUT | /db/<collection>/<id> | Ķermenis { data: {...} } (aizstāšana) → ieraksts |
| DELETE | /db/<collection>/<id> | → { ok: true } |
MI, krātuve, e-pasts
| Metode | Ceļš | Ķermenis |
|---|---|---|
| POST | /ai | { messages: [{role, content}], system?, json? } → { text, data? } |
| POST | /storage/upload | multipart/form-data ar 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 } |
Piemērs
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}}'Kļūdas
Kļūdas atgriež JSON { "error": "message" } ar statusu 4xx/5xx. 429 nozīmē, ka sasniegts biežuma ierobežojums; 402 nozīmē, ka lietotnes īpašniekam beigušies integrāciju kredīti.