This document describes the Application Programming Interface (API) of the Snap Send Solve Integration service. By using this service, an authority can:
Retrieve a list of incident reports by given authority id, and;
Browse reports by pagination link (next, previous link in the JSON response).
This API service is only available to Enterprise accounts with integration function enabled. For more information on Snap Send Solve Enterprise, please contact us.
The Snap Send Solve web service URL is made up of two distinct sections and looks like the following:
https:///
where:
is report.snapsendsolve.com
is one of the services documented later in this document.
An example of the current URL for the dashboard call would resemble the following:
https://report.snapsendsolve.com/api/reports
Default page size (30)
Maximum page size (100)
Resource | Description |
---|---|
GET/api/reports | Gets a list of authority reports |
Returns a list of authority reports. The only mandatory parameter is the authority id. Once the authority id is provided, the service will return the latest 30 reports by default. The page size can be customised.
Name | Description |
---|---|
Authorization (mandatory) | The authentication credentials (API access token). Note: This parameter is mandatory for retrieving reports, otherwise it will return an error code (#SSS-005 Authentication Failed). |
GET /api/reports?authority_id=1
5.2.2 HTTP HEADER Parameters
OK 200
{
“_metadata”:{
“request”:”/api/reports?authority_id=1″,
“authority_id”:”1″,
“page_size”:30,
“pages”:{
“previous”:”/api/reports?authority_id=1&end_date=20000101″,
“next”:”/api/reports?authority_id=1&start_date=20001111″
}
},
“reports”: [
{
“ReportID”:100,
“Date”:”2000010100:08:00.0000000+00:00″,
“IncidentType”:”GeneralRequest”, “ReportAddress”:”FlinderStreetStation,FlindersStreet,Melbourne,3000, Victoria”, “Latitude”:37.818268, “Longtitude”:144.967134, “Notes”:”Thedesignofthestationisveryuniqueandveryinspiring,but thereisacrackontheside.”,
“Images”:”*”, “IncidentTypeId”:”I_23″,
“Reporter”: {
“Name”:”SteveJobs”,
“Phone”:”0400000000″,
“Email”:”steve@apple.com”,
“Address”:”Flagstaff”,
“Suburb”:”Melbourne”,
“Postcode”:”3000″
}
},
…
}
All times and dates used in the api requests and responses utilise UTC time.
The reports in the api response is ordered by report date. The latest report will be the first one when the below call is made:
“/api/reports?authority_id={authority_id}”
Two auto-generated URLs can be found in the “_metadata/pages” section in the JSON response. Sending those requests will retrieve the previous or next page of reports. Page size can also be defined by changing the ‘page_size’ parameter (this should be less than Maximum page size).
Authorities will be able to retrieve their unique authentication token by visiting: http://admin.snapsendsolve.com/authority/integration.
Code | HTTP Response Code | Message | Description |
---|---|---|---|
SSS-001 | 400 | Missing parameter | authority_id is not provided |
SSS-002 | 400 | Page size is too long | page_size provided is more than 100 |
SSS-003 | 400 | Request have wrong parameters format | The request have both start_date and end_date |
SSS-004 | 403 | Integration function is disabled | Integration function is not enabled for the current provided authority |
SSS-005 | 401 | Authentication failed | Authentication token is not valid |
SSS-006 | 400 | Page size is illegal | page_size provided is not a positive integer |