Callback
The LG Commercial Laundry Server calls the callback URL of the partner server and delivers a message for the following events:
- Device registration
- Release device reservation
- Device remaining time notification
- Device error occurred
(For how to register the callback URL, refer to the Event API.)
Device Registration Callback
POST {{CALLBACK_URL}}
When the device is registered, the LG Commercial Laundry Server calls the callback URL of the partner server to deliver the following message:
Callback
Parameter
Location |
Name |
Required |
Type |
Description |
Default |
Example |
|
---|---|---|---|---|---|---|---|
Header |
Common Header |
Mandatory |
- | - | |||
Body |
deviceAdded |
||||||
└ |
deviceId |
Mandatory |
string |
Device ID |
|
||
└ |
deviceType |
Mandatory |
string |
Device type |
|||
└ |
model |
Mandatory |
string |
Model name |
|||
└ |
nickName |
Mandatory |
string |
Device nickname |
Example
[POST] {{CALLBACK_URL}} { "deviceAdded": { "deviceId": "12341234", "deviceType": "211", "model": "washer", "nickName": "washer_new" } }
Booking Cancellation Callback
POST {{CALLBACK_URL}}
When the device booking is canceled, the LG Commercial Laundry Server calls the callback URL of the partner server to deliver the following message:
(Reservation cancellation occurs in the following cases: When the reserved time has expired, when the power is turned off and then on, etc.)
Callback
Parameter
Location |
Name |
Required |
Type |
Description |
Default |
Example |
|
---|---|---|---|---|---|---|---|
Header |
Common Header |
Mandatory |
- | - | |||
Body |
cancelReservation |
||||||
└ |
deviceId |
Mandatory |
string |
Device ID |
|
Example
[POST] {{CALLBACK_URL}} { "cancelReservation": { "deviceId": "12341234" } }
Remaining Time Callback
POST {{CALLBACK_URL}}
The LG Commercial Laundry Server calls the callback URL of the partner server and delivers the remaining time until the device is shut down.
Callback
Parameter
Location |
Name |
Required |
Type |
Description |
Default |
Example |
|
---|---|---|---|---|---|---|---|
Header |
Common Header |
Mandatory |
- | - | - | ||
Body |
remain |
||||||
└ |
deviceId |
Mandatory |
string |
Device ID |
|
||
└ |
min |
|
Integer |
Remaining time (Unit: min) |
|
Example
[POST] {{CALLBACK_URL}} { "remain": { "deviceId": "12341234", "min": 10 } }
Device Error Callback
POST {{CALLBACK_URL}}
When an error occurs in the device, the LG Commercial Laundry Server calls the callback URL of the partner server and delivers the following message:
Callback
Parameter
Location |
Name |
Required |
Type |
Description |
Default |
Example |
|
---|---|---|---|---|---|---|---|
Header |
Common Header |
Mandatory |
- | - | - | - | |
Body |
error |
||||||
└ |
deviceId |
Mandatory |
string |
Device ID |
- |
- |
|
└ |
detail |
|
string |
Error code description |
- |
- |
|
└ |
todo |
|
string |
List of actions to take to resolve the error |
- | - |
Example
[POST] {{CALLBACK_URL}} { "remain": { "deviceId": "12341234", "detail": 10, "todo": } }