Start with either the /assets or /locations endpoints, then use this API to retrieve the WebSocket URL to subscribe to “pedestrian in, pedestrian out” events.
The websocket URL provides a link to near real-time data for pedestrians at the specified monitored location. You must use a WebSocket client to retrieve this data.
| METHOD | GET |
| URI | <production url>/v1/assets/{id}/live-events?event-types=SFIN, SFOUT |
| Sample Request URI | <production url>/v1/assets/1000000027/live-events?event-types=SFIN, SFOUT |
| Parameter | Description | Required? | Filter Values |
|---|---|---|---|
| id | GE identifier for the device. | Yes | Value such as 1000000027. |
| live-events | Specific to real-time data from websocket. | Yes | event-type |
| event-type | Filter for parking events. | Yes | Insert the following enumeration codes to identify vehicles entering and exiting parking spaces:
|
{
"url": "ws://intel-env.websocket-server-dev.run.aws-usw02-pr.ice.predix.io/consume?routing_key=26fb7ac1-036a-46e1-9716-5c047c13a89b",
"registered-events": "SFIN,SFOUT"
}
The Vehicle In, Vehicle Out API uses the WebSocket protocol for streaming data in the following endpoint format: ws://<streaming url>
The WebSocket protocol is used instead of HTTP because Pedestrian Data streams near real-time data.
For all streaming requests, use the token received from UAA in the Authorization section of the HTTP header in the following format:
Bearer <token from trusted issuer>URL: wss://ingestion_url
Headers:
Authorization: Bearer <token from trusted issuer>
Predix-Zone-Id: <Predix-Zone-Id>
Origin: http://<origin-hostname>/
Request Payload: {
"messageId": "<MessageID>",
"body":
[
{
"name":"<TagName>",
"datapoints":
[
[
<EpochInMs>,
<Measure>,
<Quality>
]
],
"attributes":
{
"<AttributeKey>":"<AttributeValue>",
"<AttributeKey2>":"<AttributeValue2>"
}
}
]
}
| Parameter | Data Type | Required? | Description |
|---|---|---|---|
| event-uid | String | A unique identifier established by a customer or external resource for the pedestrian event. | |
| timestamp | Number | Actual timestamp when event occurred. Timestamps are in EPOCH format. | |
| event-type | String | Identifies this type of event:
|
|
| device-uid | String | A unique identifier established by a customer or external resource for the device recording this event. | |
| location-uid | String | A unique identifier established by a customer or external resource for the monitored location for pedestrian entry and exit. | |
| properties | Map | Custom properties capture for this event-type instance. | |
| object-uid | String | A unique identifier established by a customer or external resource for the pedestrian that entered or departed the related location (such as crosswalk). | |
| coordinates | Array | GPS coordinates identifying the location. Four coordinates should be provided for each location-uid. | |
| measures | Array |
|
{
"event-uid": "f9094290-fdf1-4e47-b4db-9cb0bd0db0e5",
"timestamp": 1461017947527,
"event-type": "SFIN",
"device-uid": "1345-1212",
"location-uid": "1345-crosswalk",
"measures": [
{
"tag": "SFCNT",
"value": 8
}
]}