Imperial Emergency API & Exports
The ImperialEmergency module allows a FiveM server to create and manage 911 calls, panic signals, call notes, unit status, and vehicle lookups. These functions use ImperialCAD's secure backend API.
โ๏ธ Setup
Add the following to your server.cfg
:
setr imperial_community_id "YOUR_COMMUNITY_ID"
set imperialAPI "YOUR_API_SECRET"
Enable debug output:
Config.debug = true
๐ข Exports & Examples
๐ Create911Call(data, callback)
Create911Call(data, callback)
Creates a standard 911 call. This includes flashing lights and audio in the LEO MDC.
Required Fields
name
string
Caller name
street
string
Street name
crossStreet
string
Cross street
postal
string
Postal code
city
string
City
county
string
County
info
string
Call description
Example
exports["imperialEmergency"]:Create911Call({
name = "Caller Name",
street = "Main St",
crossStreet = "2nd Ave",
postal = "102",
city = "Los Santos",
county = "Los Santos County",
info = "Suspicious vehicle parked on the curb"
}, function(success, res)
print(success and "Call sent!" or ("Failed: " .. res))
end)
Example Response
{
"status": "success",
"response": {
"callId": "A1B2C3D4E5",
"callnum": 203
}
}
โ DeleteCall(data, callback)
DeleteCall(data, callback)
Deletes an active call using its callId
.
Required Fields
callId
string
discordId
string
Example
exports["imperialEmergency"]:DeleteCall({
callId = "A1B2C3D4E5",
discordId = "123456789012345678"
}, function(success, res)
print(success and "Call deleted." or ("Failed: " .. res))
end)
Example Response
"Call ID A1B2C3D4E5 closed"
โ
CreateCall(data, callback)
CreateCall(data, callback)
Creates a call manually (non-911) with custom status and priority.
Required Fields
users_discordID
string
street
string
crossStreet
string
postal
string
city
string
county
string
info
string
nature
string
status
string
priority
number
Example
exports["imperialEmergency"]:CreateCall({
users_discordID = "123456789012345678",
street = "Broadway",
crossStreet = "5th St",
postal = "309",
city = "Los Santos",
county = "Blaine",
info = "Disturbance reported",
nature = "Disturbance",
status = "PENDING",
priority = 2
}, function(success, res)
print(success and "Call created." or ("โ Failed: " .. res))
end)
Example Response
{
"status": "success",
"response": {
"callId": "F9G8H7I6J5",
"callnum": 204
}
}
โ AttachCall(data, callback)
AttachCall(data, callback)
Attaches a unit to an active call.
Required Fields
users_discordID
string
callnum
number
Example
exports["imperialEmergency"]:AttachCall({
users_discordID = "123456789012345678",
callnum = 204
}, function(success, res)
print(success and "Unit attached." or ("Failed: " .. res))
end)
โ๏ธ NewCallNote(data, callback)
NewCallNote(data, callback)
Adds a note to the user's currently assigned call.
Required Fields
users_discordID
string
description
string
Example
exports["imperialEmergency"]:NewCallNote({
users_discordID = "123456789012345678",
description = "Caller updated: suspects have left the area."
}, function(success, res)
print(success and "Note added." or ("Failed: " .. res))
end)
โ Booter(data, callback)
Booter(data, callback)
Sets a unit off-duty (removes from all assignments).
Required Fields
users_discordID
string
Example
exports["imperialEmergency"]:Booter({
users_discordID = "123456789012345678"
}, function(success, res)
print(success and "User off-duty." or ("Failed: " .. res))
end)
โ ๏ธ Panic(data, callback)
Panic(data, callback)
Triggers a panic alert from a unit.
Required Fields
users_discordID
string
street
string
postal
string
Example
exports["imperialEmergency"]:Panic({
users_discordID = "123456789012345678",
street = "Mission Row",
postal = "203"
}, function(success, res)
print(success and "Panic sent!" or ("Failed: " .. res))
end)
โ ClearPanic(callback)
ClearPanic(callback)
Clears an active panic alert for your community.
Example
exports["imperialEmergency"]:ClearPanic(function(success, res)
print(success and "Panic cleared." or ("Failed: " .. res))
end)
๐ข CheckPlate(data, callback)
CheckPlate(data, callback)
Checks a plate in CAD records.
Required Fields
plate
string
Example
exports["imperialEmergency"]:CheckPlate({
plate = "XYZ123"
}, function(success, res)
if success then
local result = json.decode(res)
print("Plate Registered To: " .. result.response.owner)
else
print("Failed to check plate.")
end
end)
Example Response
{
"status": "success",
"response": {
"owner": "John Doe",
"plate_number": "XYZ123",
"stolen": false,
"insurance": true,
"insurance_status": "Active",
"business": false,
"reg_status": "Valid"
}
}
๐ API Reference
All API's will use the same format of "https://imperialcad.app/api/1.1/wf/" and then the provided API Endpoint as provided below.
TYPE
https://imperialcad.app/api/1.1/wf/<API_GOES_HERE>
POST
Create911Call
911
POST
CreateCall
CallCreate
POST
DeleteCall
CallDelete
POST
AttachCall
AttachCall
POST
NewCallNote
callnote
POST
Booter
offduty
POST
Panic
panic
POST
ClearPanic
clearpanic
POST
CheckPlate
checkplate
๐ API Authorization
All POST
endpoints require the following header:
{
"Content-Type": "application/json",
"APIKEY": GetConvar("imperialAPI", "")
}
๐ License
ยฉ Imperial Solutions. Unauthorized distribution or use is prohibited.
Last updated
Was this helpful?