location.publish
The location.publish command is used to publish the location of a Thing in Device Cloud.
TR50 Request
{
"cmd": {
"command": "location.publish",
"params": {
"thingKey": "myThing",
"lat": 26.394056,
"lng": -80.11554,
"heading": 90,
"altitude": 100,
"speed": 45,
"fixAcc": 8,
"fixType": "gps",
"ts": "2014-04-05T02:03:04.322Z",
"corrId": "mycorrid",
"streetNumber": "1600",
"street": "Pennsylvania Ave NW",
"city": "Washington ",
"state": "DC",
"zipCode": "20500",
"country": "US"
}
}
}
Although the address can be specified, it is not the authoritative value. It is only used for display purposes. The latitude and longitude will be reverse geolocated for the address, and any address information provided will take precedence in the displayed address.
Request Parameters
Name |
Type |
Required |
Description |
---|---|---|---|
thingKey |
Thing Identifier Parameters |
|
The unique identifier of the thing to which the location data is to be associated. If omitted, defaults to the thing associated with your session. See Thing Identifier Parameters table below for supported parameters. |
lat |
Float |
Yes |
The latitude for this location publish. |
lng |
Float |
Yes |
The longitude for this location publish. |
heading |
Integer |
|
The direction for this location publish. |
altitude |
Integer |
|
The altitude for this location publish. |
speed |
Integer |
|
The speed of this location publish. |
fixAcc |
Integer |
|
The accuracy in meters of the coordinates being published. |
fixType |
String |
|
A string describing the location fixation type. Typical
values are the following:
|
ts |
Timestamp |
|
The timestamp for which the location data is being published. |
corrId |
String |
|
A correlation ID that can be used when querying to find related data objects. |
debounce |
Integer |
|
The debounce value is a number (in meters) used to determine if the location publish should be suppressed to avoid drifting in a small area due to inaccuracies in the location provider. The default value is 50 meters if this is not specified, indicating that if the location published is less than 50 meters from the previous location, then it will be ignored. Set to 0 to disable debouncing. |
streetNumber |
String |
|
The number of the building on the street. This field can be left empty and the value pre-pended in the street field. |
street |
String |
|
The street portion of the address. |
city |
String |
|
The city portion of the address. |
state |
String |
|
The state or province (full name or code) of the address. |
zipCode |
String |
|
The zip code (or postal code) of the address. |
country |
String |
|
The country (or country code) of the address. |
Thing Identifier Parameters
Name |
Type |
Description |
---|---|---|
thingKey |
String |
Key of the thing |
esn |
String |
Esn of the thing |
iccid |
String |
Iccid of the thing |
imei |
String |
Imei of the thing |
imsi |
String |
Imsi of the thing |
meid |
String |
Meid of the thing |
msisdn |
String |
Msisdn of the thing |
TR50 Response
If the command is sent successfully a success message is returned. Otherwise, an error and error message will be returned.
{
"cmd": {
"success": true
}
}