Referenca za razvijalce
Dokumentacija API
Ustvarite integracije s platformo NearbyAssist. RESTful končne točke, dosledni JSON odgovori in celovita pokritost za rezervacije, sporočanje, obračunavanje in še več.
Osnovni URL
https://api.nearbyassist.comAvtentikacija
Bearer žeton prek glave Authorization
Omejitve zahtev
500 zahtev/15 min (globalno), 20 zahtev/15 min (avtentikacijske končne točke)
Format
JSON zahteve/odgovori. Kodiranje UTF-8. Datumi ISO 8601.
Avtentikacija
Vse avtenticirane končne točke zahtevajo Bearer žeton v glavi Authorization. Žeton pridobite s prijavo prek POST /api/auth/signin. Za partnerske integracije uporabite API ključ z glavo 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_..."
Pridobite svoj API ključ
Ustvarite API ključe iz nadzorne plošče Integracije. Ključi uporabljajo predpono na_live_ in podpirajo omejene pravice (bookings:read, bookings:write itd.). Polni ključ se prikaže samo enkrat pri ustvarjanju.
Avtentikacija
(3 končnih točk)Uporabniki
(3 končnih točk)Podjetja
(7 končnih točk)Rezervacije
(8 končnih točk)Storitve
(4 končnih točk)Ocene in vprašanja
(6 končnih točk)Sporočanje
(5 končnih točk)Obračunavanje in plačila
(6 končnih točk)Osebje
(5 končnih točk)Integracije
(7 končnih točk)Webhooks
(3 končnih točk)Odgovori z napako
Vse napake vrnejo telo JSON z error in neobveznim poljem errors za napake validacije.
{
"error": "Validation failed",
"errors": [
{ "field": "email", "message": "Email is required" },
{ "field": "password", "message": "Minimum 8 characters" }
]
}| Koda | Status | Opis |
|---|---|---|
| 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. |
Stranjevanje
Končne točke seznamov podpirajo stranjevanje na osnovi kazalca z parametroma page in limit. Privzeta omejitev je 20, maksimum je 100.
GET /api/bookings/my-bookings?page=2&limit=10
{
"bookings": [...],
"total": 47,
"page": 2,
"limit": 10
}Dogodki webhook
Registrirajte končne točke webhook za prejemanje obvestil v realnem času. Vsa sporočila vsebujejo glavo X-NearbyAssist-Signature za preverjanje z 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.