API Call Sequence
This guide describes how to use the ThinQ Connect API through the call sequence.
Get Device Status
This section describes how to get the user's device status.
APIs to Be Used
Sequence
- Your service must use the
GET/devices
to get the list of user's devices registered on LG ThinQ Platform. You only need to do this once, and you do not have to do it every time. - Check the
device-id
value of the target device whose status is to be checked in the device list, and use this value to call the method,GET/devices/{device-id}
, to get the device status. - In the response, the status data of the device is returned.
Control Device
This section describes how to control a user's device.
APIs to Be Used
Sequence
- Your service must use the
GET/devices
to get the list of user's devices registered on LG ThinQ Platform. You only need to do this once, and you do not have to do it every time. - Check the
device-id
value of the target device whose status is to be controlled in the device list, and use this value to callGET/devices/profile/{device-id}
. - It generates a control command for the device based on the device profile information received in API call response. The control command finds the attribute to be controlled in the device profile and expresses it as a name-and-value pair.
- With the
device-id
and the control command, call thePOST/devices/{device-id
. - In the response, the result of device control is returned.
Subscribe to Events from Device
To use the Event API, you should consult with the LG Electronics representative in advance.
This section describes how to subscribe to the event messages from the device. The event message occurs when the device status is changed, and includes the device status data after it changes. Refer to Event API > Event Messages for details.
APIs to Be Used
Sequence
- Your service must use the
GET/devices
to get the list of user's devices registered on LG ThinQ Platform. You only need to do this once, and you do not have to do it every time. - Check the
device-id
for the device to subscribe to the event from the device list, and use this value to call thePOST/event/{device-id}
. - In response, the result of event subscription (success/failure) is returned.
- Receives the event message when the device has changed.
Subscribe to Push Messages from Device
This section describes how to subscribe and forward a push notification to a user when it occurs.
APIs to Be Used
Sequence
- Your service must use the
GET/devices
to get the list of user's devices registered on LG ThinQ Platform. You only need to do this once, and you do not have to do it every time. - Check the
device-id
value of the target device from which push notifications are received in the device list, and use this value to callPOST/push/{device-id}
. - In response, the result of push notification subscription (success/failure) is returned.
- Notifies the user when a push notification occurs on the device.
Push notifications include the messages sent by the device to the user, such as "washing completed" or "filter replacement. The type of these messages is
DEVICE_PUSH
which is defined in Common Data Type > Push Type . Available messages for each type of appliance are defined in Device Profile > Notification.