https://<your-domain>/api/
Every REST route lives under /api/. It comes from
RouteServiceProvider::mapApiRoutes(), which wraps the whole of
routes/api.php in Route::prefix('api'). It is not written in the route
definitions themselves, so reading routes/api.php alone makes the paths look
one segment shorter than they are.
Verified:
GET /get_devices → 404
GET /api/get_devices → 200
Production today:
| Purpose | URL |
|---|---|
| REST API | https://myfleet.sawatelematics.com/api/ |
| Realtime (Socket.IO) | http://myfleet.sawatelematics.com:9001 |
/coreapi — the browser alternative
The four in-house web portals are served from their own hostnames and reach the
API through a proxy that rewrites /coreapi/<path> → /api/<path> on the same
backend:
https://fleetv3.sawatelematics.com/coreapi/get_devices_latest
≡ https://myfleet.sawatelematics.com/api/get_devices_latest
It exists so a browser app can call the API same-origin and avoid CORS
entirely. Server-to-server integrations should use /api/ directly and ignore
/coreapi.
CORS
Browser calls to api/* are accepted only from Sawa's own web apps. A request
from any other Origin is refused with 403:
Origin: https://client.example.com
→ 403
Call the API from your server, never from a browser. Your API key is a secret and must not ship in front-end code anyway.