Notification API

This API allows your service to subscribe to Push notifications from the device.

Basic Information

Base URL

Server Phase

URL Remark
QA (DEV)

https://{region}-qa-ext.lgthinq.com 

region

  • KIC : Asia
  • EIC : Europe
  • AIC : North/South America
OP

https://{region}-ext.lgthinq.com 

API List

Method Summary
GET /push

Gets a list of the user's devices from which the user is receiving Push notifications.

POST /push/{device-id}

Subscribed to Push notifications of the device.

DELETE /push/{device-id}

Unsubscribed to Push notifications of the device.

Get Device List under Subscribtion

GET /push

Description

This method allows your service to get a list of the user's devices from which the user receives Push notifications.

GET {Base_URL}/push

If this method is successfully called, it returns the user's device list subscribed to Push notifications. 

  • You can add a device to this list by requesting the subscription with POST /push/{device-id}
  • You can delete a device from this list by requesting the unsubscription with DELETE/push/{device-id}

Parameter

Header Parameters

Common Header

Body Parameters

None

 

Result

There are two results (Succeeded, Failed) for this method call.

Succeeded

If succeeded, the list of users' devices subscribed to Push notifications is returned. If there are no subscribed devices, a null value is returned. 

Failed

If failed, it returns error codes and error messages defined in the Common Response.

 

Example of Request

[GET] {{ENDPOINT_URL}}/push
 
## Header
{
    “Authorization”: "Bearer 3b565aa79ac4abaa37809a8b8b745499bd05bb3ef0ed75fe350ad2c696b4b956bddfa35e76c26a12ab33c643bed579dd",
    “x-country-code”: "KR",
    “x-message-id”: "0123456789012345678912",
    “x-service-id”: "470ae4c534ba143cad86e5c3",
    “x-service-key”: "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzZXJ2aWNlSWQiOiI0NzBhZTRjNTM0YmExNDNjYWQ4NmU1YzMiLCJ0b2tlblNlZWQiOiI1Zjc2MWQwMDU2YmE4NWJkIiwidGltZSI6MTUxNjM0MTkzMn0.aznAEnUItCWc2UAFvoiIYDw0SCJDoY5xVCNnUyUJeiI",
    “content-type”: "application/json"
}

Example of Response

{
    “messageId”: “c2d362a0-dd0f-11e6-a7c7-abfb76e3e664”,
    “timestamp”: “1284101485”,
    “response”: "[{
            "deviceId": "0A36FC52-6281-4954-86D5-616A58CEA2C6"
        }]"
}

 

Subscribe to Push Messages

POST /push/{device-id}

Description

This method allows your service to receive Push notifications from the device.

POST {Base_URL}/push/{device-id}

If this method is successfully called, your service will subscribe to Push notifications from the device specified as device-id. Push notifications occur non-periodically for the following four situations.

If this method is successfully called, your service will subscribe to Push notifications for the following situations from the device specified as device-id:

  • Completion of device operation (e.g. washing completed)/ Replacement of parts (e.g. filter replacement)

Refer to Push Messages for details.

When a Push message occurs, it is sent to the callback URL of your service. For the message about the device operation completion or part replacement (DEVICE_PUSH), you should deliver it to users.

 

Parameter

Header Parameters

Common Header

Body Parameters

None

 

Result

There are two results (Succeeded, Failed) for this method call.

Succeeded

If succeeded, it returns a null value.

Failed

​If failed, it returns error codes and error messages defined in the Common Response.

 

Example of Request

[POST] {{ENDPOINT_URL}}/push/{device-id}
 
## Header
{
    “Authorization”: "Bearer 3b565aa79ac4abaa37809a8b8b745499bd05bb3ef0ed75fe350ad2c696b4b956bddfa35e76c26a12ab33c643bed579dd",
    “x-country-code”: "KR",
    “x-message-id”: "0123456789012345678912",
    “x-service-id”: "470ae4c534ba143cad86e5c3",
    “x-service-key”: "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzZXJ2aWNlSWQiOiI0NzBhZTRjNTM0YmExNDNjYWQ4NmU1YzMiLCJ0b2tlblNlZWQiOiI1Zjc2MWQwMDU2YmE4NWJkIiwidGltZSI6MTUxNjM0MTkzMn0.aznAEnUItCWc2UAFvoiIYDw0SCJDoY5xVCNnUyUJeiI",
    “content-type”: "application/json"
}

Example of Response

{
    “messageId”: “c2d362a0-dd0f-11e6-a7c7-abfb76e3e664”,
    “timestamp”: “1284101485”,
    “response”: {}
}

 

Unsubscribe to Push Messages

DELETE /push/{device-id}

Description

This method allows your service to cancel subscriptions to the Push notifications of the device.

DELETE {Base_URL}/push/{device-id}

If the method is successfully called, your service does NOT receive Push messages anymore from the device specified as device-id. Push notifications of that device cannot be received until a subscription has been requested again using POST /push/{device-id}

 

Parameter

Header Parameters

Common Header

Body Parameters

None

 

Result

There are two results (Succeeded, Failed) for this method call.

Succeeded

If succeeded, it returns a null value.

Failed

​If failed, it returns error codes and error messages defined in the Common Response.

 

Example of Request

[DELETE] {{ENDPOINT_URL}}/push/{device-id}
 
## Header
{
    “Authorization”: "Bearer 3b565aa79ac4abaa37809a8b8b745499bd05bb3ef0ed75fe350ad2c696b4b956bddfa35e76c26a12ab33c643bed579dd",
    “x-country-code”: "KR",
    “x-message-id”: "0123456789012345678912",
    “x-service-id”: "470ae4c534ba143cad86e5c3",
    “x-service-key”: "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzZXJ2aWNlSWQiOiI0NzBhZTRjNTM0YmExNDNjYWQ4NmU1YzMiLCJ0b2tlblNlZWQiOiI1Zjc2MWQwMDU2YmE4NWJkIiwidGltZSI6MTUxNjM0MTkzMn0.aznAEnUItCWc2UAFvoiIYDw0SCJDoY5xVCNnUyUJeiI",
    “content-type”: "application/json"
}  

Example of Response

{
    “messageId”: “c2d362a0-dd0f-11e6-a7c7-abfb76e3e664”,
    “timestamp”: “1284101485”,
    “response”: {}
}

 

Push Messages

Push messages occur non-periodically for the following four situations: 

  • Device Registration
  • Device Unregistration
  • Device Alias Change
  • Completion of device operation (e.g., washing completed), replacement of parts (e.g., filter replacement)

Device Registration/ Unregistration/ Alias Change

  • Subscribed by default if the user has viewed the device list even once (if GET /devices is called even once).

Completion of device operation, replacement of parts

  • Require additional subscription settings to notify the user. The POST /push/{device-id} must be called for the subscription.

Registration of device

Name

Type

Description

push

object

The object containing information about the PUSH

 

pushType

enum

DEVICE_REGISTERED

 

serviceId

string

Service Id

 

deviceId

string

The identifier of the device

 

userNumber

string

The identifier of the user

 

modelName

string

Model name

 

deviceType

enum

Device type

 

alias

string

Device alias

Example

{
  "messageId": "c2d362a0-dd0f-11e6-a7c7-abfb76e3e664",
  "timestamp": "2017-12-29T00:53:00.017513"
  "push": {
    "pushType": "DEVICE_REGISTERED",
    "serviceId": "2d4b2b6fa6af2b51b36d0038",
    "deviceId": "87e78580-7117-11d3-a99e-30a9de10016f",
    "userNumber": "KR1812273049127",
    "modelName": "FH0D7DDNK0_WIFI",
    "deviceType": "DEVICE_WASHER",
    "alias": "t10_test"
  }
}

 

Unregistration of device

Name

Type

Description

push

object

The object containing information about the PUSH

 

pushType

enum

DEVICE_UNREGISTERED

 

serviceId

string

Service Id

 

deviceId

string

The identifier of the device

 

userNumber

string

The identifier of the user

 

deviceType

string

Device type

 

alias

string

Device alias

Example

{
  "messageId": "c2d362a0-dd0f-11e6-a7c7-abfb76e3e664",
  "timestamp": "2017-12-29T00:53:00.017513"

  "push": {
    "pushType": "DEVICE_UNREGISTERED",
    "serviceId": "2d4b2b6fa6af2b51b36d0038",
    "deviceId": "87e78580-7117-11d3-a99e-30a9de10016f",
    "userNumber": "KR1812273049127",
    "deviceType": "DEVICE_WASHER",
    "alias": "t10_test"
  }
}

 

Change of device alias

Name

Type

Description

push

object

The object containing information about the PUSH

 

pushType

enum

DEVICE_ALIAS_CHANGED

 

serviceId

string

Service Id

 

deviceId

string

The identifier of the device

 

userNumber

string

The identifier of the user

 

alias

string

The device alias changed

Example

{
    "messageId": "c2d362a0-dd0f-11e6-a7c7-abfb76e3e664",
    "timestamp": "2017-12-29T00:53:00.017513"
    "push": {
        "pushType": "DEVICE_ALIAS_CHANGED",
        "serviceId": "2d4b2b6fa6af2b51b36d0038",
        "deviceId": "87e78580-7117-11d3-a99e-30a9de10016f",
        "userNumber": "ABCDE"
        "alias": "MyDishWasher"
    }
} 

 

Completion of device operation

Name

Type

Description

push

object

The object containing information about the PUSH

 

pushType

enum

DEVICE_PUSH

 

serviceId

string

Service Id

 

deviceId

string

The identifier of the device

 

pushCode

string

Device operation completion notifications (e.g. washing completed), Part replacement notifications (e.g. filter replacement)

 

deviceType

enum

Device Type

 

userList

List

List of users who registered the device push

Example

{
  "messageId": "5o5MOYXCR0qb05Sa-f0kpg",
  "timestamp": "2019-06-20T01:05:21.811029",
  "push": 
  {
    "pushType": "DEVICE_PUSH",
    "serviceId": "6b2011e7ff026e984215522d",
    "deviceId": "HW1 - 69 C3EDD9 - 1993 - 4442 - B139 - 794 CA5997ECA", 
    "pushCode": "WASHING_IS_COMPLETE",
    "deviceType": "DEVICE_WASHER",
    "userList": ["KR1910213944934"]
  }
}
  1. Available values for the pushType are defined in Common Data Type > Push Type
  2. Available values for the pushCode are defined in Device Profile page's Notification (Push Message) section by the device Type.