location.batch
The location.batch command is used to publish batch location data.
Publishes are executed sequentially. If any of the individual data publishes fail with an error, the error will be immediately returned and sequential publishing terminates without completion.
TR50 Request
{
"cmd": {
"command": "location.batch",
"params": {
"thingKey": "mything",
"ts": "2015-12-06T02:03:04.322Z",
"corrId": "mycorrid",
"data": [
{
"ts": "2015-12-06T02:03:04.322Z",
"corrId": "mycorrid",
"lat": 7.1234,
"lng": 9.6789,
"heading": 124.1234,
"altitude": 3.3,
"speed": 48.9,
"fixAcc": 2
},
{
"ts": "2015-12-06T02:04:04.322Z",
"corrId": "mycorrid",
"lat": 3.1234,
"lng": 4.6789,
"heading": 124.1234,
"altitude": 3.3,
"speed": 48.9,
"fixAcc": 2
}
]
}
}
}
Request Parameters
Name |
Type |
Required |
Description |
---|---|---|---|
|
Thing Identifier Parameters |
|
An optional identifier to specify the thing to which the location data is to be associated. If omitted, the thing associated with your session will be used. See Thing Identifier Parameters table below for supported parameters. |
ts |
String |
|
Timestamp to use for all data records that do not specify a "ts" parameter. |
corrid |
String |
|
Correlation ID to use for all data records that do not specify a "corrId" parameter. |
data |
Array |
|
Array of publish objects. |
Thing Identifier Parameters
Name |
Type |
Description |
---|---|---|
thingKey |
String |
Key of the thing |
thingId |
String |
Id 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 |
Request Publish Object
Name |
Type |
Required |
Description |
---|---|---|---|
ts |
String |
|
The timestamp at which the value was recorded. Defaults to the top level "ts" parameter, if not specified, then the current timestamp will be used. |
corrId |
String |
|
A correlation ID that can be used when querying to find related data objects. |
lat |
Float64 |
|
The latitude for this location publish. |
lng |
Float64 |
|
The longitude for this location publish. |
heading |
Float64 |
|
The direction for this location publish. |
altitude |
Float64 |
|
The altitude for this location publish. |
speed |
Float64 |
|
The speed for this location publish. |
fixAcc |
Float64 |
|
The accuracy in meters of the coordinates being published. |
fixType |
String |
|
A string describing the location fixation type. Typically "gps", "gnss", "manual", or "m2m-locate". |
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
}
}