Sample Payloads
Test Cases
The following test cases provide example payloads from RapidSOS data partners. CAD integrations should test each of these examples to ensure that your application can appropriately handle each of these alert types. Please review the Alerts Approval Checklist for more information on what is expected to receive alerts.
Active Assailant
- Active Assailant alerts help ECCs immediately respond to active assailant events in educational or commercial settings when a silent panic button is activated
- A phone call from the monitoring company will be received concurrently and without a 30 second delay.
- When multiple signals are received from the same campus, your workflow should aggregate additional signals into the same Alert for 30 minutes.
- You may want to consider adding additional noticeability in your UI when receiving the ACTIVE_ASSAILANT emergency_type
import requests
import random
import time
url = "https://api-sandbox.rapidsos.com/oauth/token"
payload = {
"client_id": "CLIENT_ID",
"client_secret": "CLIENT_SECRET",
"grant_type": "client_credentials"
}
response = requests.post(url, data=payload)
data = response.json()
access_token = data['access_token']
url = "https://api-sandbox.rapidsos.com/v1/alerts"
headers = {
"Authorization": "Bearer {access_token}".format(access_token=access_token)
}
t = (time.time() * 1000)
payload = {
"callflow": "alert_create_ss",
"blocking": True,
"variables": {
"site_phone": "+15555555555",
"emergency_contacts": [{ "name": "Maria Brody", "phone": "+15554443322", "relationship": "Superintendent", "language": "English"}],
"alarm_description": "Active Shooter at large",
"zone_description": "Classroom 201",
"event": {
"location": {
"civic": {
"name": "SANDBOX_SCHOOL_NAME",
"street_1": "SANDBOX_STREET_NAME,
"street_2": "",
"city": "SANDBOX_CITY",
"state": "SANDBOX_STATE",
"country": "US",
"zip_code": "SANDBOX_ZIP"
}
},
"source_id": "AAA124",
"service_provider_name": "CompanyABC Panic Button",
"incident_time": t,
"emergency_type": "ACTIVE_ASSAILANT",
"site_type": "COMMERCIAL",
"description": "Active Shooter at large"
},
"incident_time_adr": t,
"alarm_permit_number": "93548"
}
}
response = requests.post(url, headers=headers, json=payload)
print(response.text)
print(response)Commercial Security
import requests
import random
import time
url = "https://api-sandbox.rapidsos.com/oauth/token"
payload = {
"client_id": "CLIENT_ID",
"client_secret": "CLIENT_SECRET",
"grant_type": "client_credentials"
}
response = requests.post(url, data=payload)
data = response.json()
access_token = data["access_token"]
url = "https://api-sandbox.rapidsos.com/v1/alerts"
headers = {
"Authorization": "Bearer {access_token}".format(access_token=access_token)
}
t = round((time.time() * 1000))
payload = {
"callflow": "CompanyABC_alerts",
"variables": {
"permit_number": "93547",
"service_provider": "CompanyABC",
"central_station_phone": "+18008773624",
"alarm_description": "FIRE ALARM",
"zone_description": "Front Entrance - Pull Station",
"flow_data": {
},
"premise_phone": "+17737770707",
"buildings": {
"id": "123456",
"name": "SYSTEMS MONITORING, INTERNATIONAL",
"siteId": "1",
"address": {
"zip": "28277-0000",
"city": "Charlotte",
"state": "NC",
"country": "USA",
"address1": "6829 FISHERS FARM LN",
"address2": ""
},
"permitNumber": "",
"contactNumber": "+17737770707"
},
"flow_data": {
"id": "123456:10041:12345620230408043621",
"format": "CLSS.contactID",
"properties": {
"dnis": "0192",
"account": "3456",
"groupId": "01",
"message": "FIRE ALARM",
"pointId": "999",
"eventCode": "1110"
},
"createdTime": t,
"transmitterId": "",
"transmitterType": "",
"detectedInBuilding": "123456",
"transmissionStatus": {
"status": "ReceivedInCMS",
"timestamp": t
},
"detectedByEquipment": "999"
},
"event": {
"location": {
"civic": {
"name": "SANDBOX_NAME",
"street_1": "SANDBOX_STREET_1",
"street_2": "",
"city": "SANDBOX_CITY",
"state": "SANDBOX_STATE",
"country": "US",
"zip_code": "SANDBOX_ZIP"
}
},
"source_id": "Testsignal123",
"service_provider_name": "CompanyABC",
"incident_time": t,
"emergency_type": "FIRE",
"site_type": "COMMERCIAL",
"description": "1110"
}
}
}
response = requests.post(url, headers=headers, json=payload)
print(response.text)mPERS & Mobile Alerts
import requests
import random
import time
url = "https://api-sandbox.rapidsos.com/oauth/token"
payload = {
"client_id": "CLIENT_ID",
"client_secret": "CLIENT_SECRET",
"grant_type": "client_credentials"
}
response = requests.post(url, data=payload)
data = response.json()
access_token = data['access_token']
url = "https://api-sandbox.rapidsos.com/v1/alerts"
headers = {
"Authorization": "Bearer {access_token}".format(access_token=access_token)
}
t = (time.time() * 1000)
payload = {
"callflow": "alert_create_location_update",
"variables": {
"alarm_description": "CompanyABC SMS Live Agent Chat",
"authorized_entity": "noc_csp",
"updated_location": {
"latitude": random.uniform(SANDBOX_LAT_1, SANDBOX_LAT_2),
"longitude": random.uniform(SANDBOX_LONG_1, SANDBOX_LONG_2),
"uncertainty": "10"
},
"user": {
"full_name": "Matt Faircloth",
"phone_number": "+17574443333"
},
"vehicle": {
"make": "Acura",
"model": "MDX",
"color": "Silver",
"plate_number": "CJR869",
"plate_state": "NV"
},
"alert_profile": {
"service_provider_name": "CompanyABC Panic Alert",
"emergency_type": "OTHER",
"site_type": "PERSONAL",
"description": "Grubhub Anxious Moment SMS Live Agent Chat"
},
"event": {
"location": {
"geodetic": {
"latitude": random.uniform(SANDBOX_LAT_1, SANDBOX_LAT_2),
"longitude": random.uniform(SANDBOX_LONG_1, SANDBOX_LONG_2),
"uncertainty": "10"
}
},
"source_id": "17577144161",
"service_provider_name": "CompanyABC Panic Alert",
"incident_time": t,
"emergency_type": "OTHER",
"site_type": "PERSONAL",
"description": "CompanyABC SMS Live Agent Chat"
}
}
}
response = requests.post(url, headers=headers, json=payload)
print(response.text)Home Security
import requests
import random
import time
url = "https://api-sandbox.rapidsos.com/oauth/token"
payload = {
"client_id": "CLIENT_ID",
"client_secret": "CLIENT_SECRET",
"grant_type": "client_credentials"
}
response = requests.post(url, data=payload)
data = response.json()
access_token = data['access_token']
url = "https://api-sandbox.rapidsos.com/v1/alerts"
headers = {
"Authorization": "Bearer {access_token}".format(access_token=access_token)
}
names = ["John", "Mary", "Sammy", "Charles"]
gender = ["Male", "Female", "Other", "Rather Not Say"]
source_id = ["abc123", "def456", "ghi789"]
emergency_contacts = [{ "name": "Donna", "phone": "+15554443322", "relationship": "Mother", "language": "English"},
{ "name": "Eric", "phone": "+18938887777", "relationship": "Father", "language": "English"},
{ "name": "Samantha", "phone": "+12223334444", "relationship": "Wife", "language": "Spanish"},
{ "name": "Cameron", "phone": "+15554443322", "relationship": "Husband", "language": "French"}]
emergency_contacts2 = [{ "name": "Donna", "phone": "+15554443322", "relationship": "Mother", "language": "English"},
{ "name": "Eric", "phone": "+18938887777", "relationship": "Father", "language": "English"},
{ "name": "Samantha", "phone": "+12223334444", "relationship": "Wife", "language": "Spanish"},
{ "name": "Cameron", "phone": "+15554443322", "relationship": "Husband", "language": "French"}]
t = (time.time() * 1000)
payload = {
"callflow": "alert_create_ss",
"blocking": True,
"variables": {
"site_phone": "+15555555555",
"emergency_contacts": [ random.choice(emergency_contacts), random.choice(emergency_contacts2)],
"alarm_description": "Glass break detected",
"zone_description": "Back door",
"instructions": "",
"cross_street": "",
"event": {
"location": {
"geodetic": {
"latitude": random.uniform(SANDBOX_LAT_1, SANDBOX_LAT_2),
"longitude": random.uniform(SANDBOX_LONG_1, SANDBOX_LONG_2),
"uncertainty": "10"
}
},
"source_id": random.choice(source_id),
"service_provider_name": "CompanyABC",
"incident_time": t,
"emergency_type": "BURGLARY",
"site_type": "RESIDENTIAL",
"description": "test2"
},
"incident_time_adr": t,
"visually_verified": "",
"alarm_permit_number": "345734",
"lockbox_code":" ",
"gate_code":" ",
"hidden_key":" ",
"access":" ",
"is_audible":"Silent",
"vial_of_life":" ",
"account_owner":"Doe, John"
}
}
response = requests.post(url, headers=headers, json=payload)
print(response.text)Test Mode
import requests
import random
import time
url = "https://api-sandbox.rapidsos.com/oauth/token"
payload = {
"client_id": "CLIENT_ID",
"client_secret": "CLIENT_SECRET",
"grant_type": "client_credentials"
}
response = requests.post(url, data=payload)
data = response.json()
access_token = data['access_token']
url = "https://api-sandbox.rapidsos.com/v1/alerts"
headers = {
"Authorization": "Bearer {access_token}".format(access_token=access_token)
}
# An ecc_id is needed for each individual agency that needs to be tested
t = (time.time() * 1000)
# The flow will automatically dispatch the alert
payload = {
"callflow": "alert_train_create_ss",
"blocking": true,
"test_mode": true,
"variables": {
"authorized_entity": "noc_csp",
"internalTest": false,
"ecc_id": "1190",
"Train": {
"trainID": "1234"
},
"emergencyType": "TEST_TRAIN_DERAILMENT"
}
}
response = requests.post(url, headers=headers, json=payload)
print(response.text)
print(response)