Referencia pre vývojárov
API dokumentácia
Vytvárajte integrácie s platformou NearbyAssist. RESTful endpointy, konzistentné JSON odpovede a komplexné pokrytie pre rezervácie, správy, fakturáciu a ďalšie.
Základná URL
https://api.nearbyassist.comAutentifikácia
Bearer token cez hlavičku Authorization
Limity požiadaviek
500 req/15 min (globálne), 20 req/15 min (autentifikačné endpointy)
Formát
JSON požiadavky/odpovede. Kódovanie UTF-8. Dátumy ISO 8601.
Autentifikácia
Všetky autentifikované endpointy vyžadujú Bearer token v hlavičke Authorization. Token získate prihlásením cez POST /api/auth/signin. Pre partnerské integrácie použite API kľúč s hlavičkou X-API-Key.
# Session token (user authentication)
curl https://api.nearbyassist.com/api/users/profile \
-H "Authorization: Bearer <access_token>"
# API key (partner integration)
curl https://api.nearbyassist.com/api/integrations/partner/bookings \
-H "X-API-Key: na_live_..."
Získajte váš API kľúč
Vygenerujte API kľúče z dashboardu Integrácie. Kľúče používajú prefix na_live_ a podporujú obmedzené oprávnenia (bookings:read, bookings:write atď.). Celý kľúč sa zobrazí iba raz pri vytvorení.
Autentifikácia
(3 endpointov)Používatelia
(3 endpointov)Firmy
(7 endpointov)Rezervácie
(8 endpointov)Služby
(4 endpointov)Recenzie a otázky
(6 endpointov)Správy
(5 endpointov)Fakturácia a platby
(6 endpointov)Personál
(5 endpointov)Integrácie
(7 endpointov)Webhooky
(3 endpointov)Chybové odpovede
Všetky chyby vrátia JSON telo s error a voliteľným poľom errors pre zlyhania validácie.
{
"error": "Validation failed",
"errors": [
{ "field": "email", "message": "Email is required" },
{ "field": "password", "message": "Minimum 8 characters" }
]
}| Kód | Stav | Popis |
|---|---|---|
| 200 | OK | Request succeeded. |
| 201 | Created | Resource created successfully. |
| 400 | Bad Request | Invalid request body or query parameters. |
| 401 | Unauthorized | Missing or invalid authentication token. |
| 403 | Forbidden | Authenticated but lacking permission for this resource. |
| 404 | Not Found | Resource does not exist. |
| 409 | Conflict | Resource conflict (e.g. duplicate booking slot). |
| 422 | Unprocessable Entity | Validation failed. Check the errors array in the response. |
| 429 | Too Many Requests | Rate limit exceeded. Retry after the Retry-After header value. |
| 500 | Internal Server Error | Unexpected error. Contact support if persistent. |
Stránkovanie
Zoznamové endpointy podporujú stránkovanie na základe kurzora pomocou parametrov page a limit. Predvolený limit je 20, maximum je 100.
GET /api/bookings/my-bookings?page=2&limit=10
{
"bookings": [...],
"total": 47,
"page": 2,
"limit": 10
}Udalosti webhookov
Zaregistrujte webhook endpointy pre príjem upozornení v reálnom čase. Všetky dáta obsahujú hlavičku X-NearbyAssist-Signature pre overenie pomocou HMAC-SHA256.
booking.createdA new booking is confirmed.booking.updatedBooking status or time changed.booking.cancelledA booking was cancelled.lead.receivedNew lead available for your business.lead.acceptedA lead was accepted and charged.review.createdNew review posted for your business.message.receivedInbound message from any channel.payment.completedA payment was processed successfully.// Verify webhook signature
const crypto = require('crypto');
const signature = req.headers['x-nearbyassist-signature'];
const expected = crypto
.createHmac('sha256', webhookSecret)
.update(JSON.stringify(req.body))
.digest('hex');
if (signature !== expected) {
return res.status(401).json({ error: 'Invalid signature' });
}Integration Guide
Step-by-step walkthrough for OAuth, API keys, and common integration scenarios.
OpenAPI Spec
Download the OpenAPI 3.0 YAML spec. Import into Swagger UI or code generators.
Postman Collection
Pre-configured Postman collection with all endpoints ready to test.
Need help integrating?
Our developer support team is available to help with integration questions, debugging, and best practices.