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

  1. Call the API (GET /devices) to retrieve the device list.

Sequence diagram for getting 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

  1. Call the API (GET /devices). If a device list is already output, skip this step.
  2. Locate the device-id of the desired device from the list in the response.
  3. Call the API (GET /devices/<device-id>) with the device-id . 

Sequence diagram for getting device information

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

  1. Call the API (GET /devices). If a device list is already output, skip this step.
  2. Locate the device-id of the desired device from the device list provided in the response.
  3. Call the API with device-id (POST /devices/<device-id>/reserve).

Sequence diagram for device reservation

Get Reserved Device List

The following outlines how to get the list of reserved devices:

Related APIs

  • GET {{BASE_URL}}/devices?searchType=reserved

Sequence

  1. Calls the Get Device List API. At this time, enter the value of the query parameter searchType as reserved. (GET /devices?searchType=reserved)

Sequence diagram for getting reserved device list

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

  1. Call the API (GET /devices?searchType=reserved). Set the searchType query parameter to reserved to request a list of reserved devices . If a reserved device list is already output, skip this step.
  2. Locate the device-id of the desired device from the device list provided in the response.
  3. Call the API (DELETE /devices/<device-id>/reserve).

Sequence diagram for device reservation cancel

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

  1. The user selects a course on the device.
  2. User requests payment. At this time, the Get Device Information API (GET /devices/<device-id>) is called to retrieve the amount required for payment.
  3. Make the payment. (LG does not support payment-related functions.)
  4. When the payment is complete, the Prepare Device API (POST /devices/<device-id>/ready) is called.

Sequence diagram for preparing the device for use