LogoLogo
SupportServer Hosting
  • Sonoran CAD
  • 📱Download The App
    • Steam Browser - Workaround
    • Web Browser - Clear Cache
    • Desktop App - Clear Cache
    • GTA RP Tablet - Clear Cache
    • Steam Browser - Clear Cache
  • Why Choose Sonoran CAD?
    • 🏆Why Choose Sonoran CAD?
  • Other Products
    • 🖥️FiveM Hosting
    • 📝Sonoran CMS
    • 📡Sonoran Radio
  • Tutorials
    • Getting Started
      • Registering Your Account
      • Registering Your Community
      • Inviting Users to Your CAD
      • Granting Account Permissions
      • View Your Limits
      • Community ID and API Keys
      • Troubleshooting
    • Customization
      • Custom Domain & Login Page
      • Customizing Your Layout
      • Community Branding and Settings
      • Creating Custom Record and Report Types
      • Sharing Custom Records
      • Custom Search Types
      • Geographical Settings
      • Penal Codes
      • 10-Codes
      • Addresses and Street Names
      • Unit Status Codes
      • Tone Board
      • Custom Audio Notifications
      • Custom Emails
      • Quick Links
      • Custom Page Colors
      • User Account Restrictions
      • Configuring Multiple Servers
      • Advanced Query Strings
    • Dispatching
      • Creating a Call
      • Self Dispatch
      • Timers
      • Command Line Interface (CLI)
    • Records Management
      • Record Lookups
      • Adding a Record
      • PDF Records
      • Scene Diagram Builder
    • Administration
      • System Logs
      • Remove User Account
      • Deleting or Transferring your CAD
    • Other Features
      • Configurable Hotkeys
      • Voice Commands
      • Volume and Language
  • Integration Capabilities
    • 🗃️Paid Integration Resources
      • Mobile Command Center
      • ATM Robbery
      • In-Vehicle Radar
      • Evidence Camera
      • Power Grid
      • Speed Cameras
      • Shot Spotter
    • 🛠️Integrated Vendors
    • 📺Twitch Bodycam, Bot, & Lighting Integration
    • Database Sync and Merge
      • Database Sync Credentials
      • QB Core Mapping Tutorial
      • Troubleshooting
    • Discord Bot Integration
    • Discord Rich Presence
    • Discord Webhooks
    • TeamSpeak 3 Integration
    • Stream Deck Integration
    • 🎮FiveM
      • FiveM Installation
        • Submodule Configuration
          • Submodule Troubleshooting
          • Submodule Configuration Updates
        • FiveM Submodules
          • Body Camera
          • Call Commands
          • Check API ID
          • Civilian Integration
          • Dispatch Notify
          • Emergency Response Simulator (ERS)
          • Framework Support (ESX/QBCore) and Auto Fines
          • FivePD
          • ForceReg
          • Kick
          • Locations
          • Live Map
          • Lookups
          • Postals
          • Smart Signs
          • Sonoran Radio (sonrad)
          • Station Alert
          • Tablet & Mini-CAD
          • TeamSpeak 3
          • Traffic Stop
          • Unit Status
          • VehReg
          • WraithV2
      • FiveM Development Documentation
        • Client Functions
        • Shared Functions
        • Server Functions
        • Server Events
        • HTTP Request Handling
      • Error Codes
    • 🎮Roblox ER:LC
  • Developer API Documentation
    • 📖API Integration
      • Getting Started
        • Retrieving Your Credentials
        • Integration API ID
        • Account Secret ID
      • Push Events
        • Event Restrictions
        • Record Events
          • Record Added
          • Record Edited
          • Record Removed
        • Unit Events
          • Unit Panic
          • Unit Login
          • Unit Logoff
          • Unit Status Update
          • Unit Group Name Change
          • Unit Group Add
          • Unit Group Remove
        • Dispatch Events
          • New Dispatch
          • Modified Dispatch
          • Closed Dispatch
          • Dispatch Note
          • Attach Unit
          • Detach Unit
          • Toggle Bodycam
        • Event 911
        • Remove 911
        • Sign Updated
        • Tone Played
        • Civilian
          • Character Selected
        • ERS
          • New Callout
        • Station Alert
          • New Station Alert
      • API Endpoints
        • API Restrictions
        • Emergency
          • Identifiers
            • Get Identifiers
            • Modify Identifier
            • Set Identifier
            • Unit Panic
            • Kick Unit
            • Unit Status
            • Get Active Units
            • Update Unit Location
          • Dispatch and Emergency Calls
            • Get Calls
            • New Dispatch
            • Attach Unit
            • Detach Unit
            • Update Call Postal
            • Add Call Note
            • Update Call Primary
            • Close Dispatch
            • New 911 Call
            • Remove 911
          • Custom Blips
            • Get Map Blips
            • Add Blip
            • Modify Blip
            • Remove Blip
          • Street Signs
            • Set Street Sign Config
            • Update Street Sign
          • ERS
            • Set Available Callouts
          • Station Alert
            • Set Stations
        • Civilian
          • Set Character
          • Get Characters
          • New Character
          • Edit Character
          • Remove Character
          • DB Sync: Get Character Links
          • DB Sync: Link Character
        • General
          • Get Servers
          • Set Servers
          • Get Version
          • Set Penal Codes
          • Set API IDs
          • Custom Records
            • API Options for Adding and Modifying Records
            • Get Record Templates
            • New Record
            • Edit Record
            • Remove Record
          • Lookup By Value
          • Lookup Name or Plate
          • Get Account
          • Get Accounts
          • Check API ID
          • Apply Permission Key
          • Modify Account Permissions
          • Kick or Ban User
          • Verify Secret
          • Auth Street Signs
          • Set Postal Config
          • Set Clock Time
          • Send Photo
          • Leave Community
          • Join Community
        • Local Endpoints
          • Smart Lighting
        • Internal
          • FiveM Download
      • API Examples
        • Emergency
          • LUA Examples
            • Dispatch and Emergency Calls
              • New 911 Call
              • Remove 911
              • Add Call Note
              • Set Call Postal
            • Custom Blips
              • Add Blip
              • Add Blips
              • Add Temp Blip
              • Get Map Blips
              • Remove Blip
              • Remove Blip With Subtype
            • General
              • Lookup Name or Plate
          • JavaScript Examples
            • Dispatch and Emergency Calls
              • New 911 Call
              • Remove 911
              • Add Call Note
              • Set Call Postal
            • Custom Blips
              • Add Blip
              • Add Blips
              • Add Temp Blip
              • Get Map Blips
              • Remove Blip
              • Remove Blip With Subtype
            • General
              • Lookup Name or Plate
      • Development Branch
    • 💵Developer Bounties
    • 🌎Translation Support
  • Pricing
    • Pricing FAQ
      • Military and First Responder Discount
      • Expert Installation
      • Accessing the Payment Center
      • Create and Manage a Subscription
      • Request Discord Role
    • View and Compare Plans
  • Roadmap
    • 📋Changelog
  • Other
    • AI QA
    • Contact Us
    • Policy
      • Rocket CAD Closure
      • Terms of Service
      • Privacy Policy
      • Refund and Purchase Policy
      • Discord Bot
    • Archive
      • Fire Siren
Powered by GitBook
On this page
  • Available API Endpoints
  • Emergency Endpoints
  • Civilian Endpoints
  • General Endpoints
  • API Code Examples
  • Javascript
  • Lua

Was this helpful?

Edit on GitHub
  1. Developer API Documentation
  2. API Integration

API Endpoints

View all of our API endpoints, learn about our data structuring, and integrate your framework with Sonoran CAD.

PreviousNew Station AlertNextAPI Restrictions

Last updated 4 months ago

Was this helpful?

API endpoints are not enabled with the free version of Sonoran CAD. For more information, see our or view how to check your community .

Looking for VPS, web, or dedicated hosting? Check out our official !

Available API Endpoints

Emergency Endpoints

View all emergency endpoints including unit actions, emergency calls, dispatching, and more!

Civilian Endpoints

View all civilian endpoints including creating new characters, modifying licenses, vehicle registrations, and more!

General Endpoints

View all general endpoints for user account actions, administrative actions, and more!

API Code Examples

Javascript

The server response is then logged to console.

// Import Axios library
// https://www.npmjs.com/package/axios
// Install command: `npm i axios` 
import axios from 'axios';
// Set the API URL (CAD backend)
let baseURL = 'https://api.sonorancad.com';
// Set the `api` object to be used
let api = axios.create({ baseURL });

// Format the POST body data
// https://info.sonorancad.com/sonoran-cad/api-integration/api-endpoints/emergency/unit-panic
const data = {
  id: 'YOUR_COMMUNITY_ID',
  key: 'YOUR_API_KEY',
  type: 'UNIT_PANIC',
  data: [
    // Data: List (array) of unit panic objects
    //  Here, we're specifying one unit to PANIC
    {
      apiId: "STEAM:5678", // Unit with their API ID set as `STEAM:5678`
      isPanic: true,       // Panic ON
    }
  ],
};

// Send the POST request
//  Format the data to JSON
api.post('/emergency/unit_panic', JSON.stringify(data))
  .then((response) => {
    // Response back from the backend
    console.log(response);
  })
  .catch((err) => {
    // Error response back from the backend
    console.log(err);
 });

Lua

The server response is then logged to console.

-- Body payload object
local payload = {}

-- Specify our community ID, API key, and API method type (Panic)
payload["id"] = "YOUR_COMMUNITY_ID"
payload["key"] = "YOUR_API_KEY"
payload["type"] = "UNIT_PANIC"

-- Data: List (array) of unit panic objects
--    Here, we're specifying one unit to PANIC
local postData = {
    {
        ["apiId"] = "STEAM:5678",  -- Unit with their API ID set as `STEAM:5678`
        ["isPanic"] = true         -- Panic ON
    },
}
-- Add this data to our payload
payload["data"] = postData

-- Send POST request with JSON encoded body (payload)
PerformHttpRequest("https://api.sonorancad.com/emergency/unit_panic", function(statusCode, res, headers)
    if statusCode == 200 and res ~= nil then
        -- Status code 200 (Success)
        print("result: "..tostring(res))
    else
        -- Error code
        print(("CAD API ERROR: %s %s"):format(statusCode, res))
    end
end, "POST", json.encode(payload), {["Content-Type"]="application/json"})

This example makes a based on a unit's API ID. This uses the to help make the HTTP POST request.

This example makes a based on a unit's API ID. This uses the to help make the HTTP POST request.

📖
pricing
limits
server hosting
Emergency
Civilian
General
unit panic request
Axios library
unit panic request
FiveM performHttpRequest native