Data Delivery

Create Data ZIP File

Creates a ZIP file of data that periodically stores device status information.

Endpoint

POST {{baseUrl}}/data-zip/files​

 

Request

Path Parameter

N/A

 

Request Header

You should enter the following information in the request header in JSON format.

 

Request Header (Common Header) Information

Name

Type

Required

Description

x-service-id

string

mandatory

The Service ID value which used to identify the owner of the request

x-service-token

string

mandatory

The Service Token value to ensure that the request is valid. It is issued before service integration.

x-message-id

string

optional

The value for tracing the processing of target requests

x-country-code

string

mandatory

The country code to provide the service. The ISO country code is used. (E.g. KR, US, TW, CN, ......)

 

Request Body

You should enter the following information in the request body in JSON format.

 

Request Body Information

Key

Type

Required

Description

target

string

mandatory

The target device type

  • x-DEVICE_TV
  • x-DEVICE_AIR_CONDITIONER

venID

string

mandatory

The target VEN ID (Virtual End Node ID)

It could be an energy management system or a group of end devices

resourceIDs

string array

optional

The target resource ID

It could be a device type or a group of end devices.

from

number

mandatory

UTC timestamp (unit: second)

  • In case of x-DEVICE_TV, only up to the day can be specified.
  • The timestamp will be converted to date by the LG DR server automatically.

to

number

mandatory

UTC timestamp (unit: second)

  • In case of x-DEVICE_TV, only up to the day can be specified.
  • The timestamp will be converted to date by the LG DR server automatically.

 

Request Example

curl -v \ 
    -X POST \ 
    -H 'Content-Type: application/json' \ 
    -H 'x-service-id: bzc01pn243ch31' \ 
    -H 'x-service-token: a8e1236b9061123b77de5d61586e38e6' \ 
    -H 'x-message-id: p5dB3HOcSPSM8toOPxoBuz' \ 
    -H 'x-country-code: US' \ 
    {{baseUrl}}/data-zip/files \ 
    -d '{
        "target": "x-DEVICE_TV",
        "venID": "CE-01",
        "from" : 1546300800,
        "to": 1548979199
    }'

 

Response

Response Body

In response to the request, the following information is returned in the JSON format in the response body.

 

Response Body Information

Key

Value

code

Result code for the request

For a description of the code values, please refer to the Common Response page.

data

Result data corresponding to the result code

 

taskId

ZIP file creation task ID

 

fileName

ZIP file name

 

Response Example

{
    "code": 2000,
    "data": {
        "taskId": "9e7b7012-0730-427b-bf85-607d15abadb5",
        "fileName": "data-zip-1546300800-1548979199-1548892800.zip"
    }
}

 

Download a Data ZIP File

Downloads a specific ZIP file.

Endpoint

GET {{baseUrl}}/data-zip/files/{fileName}​

 

Request

Path Parameter

Enters the fileName of the ZIP file to download.

 

Parameter Information

Name

Type

Required

Description

fileName

string

mandatory

The ZIP file name

  • Format: data-zip-{from}-{to}-{expireAt}.zip
  • E.g. data-zip-1548374400-1549843200-1548892800.zip

 

Request Header

You should enter the following information in the request header in JSON format.

 

Request Header (Common Header) Information

Name

Type

Required

Description

x-service-id

string

mandatory

The Service ID value which used to identify the owner of the request

x-service-token

string

mandatory

The Service Token value to ensure that the request is valid. It is issued before service integration.

x-message-id

string

optional

The value for tracing the processing of target requests

x-country-code

string

mandatory

The country code to provide the service. The ISO country code is used. (E.g. KR, US, TW, CN, ......)

 

Request Body

N/A

 

Request Example

curl -v \
    -X GET \
    -H 'Content-Type: applicatoin/json' \
    -H 'x-service-id: bzc01pn243ch31' \
    -H 'x-service-token: a8e1236b9061123b77de5d61586e38e6' \
    -H 'x-message-id: p5dB3HOcSPSM8toOPxoBuz' \
    -H 'x-country-code: US' \
    {{baseUrl}}/data-zip/files/data-zip-1546300800-1548979199-1548892800.zip \
    -o data-zip-1546300800-1548979199-1548892800.zip