Skip to content

Query Latest Device Location Data

API Address:/v2/deviceshadow/r1/openapi/device/getlocation

Request Method:GET

Request Data Type:application/x-www-form-urlencoded

Response Data Type:*/*

API Description: Query latest device location data

Request Parameters:

Parameter NameParameter DescriptionRequest TypeRequiredData TypeSchema
deviceIdDevice ID, corresponds one-to-one with the productKey and deviceKey combination. If deviceId is provided, productKey and deviceKey combination is not needed. If you provide both deviceId and the productKey/deviceKey combination, deviceId takes precedencequeryfalseinteger(int64)
deviceKeyDevice Key. If deviceKey is provided, productKey must also be provided. The combination of productKey and deviceKey corresponds one-to-one with deviceId. If productKey and deviceKey combination is provided, deviceId is not needed. If you provide both deviceId and the productKey/deviceKey combination, deviceId takes precedencequeryfalsestring
languageLanguage: CN/EN (default: CN)queryfalsestring
productKeyProduct Key. If productKey is provided, deviceKey must also be provided. The combination of productKey and deviceKey corresponds one-to-one with deviceId. If productKey and deviceKey combination is provided, deviceId is not needed. If you provide both deviceId and the productKey/deviceKey combination, deviceId takes precedencequeryfalsestring

Response Status:

Status CodeDescriptionSchema
200OKActionResultOfQdLocationLatest
401Unauthorized
403Forbidden
404Not Found
50000Service exception
50005Parameter check error
50007The deviceID, productKey or deviceKey is empty
70000Hub service unavailable
70089You have limited permission to operate this project or product or device
70130Non-existent device
91001Token does not exist
91004Token incorrect
91005Doesn't have permission
91006User not in IP white list
91007Please enable API permission

Response Parameters:

Parameter NameParameter DescriptionTypeSchema
codeReturn codeobject
dataObjectQdLocationLatestQdLocationLatest
  accuracystring
  bdLatnumber(double)
  bdLngnumber(double)
  countinteger(int32)
  createTimestring(date-time)
  deviceIdinteger(int64)
  deviceKeystring
  deviceStatusinteger(int32)
  gcjLatnumber(double)
  gcjLngnumber(double)
  ggaStatusstring
  hdopstring
  heightstring
  idstring
  latstring
  latTypestring
  lngstring
  lngTypestring
  locTypestring
  locateRawstring
  locateStatusstring
  locateTimestring(date-time)
  locateTypestring
  productKeystring
  satellitesstring
  speedstring
  ticketstring
  wgsLatnumber(double)
  wgsLngnumber(double)
exp1string
msgPrompt messageobject
pageNumCurrent page numberobject
pageSizeItems per pageobject
pagesTotal pagesobject
totalTotal countobject

Response Example:

javascript
{
    "code": 200,
    "data": {
        "accuracy": "550",
            "bdLat": 31.826790506073646,
            "bdLng": 117.12844898451473,
            "count": 0,
            "createTime": "1749262714000",
            "deviceId": 0,
            "deviceKey": DK00001,
            "deviceStatus": 1,
            "gcjLat": 31.820436517272384,
            "gcjLng": 117.12202697843334,
            "ggaStatus": null,
            "hdop": null,
            "height": null,
            "id": "1623625145",
            "lat": "3149.3362",
            "latType": "N",
            "lng": "11706.9841",
            "lngType": "E",
            "locType": null,
            "locateRaw": "ABMBCiRMQlMsNDYwLDAwLDIxNzcxLDI1NDYyNjM4NywtODcsMCoxMTQ7JExCUyw0NjAsMDAsMjE3NzEsOTY3OTIzMjEsLTEzMSwwKjExMjskTEJTLDQ2MCwwMCwyMTc3MSw5Njc5MjMyMSwtMTMxLDAqMTEyOyRMQlMsNDYwLDAwLDIxNzcxLDk2NzkyMzIxLC0xMzEsMCoxMTI7JExCUyw0NjAsMDAsMjE3NzEsOTY3OTIzMjEsLTEzMSwwKjExMjskTEJTLDQ2MCwwMCwyMTc3MSw5Njc5MjMyMSwtMTMxLDAqMTEyOyRMQlMsNDYwLDAwLDIxNzcxLDk2NzkyMzIxLC0xMzEsMCoxMTI7",
            "locateStatus": "3",
            "locateTime": "1749262713572",
            "locateType": "LBS ",
            "productKey": "PK0001",
            "satellites": null,
            "speed": null,
            "ticket": "1380853431444766994",
            "wgsLat": 31.822269439697266,
            "wgsLng": 117.11640167236328
    },
    "msg": "",
        "pageNum": 1,
        "pageSize": 10,
        "pages": 1,
        "total": 1
}