API
This page documents the HTTP endpoints for Pager Reborn.
The API requires Pager Reborn, 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-pager-reborn/ and then the endpoint name.
For example, if your domain is my-server.com, the port is 30120, and you wanted the page endpoint, you would access http://my-server.com:30120/inferno-pager-reborn/page.
Every request requires an Authorization header containing the ic_pr_httpAccessToken. If ic_pr_httpAccessToken is not set, then a 404 - Not Found will be returned, and an error will be logged to the console. If ic_pr_httpAccessToken does not match the token provided in the Authorization header, then a 401 - Unauthorized will be returned.
If ic_pr_whitelistedIps contains any valid IP addresses, then any requests sent from an IP address not contained within ic_pr_whitelistedIps 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.
Pages
Create a New Page
Use this endpoint to create a new page.
Endpoint
POST /page
Body
addresses-string[]- List of capcodes/addresses.
players-number[]- List of target player server IDs.
nature-string | number- Page nature value.
- Accepts lowercase names (
emergency,nonemergency,administrative) or enum values (0-2).
body-string- Page message body text.
Example Request
{
"addresses": ["emg.fire.bc", "emg.ems.bc"],
"players": [1, 2, 3],
"nature": "administrative",
"body": "Training drill at Station 1."
}
Return Value
202 - Accepted- No return body, headers only.
400 - Bad RequestRequest contains an invalid natureRequest body cannot be emptyMalformed body.
404 - Not Found- Endpoint not found, or API access token is not configured.
- May return a message in the response body.
413 - Request Entity Too LargeRequest address count cannot exceed X addresses (request contained Y addresses)Request body cannot exceed X characters (body was Y characters)
416 - Requested Range Not SatisfiableRequest contains no recipients
Capcodes
Get All Capcodes
Use this endpoint to retrieve all capcodes/addresses and the players currently assigned to each one.
Endpoint
GET /get-all-capcodes
Body
No request body.
Example Response
{
"emg.fire.bc": [1, 2, 3],
"emg.ems.bc": [],
"emg.pd.main": [7]
}
Return Value
200 - OK- Returns a JSON object where each key is a capcode/address and each value is a list of player server IDs currently assigned to that capcode.
401 - Unauthorized- API access token does not match, or caller IP is not allowed by
ic_pr_whitelistedIps.
- API access token does not match, or caller IP is not allowed by
404 - Not Found- Endpoint not found, or API access token is not configured.
- May return a message in the response body.