API Call Sequence
This section explains how to use the Commercial Laundry API through API call flow.
Get Device List
The following outlines how to get the device list:
Related APIs
-
GET {{BASE_URL}}/devices
Sequence
- Call the API (GET /devices) to retrieve the device list.
Get Device Information
The following outlines how to get information on a specific device:
Related APIs
-
GET {{BASE_URL}}/devices
-
GET {{BASE_URL}}/devices/<device-id>
Sequence
- Call the API (GET /devices). If a device list is already output, skip this step.
- Locate the
device-id
of the desired device from the list in the response. - Call the API (GET /devices/<device-id>) with the
device-id
.
Reserve Device
The following outlines how to reserve a device to prevent it from being used.
Related APIs
-
GET {{BASE_URL}}/devices
-
POST {{BASE_URL}}/devices/<device-id>/reserve
Sequence
- Call the API (GET /devices). If a device list is already output, skip this step.
- Locate the
device-id
of the desired device from the device list provided in the response. - Call the API with
device-id
(POST /devices/<device-id>/reserve).
Get Reserved Device List
The following outlines how to get the list of reserved devices:
Related APIs
-
GET {{BASE_URL}}/devices?searchType=reserved
Sequence
- Calls the Get Device List API. At this time, enter the value of the query parameter
searchType
asreserved
. (GET /devices?searchType=reserved)
Cancel Device Reservation
The following outlines how to cacel the device reservation:
Related APIs
-
GET {{BASE_URL}}/devices?searchType=reserved
-
DELETE {{BASE_URL}}/devices/<device-id>/reserve
Sequence
- Call the API (GET /devices?searchType=reserved). Set the
searchType
query parameter toreserved
to request a list of reserved devices . If a reserved device list is already output, skip this step. - Locate the
device-id
of the desired device from the device list provided in the response. - Call the API (DELETE /devices/<device-id>/reserve).
Prepare Device for Use
The following outlines the process of preparing the device for use:
Related APIs
-
GET {{BASE_URL}}/devices
-
POST {{BASE_URL}}/devices/<device-id>/ready
Sequence
- The user selects a course on the device.
- User requests payment. At this time, the Get Device Information API (GET /devices/<device-id>) is called to retrieve the amount required for payment.
- Make the payment. (LG does not support payment-related functions.)
- When the payment is complete, the Prepare Device API (POST /devices/<device-id>/ready) is called.