API Endpoints

Learn more about our backend API endpoints!

API Base URLs

Production: https://api.sonoranradio.com

Development: https://radioapi.dev.sonoransoftware.com

Get Community Channels

POST /radio/get-community-channels/:id/:key

This endpoint gets all connected users in a community.

Headers

Name
Value

Content-Type

application/json

Body

Name
Type
Description

id

string

Community ID

key

string

Community API Key

Response

{
    "result": "ok",
    "groups": [
        {
            "id": 0,
            "name": "Default",
            "orderIndex": 0
        },
        {
            "id": 1,
            "name": "test",
            "orderIndex": 1
        }
    ],
    "channels": [
        {
            "id": 123,
            "groupId": 0,
            "displayName": "Patrol Ops",
            "recvFreqMajor": 40,
            "recvFreqMinor": 120,
            "xmitFreqMajor": 36,
            "xmitFreqMinor": 275,
            "repeatsXmit": true,
            "status": true,
            "orderIndex": 0,
            "talkoverProtection": false
        }
    ]
}

Get Connected Users

POST /radio/get-connected-users/:id/:key

This endpoint gets all connected users in a community.

Headers

Name
Value

Content-Type

application/json

Body

Name
Type
Description

id

string

Community ID

key

string

Community API Key

Response

{
    "result": "ok",
    "connectedUsers": [
        {
            "identity": "91de0ce8-c571-11e9-9714-5600023b2434",
            "metadata": "{\"sonrad\":true,\"state\":{\"freqRecv\":[40,120],\"freqXmit\":[36,275],\"freqScan\":[],\"sfxKeyUp\":null,\"sfxKeyDown\":null,\"spec\":1}}"
        }
    ]
}

Set Server IP

POST /radio/set-server-ip

This endpoint sets the IP address of a Sonoran Radio community, used for resource authentication.

Headers

Name
Value

Content-Type

application/json

Body

Name
Type
Description

id

string

Community ID

key

string

Community API Key

pushUrl

string

Push Event URL

Response

{
  "result": "ok"
}

Get Server Subscription from IP

GET /radio/check-server-subscription

This endpoint gets the subscription enumeration value of a Sonoran Radio community, based on the IP address it's called from. The IP address is set via the set server IP endpoint.

Headers

Name
Value

Content-Type

application/json

Response

{
  "result": "ok",
  "subscription": 0 // 0 = Free, 1 = Plus, 2 = Pro
}

Set In-Game Speaker Locations

POST /radio/set-server-speakers

Sends a list of in-game speaker locations that the tone board can select.

When played, the play_tone push event will be sent to your server's pushUrl.

Headers

Name
Value

Content-Type

application/json

Authorization

Bearer <token>

Body

Name
Type
Description

id

string

Community ID

key

string

Community API Key

locations

array of Locationobjects

In-Game Tone Locations

// Location Object Array Structure
[
  {
    "label": "Fire Station 123" // STRING: Label for in-game location
    "id": "STATION_123" // STRING: Unique ID for in-game location
  },
  {
    "label": "Police Station ABC" // STRING: Label for in-game location
    "id": "STATION_456" // STRING: Unique ID for in-game location
  }
]

Response

{
  "result": "ok"
}

Last updated