A presence is emitted by CloudConnect and sent via the notification service every time a device connects, reconnects or is disconnected.
id
~ Required integer - 64 bits unique track identifier.
id_str
~ Required string - String version of the identifier (for languages not supporting 64 bits integers).
connection_id
~ Required integer - 64 bits unique connection identifier (see Notification for more details).
connection_id_str
~ Required string - String version of the connection identifier (for languages not supporting 64 bits integers).
type
~ Required string - connect | disconnect|failed_connect.
~ disconnect : presence sent when the server closes the communication socket with the device (see a list)
~ connect : presence sent when the device connects or reconnects to server (see a list)
~ failed_connect : presence sent when the device can't connect to the server. In this case, asset is unknown and will be set to null.
~ declare_asset : presence sent when the asset is declared for the first time on the platform
reason
~ Required string - Reason given by the server or the device for the [re|dis]connection.
asset
~ Required string - IMEI of the device. Note: can be null (see failed_connect).
time
~ Required string - When the event was created by the CloudConnect (timestamp in RFC 3339 format: YYYY-MM-DDTHH:MM:SS+AA:BB).
When a device connects to the server, it gives the reason for its connection (usually why it was disconnected from the server from its point of view).
Note that it is from the device's point of view.
warning This list is not exhaustive, so make sure your application can handle other reasons.
When a the server closes the communication socket with the device, it gives its reason for closing the socket.
warning This list is not exhaustive, so make sure your application can handle other reasons.
{
"id":461799503595297635,
"id_str":"461799503595297635",
"connection_id":461799503595298293,
"connection_id_str":"461799503595298293",
"type":"disconnect",
"reason":"socket_closed",
"asset":"357322041802978",
"time":"2013-06-28T09:46:21+02:00"
}
This example presence has the following properties:
357322041802978.