Devices
Get Devices
Gets the available device list about a specific user or resource registered to DR service.
Endpoint
GET {{baseUrl}}/devices/{user-id} or {resource-id}
Request
Path Parameter
Enters the user-id
or resource-id
to check.
Name |
Type |
Required |
Description |
---|---|---|---|
user-id or resource-id |
string |
mandatory |
user-id: The user identification value, which is the user ID registered in LG EMP service. You can get this value using the Get Profile API provided by the LG EMP service. resource-id: The uniquely identifiable resource ID, which is registered to LG DR service. You can get this value using the Get Resource API. |
Request Header
You should enter the following information in the request header in JSON format.
Name |
Type |
Required |
Description |
---|---|---|---|
x-service-id |
string |
mandatory |
The Service ID value which used to identify the owner of the request |
x-service-token |
string |
mandatory |
The Service Token value to ensure that the request is valid. It is issued before service integration. |
x-message-id |
string |
optional |
The value for tracing the processing of target requests |
x-country-code |
string |
mandatory |
The country code to provide the service. The ISO country code is used. (E.g. KR, US, TW, CN, ......) |
Request Body
N/A
Request Example
$ curl '{{baseUrl}}/devices/{user-id}' -i -X GET -H 'Accept: application/json' -H 'x-message-id: message-id' -H 'x-service-id: 3rd-party-service-id' -H 'x-service-token: 3rd-party-service-token' -H 'x-country-code: us'
Response
Response Body
In response to the request, the following information is returned in the JSON format in the response body.
Key |
Value |
||
---|---|---|---|
code |
Result code for the request For a description of the code values, please refer to the Common Response page. |
||
data |
Result data corresponding to the result code |
||
id |
The device ID This value can change when you delete the device on your LG ThinQ accounts and register again. |
||
mac |
The encrypted MAC address of the device (only available for Air Conditioners) |
||
resourceID |
The uniquely identifiable resource ID, which is registered to LG DR service. |
||
userID |
The user ID |
||
status |
The device status
|
||
deviceInfo |
The object containing device information |
||
|
|
alias |
The device alias name |
|
|
deviceType |
The device type |
|
|
modelName |
The model name |
Response Example
{ "code": 2000, "data": [ { "id": "kkkkkkkk-1234-11d3-80ae-044eaf8f70cc", "mac": "abcd1234", "resourceID":"CE-TV", "userID": "dr-test@dr.com", "status": 1, "deviceInfo": { "alias": "air conditioner", "deviceType": "DEVIE_AIR_CONDITIONER", "modelName": "PAC_910604_US" } }, { "id": "aaaaaaaa-1234-11d3-80ae-044eaf8f70cc", "mac": "bcdef2345", "resourceID":"CE-TV", "userID": "dr-test@dr.com", "status": 1, "deviceInfo": { "alias": "air conditioner", "deviceType": "DEVIE_AIR_CONDITIONER", "modelName": "PAC_910604_US" } } ] }
Check Devices
Checks the list of devices that supports DR service among the devices registered to the ThinQ platform (ThinQ App).
Endpoint
GET {{baseUrl}}/devices/check
Request
Path Parameter
N/A
Request Header
You should enter the following information in the request header in JSON format. With the common header, the accessToken
should be entered and delivered.
Name |
Type |
Required |
Description |
---|---|---|---|
x-service-id |
string |
mandatory |
The Service ID value which used to identify the owner of the request |
x-service-token |
string |
mandatory |
The Service Token value to ensure that the request is valid. It is issued before service integration. |
x-message-id |
string |
optional |
The value for tracing the processing of target requests |
x-country-code |
string |
mandatory |
The country code to provide the service. The ISO country code is used. (E.g. KR, US, TW, CN, ......) |
accessToken |
string |
mandatory |
The |
Request Body
N/A
Request Example
$ curl '{{baseUrl}}/devices/check' -i -X GET -H 'Accept: application/json' -H 'x-message-id: message-id' -H 'x-service-id: 3rd-party-service-id' -H 'x-service-token: 3rd-party-service-token' -H 'x-country-code: us' -H 'accessToken: 17489c4d8d558a014340……e033d7c580f8e8e9712' }'
Response
Response Body
In response to the request, the following information is returned in the JSON format in the response body.
Key |
Value |
||
---|---|---|---|
code |
Result code for the request For a description of the code values, please refer to the Common Response page. |
||
data |
Result data corresponding to the result code |
||
deviceId |
The device ID This value can change when you delete the device on your LG ThinQ accounts and register again. |
||
macAddress |
The encrypted MAC address of the device (only available for Air Conditioners) |
||
deviceInfo |
The JSON object containing device information |
||
|
|
alias |
The device alias name |
|
|
deviceType |
The device type |
|
|
modelName |
The model name |
Response Example
{ "code": 2000, "data": [ { "deviceId": "kkkkkkkk-1234-11d3-80ae-044eaf8f70cc", "macAddress": "044eaf8f70cc", "deviceInfo": { "alias": "air conditioner", "deviceType": "DEVICE_AIR_CONDITIONER", "modelName": "PAC_910604_US" } }, { "deviceId": "aaaaaaaa-1234-11d3-80ae-044eaf8f70bb", "macAddress": "044eaf8f70bb", "deviceInfo": { "alias": "air conditioner", "deviceType": "DEVICE_AIR_CONDITIONER", "modelName": "PAC_910604_US" } } ] }