Developers Moving from LonexCAD
Moving from LonexCAD
Point a LonexCAD, LonexStaff or store integration at LonexOne.
If you built something against LonexCAD, LonexStaff or the LonexCommunity store, it can keep working on LonexOne. The documented endpoints answer at your community's LonexOne address, at the same paths, taking the same fields and giving back the same JSON.
Switching over
- In the LonexOne panel, open Developer API and make a key. Tick what the integration needs:
cad.readandcad.writefor LonexCAD,staff.readandstaff.writefor LonexStaff,store.readfor store orders. - Change the integration's base address from your old install to your community's LonexOne address, like
https://yourcommunity.lonexone.comor your own domain. Keep the paths as they are. - Put the new key where the old one went. The same places still work:
X-API-Key,Authorization: Bearer,X-Api-Token, anapi_keyfield in the body, or?api_key=.
curl -X POST https://cad.yourcommunity.com/api/v2/plate-lookup.php \ -H "X-API-Key: cad_old_key" \ -d '{"plate": "ABC123"}'
curl -X POST https://yourcommunity.lonexone.com/api/v2/plate-lookup.php \ -H "X-API-Key: lxk_new_key" \ -d '{"plate": "ABC123"}'
Old keys don't carry over: LonexOne never had them, and only kept hashes of its own. Make a new key for each integration so you can turn one off without breaking the others.
What's different
The data now lives in LonexOne, so a few things work the way LonexOne does:
- Every endpoint needs a key with the right permission, apart from
health.php. Some old endpoints let anything through; these don't. - People must be in the community. Discord ids are matched to members of your community on LonexOne. Someone who hasn't signed in to your community site yet comes back as not found.
- Clocking in needs department membership.
clock-in.phpsigns on a member of that department, using their roster callsign unless you send one. Someone on duty in one department has to clock out before clocking into another. - Traffic stops are calls. A stop started with
traffic-stop.phpis a "Traffic stop" call with the officer attached; itsstop_idis the call's id. - Connection tests check your main game server through its cfx.re join link. LonexOne doesn't connect to an IP and port sent in a request.
- Licence numbers are made from the licence code and id, like
DL-12, because LonexOne doesn't number licences. - Not on LonexOne: business-owned vehicles, postal codes on civilians, and lights on the live map. They come back empty.
- Webhooks are set up in the panel instead of a settings field, and sign with the
X-LonexOne-Signatureheader.webhook-test.phpfires at your first webhook. See Webhooks. - Store orders:
order_seqis LonexOne's payment number andorder_numberis the Tebex transaction id.
Not carried over
Only the documented endpoints are here. Endpoints the old products used internally, the LonexCAD mobile app and Stream Deck endpoints, and the lonexcad_bridge exports aren't. For in-game features, use the LonexOne FiveM resource, which you can claim from your panel. For anything new, use the v1 API.
Endpoints that work
LonexCAD 54
- /api/v2/arrest-status.php
- /api/v2/assign-call.php
- /api/v2/auth.php
- /api/v2/bulk-sync-vehicles.php
- /api/v2/check-module.php
- /api/v2/check-on-duty.php
- /api/v2/check-permission.php
- /api/v2/citations.php
- /api/v2/civilian-lookup.php
- /api/v2/clear-bolo.php
- /api/v2/clock-in.php
- /api/v2/clock-out.php
- /api/v2/clock_in.php
- /api/v2/clock_out.php
- /api/v2/connection-test.php
- /api/v2/create-911-call.php
- /api/v2/create-bolo.php
- /api/v2/create-warrant.php
- /api/v2/delete-vehicle.php
- /api/v2/discord/roles.php
- /api/v2/fivem/auth.php
- /api/v2/fivem/session-reset.php
- /api/v2/fivem/validate.php
- /api/v2/health.php
- /api/v2/jail-state.php
- /api/v2/list-bolos.php
- /api/v2/list-departments.php
- /api/v2/list-flag-types.php
- /api/v2/list-license-types.php
- /api/v2/list-officers-on-duty.php
- /api/v2/list-positions.php
- /api/v2/list-warrants.php
- /api/v2/lookup-character.php
- /api/v2/lookup-officer-by-callsign.php
- /api/v2/lookup-vehicle.php
- /api/v2/my-civilians.php
- /api/v2/officer-status.php
- /api/v2/plate-lookup.php
- /api/v2/player-lookup.php
- /api/v2/recent-911-calls.php
- /api/v2/recent-arrests.php
- /api/v2/remove-civilian-flag.php
- /api/v2/remove-warrant.php
- /api/v2/search.php
- /api/v2/set-civilian-flag.php
- /api/v2/set-civilian-state.php
- /api/v2/set-officer-status.php
- /api/v2/sync-character.php
- /api/v2/sync-license.php
- /api/v2/sync-positions.php
- /api/v2/sync-vehicle.php
- /api/v2/sync-weapon.php
- /api/v2/traffic-stop.php
- /api/v2/webhook-test.php
LonexStaff 7
- /api/comms/add-task
- /api/comms/config
- /api/comms/remove-last-task
- /api/comms/set-location
- /api/player/check-immunity
- /api/staff/duty/status
- /api/staff/on-duty
LonexCommunity store 1
- /store/api/orders