LogoLogo
SupportServer Hosting
  • Sonoran CMS
  • 📱Download the App
  • Other Products
    • 🖥️ FiveM Hosting
    • ⌨️ Sonoran CAD
    • 📡Sonoran Radio
  • Why choose Sonoran CMS?
    • 🏆Why Choose Sonoran CMS?
  • Tutorials
    • Getting Started
      • Account Registration
      • Community Registration
      • Inviting Users
      • Troubleshooting
    • User Management
      • Creating Ranks
      • Setting User Ranks
      • Community Profile
      • Creating Rosters
    • Community Website
      • Website Builder
      • Toolbar Customization
      • Forums
      • Image Gallery
      • Navigation Permissions
    • Customization
      • Community Branding and Settings
      • Custom Domain / Vanity URL
      • Profile Fields
    • Calendar Events
    • Drive & Documents
    • Forms and Applications
      • Creating Forms
      • Form Submissions
      • Clock In/Out System
    • Administrative
      • Archive Community Member
      • Delete & Transfer Community
      • Delete User Account
      • View Your Limits
      • Growth and Discovery
        • Growth Panel
        • Discovery
      • Security Center
        • Account Flags
        • Logging Center
      • Disciplinary Panel
      • URL Shortener
  • Integration Capabilities
    • Sonoran CAD Sync
    • Sonoran Radio Sync
    • Discord Bot Integration
    • TeamSpeak 3 Role Sync
      • Getting Started
      • Adding Ranks
      • Adding your TeamSpeak UID
    • Discord Rich Presence
    • Discord Webhooks
    • FiveM Game Panel
      • Installation
      • QBCore & Qbox Panel
        • Dashboard
        • Players
        • Vehicles
        • Whitelist
        • Logs
        • Resources
        • Aces & Principals
        • Characters
        • Items
        • Jobs
        • Gangs
        • Job Sync
        • Environment
      • vMenu Panel
        • Dashboard
        • Players
        • Vehicles
        • Environment
        • Whitelist
        • Logs
        • Resources
        • Aces & Principals
    • Sonoran Shield
    • In-Game Integration Resources
      • FiveM Installation
        • FiveM Installation - Next Steps
        • FiveM Submodules
          • Clock In
          • Ace Permission Sync
          • Whitelist
          • Job Sync
      • Minecraft Integrations
        • Minecraft Resource Installation
        • Available Resources
          • Whitelist
      • Roblox Integrations
        • Roblox Resource Installation
        • Available Resources
          • Whitelist
      • IP Whitelisting
  • Developer API Documentation
    • 📖API Integration
      • Getting Started
        • Retrieving Your Credentials
        • API ID System
      • Push Events
        • Account Updated
        • Account Kicked
        • Account Banned
      • API Endpoints
        • General
          • Get Sub Version
          • Check Com API ID
          • Get Com Account
          • Get Current Clock In
          • Get Accounts
          • Get Departments
          • Get Profile Fields
          • Get Account Ranks
          • Set Account Ranks
          • Clock In Out
          • Kick Account
          • Ban Account
          • Edit Account Profile Fields
        • Servers
          • Get Game Servers
          • Set Game Servers
          • Verify Whitelist
          • Full Whitelist
        • Events
          • RSVP
        • Rosters
          • Get Roster Contents
        • Disciplinary
          • Get Member Points
          • Get Member Records
          • Add Member Record
          • Update Member Record Points
          • Update Member Record Reason
    • 🌎Translation Support
  • Roadmap
    • 📋Changelog
  • Other
    • Sonoran CMS
    • AI QA
    • Contact Us
    • Policy
      • Terms of Service
      • Privacy Policy
      • Refund and Purchase Policy
      • Promotions
        • 03/10/25-03/17/25 Suggestions
  • Pricing
    • Pricing FAQ
      • Branding Removal
      • Military and First Responder Discount
      • Expert Installation
      • Free Plugin Installation and Discount - Sonoran Servers
      • Accessing the Payment Center
      • Create and Manage a Subscription
      • Request Discord Role
    • View and Compare Plans
Powered by GitBook
On this page
  • Sonoran JS - NPM Library
  • Available API Endpoints
  • General Endpoints
  • Server Endpoints
  • Server Endpoints
  • API Code Examples
  • Javascript
  • Lua
  • Endpoints Subscription Requirements

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 CMS.

PreviousAccount BannedNextGeneral

Last updated 6 months ago

Was this helpful?

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

Sonoran JS - NPM Library

Sonoran CMS offers a complete Node API library from NPM!

npm i @sonoransoftware/sonoran.js

!

Available API Endpoints

General Endpoints

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

Server Endpoints

View all server endpoints for game server whitelist, server management, etc.

Server Endpoints

View all event endpoints for calendar events!

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 (CMS backend)
let baseURL = 'https://api.sonorancms.com';
// Set the `api` object to be used
let api = axios.create({ baseURL });

// Format the POST body data
// https://info.sonorancms.com/developer-api-documentation/api-integration/api-endpoints/general/get-com-account
const data = {
  id: 'YOUR_COMMUNITY_ID',
  key: 'YOUR_API_KEY',
  type: 'GET_COM_ACCOUNT',
  data: [
    {
      apiId: "235947056630333440" // Discord ID
    }
  ],
};

// Send the POST request
//  Format the data to JSON
api.post('/general/get_com_account', 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"] = "GET_COM_ACCOUNT"

-- Data: List (array) of unit panic objects
--    Here, we're specifying one unit to PANIC
local postData = {
    {
        ["apiId"] = "235947056630333440",  -- Discord ID
    },
}
-- Add this data to our payload
payload["data"] = postData

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

Endpoints Subscription Requirements

Each endpoint requires a certain subscription, some may be available for communities on the Free plan or some may require the Pro plan, the table below shows what subscription is required per endpoint.

Endpoint
Minimum Subscription Level

/general/get_sub_version

Free

/general/check_com_apiid

Standard

/general/get_com_account

Plus

/general/get_account_ranks

Standard

/general/clock_in_out

Plus

/servers/get_game_servers

Standard

/servers/verify_whitelist

Plus

/servers/full_whitelist

Plus

This example makes a based on a given API ID (Discord ID here). This uses the to help make the HTTP POST request.

This example makes a based on a given API ID (Discord ID here). This uses the to help make the HTTP POST request.

📖
server hosting
Learn more about our NPM library
General
Servers
Events
get community account request
Axios library
get community account request
FiveM performHttpRequest native