Skip to main content

API

This page documents the HTTP endpoints for SA.

info

The API requires Station Alert, and does not work for Sonoran Edition. For more info, see here.

How to Use

The endpoints documented below are made available directly from the resource. To access the API, you first need to know the IP address or domain, and port of the server. With this information, you can append /inferno-station-alert/ and then the endpoint name.

For example, if your domain is my-server.com, the port is 30120, and you wanted the alert endpoint, you would access http://my-server.com:30120/inferno-station-alert/alert.

Every request requires an Authorization header containing the ic_sa_access_token. If ic_sa_access_token is not set, then a 404 - Not Found will be returned, and an error will be logged to the console. If ic_sa_access_token does not match the token provided in the Authorization header, then a 401 - Unauthorized will be returned.

If ic_sa_whitelisted_ips contains any valid IP addresses, then any requests sent from IP address not contained within ic_sa_whitelisted_ips will be rejected with 401 - Unauthorized, and an error will be logged to the console.

Valid HTTP requests are logged to the console when Debug Mode is enabled.

Alerts

Create A New Alert

Use this endpoint to create a new Alert.

Endpoint

POST alert

Body

  • locations - object
    • Must be an object that contains the names of locations, and optionally a list of door names to open.
      • To open all doors, pass an empty array.
    • Example:
      {
      "locations": {
      "Station One": ["Bay Two", "Bay Three"],
      "Station Two": [],
      "Station Three": ["Bay One", "Bay Two"]
      },
      }
  • message - string|undefined
    • Optional message to be read out via Text-to-Speech.
      • Requires Voice Turnout Addon, see here for details.
  • tone - string|undefined
    • Optional tone to play.
    • If not provided, default tone will be used.
  • unitcolors - string[]|undefined
    • Optional list of Unit Indicator colors to show in-game.
      • Options are: red, green, and/or blue.
    • If not provided, no colors will show.

Example Request

{
"message": "Ladder 7, Rescue 7. Carson Avenue intersection of Davis Avenue, Strawberry, Los Santos. Vehicle Accident, possible persons trapped. Postal 0 9 0.",
"locations": {
"Davis": ["Bay Two", "Bay Three"]
}
}

Return Value

No return body, headers only


Locations

Get All Locations

Use this endpoint to get all locations

Endpoint

GET locations

Return Value

Get Location By Name

Use this endpoint to get a specific location by name

Endpoint

GET location/{name}

Return Value