payload element

Type: edcPayload
Namespace: http://eurotech.com/edc/2.0
XML Schema: edc.xsd

EdcPayload defines the recommended payload structure for the messages sent to the Everyware Cloud platform. Eurotech designed the format as an open format that is flexible from the aspect of data modeling yet is efficient when it comes to bandwidth conservation. The same payload model is used by the REST API - in which case it is serialized into XML or JSON as requested by the client - or uses the efficient Google ProtoBuf when sent over an MQTT connection when the bandwidth is very important. The EdcPayload contains the following fields: sentOn timestamp, an optional set of metrics represented as name-value pairs, an optional position field to capture a GPS position, and an optional binary body.

Example XML

<?xml version="1.0" encoding="UTF-8"?> <payload xmlns="http://eurotech.com/edc/2.0"> <sentOn>...</sentOn> <position> <longitude>...</longitude> <latitude>...</latitude> <altitude>...</altitude> <precision>...</precision> <heading>...</heading> <speed>...</speed> <timestamp>...</timestamp> <satellites>...</satellites> <status>...</status> </position> <metrics> <metric> <name>...</name> <type>...</type> <value>...</value> </metric> <metric> <!--...--> </metric> <!--...more "metric" elements...--> </metrics> <body>...</body> </payload>

Example JSON

{ "sentOn" : "...", "position" : { "longitude" : ..., "latitude" : ..., "altitude" : ..., "precision" : ..., "heading" : ..., "speed" : ..., "timestamp" : "...", "satellites" : ..., "status" : ... }, "metrics" : { "metric" : [ { "name" : "...", "type" : "...", "value" : "..." }, ... ] }, "body" : "..." }