For the complete documentation index, see llms.txt. This page is also available as Markdown.

Poll Integration Panel Actions

Poll CAD user actions for a custom Integration Panel.

GET https://api.sonorancad.com/v2/integration-panels/servers/{serverId}/panels/{panelKey}/actions

Rate limit: 240 requests per minute per API key.

Poll unexpired CAD user actions for a panel. Actions remain available until acknowledged or until their 60-second lifetime expires.

Process events in cursor order. Acknowledge each event after the third-party action finishes, then persist nextCursor for the next poll. If processing fails before acknowledgement, poll again with the prior cursor.

Path Parameters

Name
Type
Description

serverId

integer

Configured CAD server ID allowed by the API key.

panelKey

string

Stable panel key.

Query Parameters

Name
Type
Default
Description

after

integer

0

Return events with a cursor greater than this value.

limit

integer

100

Return 1-100 events.

Example Request

-- luarocks install sonoran.lua
local Sonoran = require("sonoran")
local sonoran = Sonoran.createClient({
  product = Sonoran.productEnums.CAD,
  communityId = "YOUR_COMMUNITY_ID",
  apiKey = "YOUR_API_KEY",
  defaultServerId = 1
})

local response = sonoran.cad:getIntegrationPanelActionsV2(
  "example.fire-alarms",
  { serverId = 1, after = 0, limit = 100 }
)

if response.success then
  for _, event in ipairs(response.data.events) do
    print(event.actionId, event.id)
  end
end

Use this tab from the server side of a FiveM resource. Never expose the API key to client scripts.

Sonoran.lua and Sonoran.js use the configured client exported by sonorancad. Sonoran.Net must read the CAD convars and create a client. Grant the resource access to the protected key with add_convar_permission your-resource-name read sonoran_apiKey.

Sonoran.lua

local cad = exports["sonorancad"]:getCadClient()
local response = cad:getIntegrationPanelActionsV2(
  "example.fire-alarms",
  { after = 0, limit = 100 }
)

Sonoran.js

(async () => {
  const cad = exports["sonorancad"].getCadClient();
  const response = await cad.getIntegrationPanelActionsV2(
    'example.fire-alarms',
    { after: 0, limit: 100 }
  );
})();

Sonoran.Net

using CitizenFX.Core.Native;
using Sonoran;

var communityId = API.GetConvar("sonoran_communityID", "");
var apiKey = API.GetConvar("sonoran_apiKey", "");
var serverId = int.TryParse(API.GetConvar("sonoran_serverId", "1"), out var parsed) ? parsed : 1;

using var sonoran = new SonoranClient(new SonoranClientOptions
{
    product = SonoranProduct.CAD,
    communityId = communityId,
    apiKey = apiKey,
    defaultServerId = serverId
});

var response = await sonoran.Cad.getIntegrationPanelActionsV2(
    "example.fire-alarms",
    new GetIntegrationPanelActionsV2Query { After = 0, Limit = 100 }
);

Import this YAML into Postman with Import -> Raw text.

Response

Last updated

Was this helpful?