API specification
Version 6.0
This document details all the functions for integrating with Street Manager via the latest version of the API. See the ‘Versions and Changes’ section for more details on previous versions. The documentation for the stable version of the API is available here.
Event API Resource Guide
Pagination
The polling endpoint on the Event API is driven by cursor-based pagination. This can be controlled by the update_id query param.
{ "rows": [...], "next_update": 1234 }
A next_update property is returned which indicates the ID of the next item that is available to be returned. If there are no more results available to returned, then null is returned.
100 results will be returned by default. A maximum of 250 results can be requested by supplying the required page size in the page_size field.
Polling
Retrieves a list of works which have had changes within a defined time period. This allows external integrators to provide a start and end date to poll Street Manager for changes and use the results to retrieve further information from the Works or Reporting API.
In order to retrieve all updates since last usage, the start date could be set to the last date and time the user called the endpoint. Alternatively the user could provide the event date returned in the last entry of a previous result set.
The list of updates can be refined by populating the optional update_id field. When this is populated, only results with update ids above the given id will be returned. As an alternative to providing a defined time period, update_id can be populated without providing a start and end date.
By default 100 results will be returned per request, a maximum of 250 results can be requested by supplying the required page size in the page_size field. If additional results exist the next_update property will be populated with the update_id of the next result allowing for further queries on the remaining results.
Updates for a particular user can be excluded by populating the optional exclude_events_from field with their username.
Contractors are required to provide optional swa_code parameter in order to state which promoter they are working on behalf of.
Polling-search
Retrieves further information for the works provided in the request. This allows external integrators to retrieve additional information for the works returned by the GET /works/updates endpoint.
API Notifications
POST /api-notifications/subscribe
This endpoint will allow users to create a subscription to be notified about events regarding their organisation. Supply your endpoint as an authenticated user in the organisation you want to subscribe to. Subscriptions are limited to one per organisation. Contractors will be subscribed to all the organisations that they are contracting for. Make sure to confirm the endpoint for notifications within 48 hours and do not unsubscribe unless you have confirmed a subscription. If you do not confirm, you will get stuck receiving notifications and will be unable to change/update your subscription.
POST /api-notifications/unsubscribe
This endpoint will allow users to remove a subscription to no longer be notified about events regarding their organisation. Contractors will be unsubscribed from all the organisations that they were contracting for.