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 

  1. 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.
  2. 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.
  3. In the response, the status data of the device is returned. 

Sequence diagram of getting device status

 

Control Device 

This section describes how to control a user's device.

APIs to Be Used 

Sequence 

  1. 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.
  2. Check the device-id value of the target device whose status is to be controlled in the device list, and use this value to call GET/devices/profile/{device-id}
  3. 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. 
  4. With the device-id and the control command, call the POST/devices/{device-id.
  5. In the response, the result of device control is returned. 

Sequence diagram of controlling the device

 

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 

  1. 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.
  2. Check the device-id for the device to subscribe to the event from the device list, and use this value to call the POST/event/{device-id}.
  3. In response, the result of event subscription (success/failure) is returned.
  4. Receives the event message when the device has changed. 

Sequence diagram of subscribing to events from a device

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 

  1. 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.
  2. Check the device-id value of the target device from which push notifications are received in the device list, and use this value to call POST/push/{device-id}
  3. In response, the result of push notification subscription (success/failure) is returned.  
  4. 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

Sequence diagram of subscribing to the push messages of device