API: News
« Back to the API Documentation overview - authentication, security, response codes, and the full endpoint list.
Published news stories with their photos, attachments, and videos.
| HTTP Request Type | GET |
| Calling URI | https://www.YourDepartment.com/apps/api/news/ |
| Request Header | Authorization: Bearer {access_token} |
| Success Codes | 200 OK |
| Failure Codes | 400, 401, 403, 404, 405, 429, 500 - see the error reference |
Parameters
| Parameter | Description |
ID |
Optional. A single story ID. |
CategoryID |
Optional. Limit to one category (NewsType_ID). |
StartDate / EndDate |
Optional. Filter by story date (yyyy-mm-dd). |
All data endpoints also accept the common MaxRows
(default 100, maximum 500) and StartRow paging parameters.
Response Properties
| Property | Description |
News_ID / News_Headline |
Story ID and headline |
News_Date |
Story date/time (string) |
News_Author |
Byline (string) |
News_Text |
Story body, may contain HTML (string) |
News_Address / News_Units / News_MutualAid |
Incident details (string) |
News_Featured |
1 = featured story (number) |
NewsType_ID / Category |
Category ID and name |
News_CreatedDate / News_ModifiedDate |
Posted and last modified date/time (string) |
CreatedBy / ModifiedBy |
Posting and modifying member names; ModifiedBy is empty if never modified (string) |
Links |
Array of {text, url} related links |
Images |
Array of {Image_ID, URL, Caption, Width, Height, FileSize, Front}; Front = 1 marks the story's front image |
Attachments |
Array of {Attach_ID, FileName, URL, Extension, FileSize, PostedDate} |
Videos |
Array of {Video_ID, Video_Code, PostedDate}; Video_Code is the YouTube embed code |
Records are returned in the items array of the
standard response envelope.
Sample Code
Exchange your refresh token for an access token, then request data. The same two steps
work in any language; JavaScript and Python are shown here.
JavaScript
const BASE = "https://www.YourDepartment.com/apps/api";
const REFRESH_TOKEN = "your-refresh-token-here";
// 1. Exchange the refresh token for an access token (do this from a server,
// not from a public web page, so the refresh token stays secret)
const tokenRes = await fetch(`${BASE}/refresh/`, {
method: "POST",
headers: { "Authorization": `Bearer ${REFRESH_TOKEN}` }
});
const tokenData = await tokenRes.json();
// 2. Call the news endpoint (reuse the token for up to 24 hours)
const res = await fetch(`${BASE}/news/?MaxRows=10`, {
headers: { "Authorization": `Bearer ${tokenData.access_token}` }
});
const data = await res.json();
data.items.forEach(item => console.log(item));
Python
import requests
BASE = "https://www.YourDepartment.com/apps/api"
REFRESH_TOKEN = "your-refresh-token-here"
# 1. Exchange the refresh token for an access token
token = requests.post(f"{BASE}/refresh/",
headers={"Authorization": f"Bearer {REFRESH_TOKEN}"}).json()
# 2. Call the news endpoint (reuse the token for up to 24 hours)
data = requests.get(f"{BASE}/news/",
params={"MaxRows": 10},
headers={"Authorization": f"Bearer {token['access_token']}"}).json()
for item in data["items"]:
print(item)
|