conference lunch move company map contacts lindholmen lindholmen 2 travel info

You are here

REST API

Using the API with restful HTTP requests.

Calling the API

The base-URL is the same for all GET API requests: https://ece01.ericsson.net:4443/ecity

The GET request requires the following headers:

  • Authorization: Base <username:password> (must be converted to base64 without word wrapping and whitespaces (No_Wrap).)

The following parameters can be set on the URL query. Each parameter can only be used once per query.

dgw

The bus identification number (VIN). If this parameter is excluded, the values for every buses are returned.

sensorSpec

Which sensor's data to request. Can not be used together with resourceSpec. Refer to the documentation for information about sensors and resources.

resourceSpec

Every sensor has at least one resource. This parameter can not be used together with sensorSpec. Refer to the documentation for information about sensors and resources.

t1

The beginning of the requested time interval. Must be specified. The value should be in milliseconds from 1970-01-01, UTC (Time since epoch mulitplied with 1 000).

t2

The end of the requested time interval. Must be specified. The value should be in milliseconds from 1970-01-01, UTC (Time since epoch mulitplied with 1 000).

Example requests

?dgw=Ericsson$<vin>&t1=<tid>&t2=<tid2>
Data from all sensors on a specific bus.

?dgw=Ericsson$<vin>&sensorSpec=Ericsson$GPS&t1=<tid>&t2=<tid2>
GPS data for a specific bus.

?dgw=Ericsson$<vin>&resourceSpec=Ericsson$Latitude_Value&t1=<tid>&t2=<tid2>
The latitude for a specific bus.

?sensorSpec=Ericsson$GPS&t1=<tid>&t2=<tid2>
GPS data from all buses.

?resourceSpec=Ericsson_Value$Speed&t1=<tid>&t2=<tid2>
Velocity data from all buses.

Response format

The server responds with a JSON-array of JSON-objects containing the following key/value pairs:

  • gatewayId -the bus' VIN (without the Ericsson$ prefix)
  • resourceSpec -the name of the resource (without the Ericsson$ prefix)
  • value -the corresponding value
  • timestamp -in milliseconds from 1970-01-01, UTC (Time since epoch mulitplied with 1 000)

Please note that every JSON-object corresponds to a single resource. If the query was made on a sensor or on a gateway, then every resource associated with the sensor/gateway will be returned.

Example response:

[{"resourceSpec":"Authenticated_Users_Value","timestamp":"1442391279000","value":"5","gatewayId":"Vin_Num_001"}]

Here's a more complete example.