Devices – Enable/Disable Push Service

 
 
 

Enable or disable push service

put/devices/:deviceId/events/push

Permission: User


curl -X PUT 
     -H "Authorization: Bearer 39b91f08e03e99b76f55d17e0f8dec4cc36afb758b78b67eac8ea5ee8e0779e64b5658c65f1c0d05da90af5cc1c881927c6374909b79740882285fda13c562aa" 
     -H "Content-Type: application/json" 
     -d '{ "status": "true"}' 
     "https://api.encoredtech.com/1.2/devices/5ADC31B0-320A-11E5-9A2D-0FE805413009/events/push

Header

Field Type Description
Authorization String Bearer Auth or Basic Auth
Bearer {token}

URL Param

Field Type Description
deviceId String UUID of a device

Body Param

Field Type Description
status String Push service setting (true:enable or false:disable)

Success 200

Field Type Description
status String result of push service setting (on: using , off: not using)
HTTP/1.1 200 OK
{ "status":"on" }

400

Field Description
InvalidHeaderError Error is returned in following cases:
– ‘Authorization’ Header is missed
InvalidContentError Error is returned in following cases:
– Required paramters are missed
– Parameter is not valid
– Other errors in Parameter

403

Field Description
NotAuthorizeError Invalid apikey

404

Field Description
ResourceNotFoundError Requested Resource does not exist

500

Field Description
InternalError Other Server Errors
HTTP/1.1 400 Bad Request
{
    "code": "InvalidHeader",
    "message": "Authorization Header is missed"
}

Devices – Get Push Notification Setting

 
 

Request current push setting

get/devices/:deviceId/events/push

Permission: User

curl -G 
    -H "Authorization: Bearer 62e4856d63e371c32e06540f9677850595cd993234d6fe8251890958d77ff0d8daa2eea7a2ce9c760fd7fc16a9b08d088303d50fd72ae0fab63f217ab02f0842" 
    http://api.encoredtech.com/1.2/devices/5ADC31B0-320A-11E5-9A2D-0FE805413009/events/push

Header

Field Type Description
Authorization String Bearer Auth or Basic Auth
Bearer {token}

URL Param

Field Type Description
deviceId String UUID of device

Success 200

Field Type Description
status String Current push service setting (on: using, off: not using )
HTTP/1.1 200 OK
{ "status":"on" }

400

Field Description
InvalidHeaderError Error is returned in following cases:
– ‘Authorization’ Header is missed
InvalidContentError Error is returned in following cases:
– Required paramters are missed
– Parameter is not valid
– Other errors in Parameter

403

Field Description
NotAuthorizeError Invalid apikey

404

Field Description
ResourceNotFoundError Requested Resource does not exist

500

Field Description
InternalError Other Server Errors
HTTP/1.1 400 Bad Request
{
    "code": "InvalidHeader",
    "message": "Authorization Header is missed"
}

Devices – Register Push Id

 
 

Register user id for push

post/devices/:deviceId/events/push

Permission: User

curl -X POST -d '{"type": "AND", "regId":"f744eeafa211aee0d4182c30dac88a52562939eecd9bddefaaf997ff70683a0a"}'    
    -H "Authorization: Bearer 62e4856d63e371c32e06540f9677850595cd993234d6fe8251890958d77ff0d8daa2eea7a2ce9c760fd7fc16a9b08d088303d50fd72ae0fab63f217ab02f0842" 
    -H "Content-Type: application/json"                                    
    http://api.encoredtech.com/1.2/devices/5ADC31B0-320A-11E5-9A2D-0FE805413009/events/push

Header

Field Type Description
Authorization String Bearer Auth or Basic Auth
Bearer {token}

URL Param

Field Type Description
deviceId String UUID of a device

Header

Field Type Description
Content-Type String appliaction/json

Post Data

Field Type Description
type String OS Type (‘IOS’ for iOS or ‘AND’ for Android)
regId String Push Registration Id
HTTP/1.1 200 OK

400

Field Description
InvalidHeaderError Error is returned in following cases:
– ‘Authorization’ Header is missed
InvalidContentError Error is returned in following cases:
– Required paramters are missed
– Parameter is not valid
– Other errors in Parameter

403

Field Description
NotAuthorizeError Invalid apikey

404

Field Description
ResourceNotFoundError Requested Resource does not exist

500

Field Description
InternalError Other Server Errors
HTTP/1.1 400 Bad Request
{
    "code": "InvalidHeader",
    "message": "Authorization Header is missed"
}

Devices – Request Device Forecast Usage

 
 

Request electricity usage forecast

get/devices/:deviceId/forecastUsage

Permission: User

curl -G                                                                     
     -H "Authorization: Bearer 62e4856d63e371c32e06540f9677850595cd993234d6fe8251890958d77ff0d8daa2eea7a2ce9c760fd7fc16a9b08d088303d50fd72ae0fab63f217ab02f0842" 
     http://api.encoredtech.com/1.2/devices/B3192D50-47E6-11E5-B4EF-3D4FDED8A409/forecastUsage

Header

Field Type Description
Authorization String Bearer Auth or Basic Auth
Bearer {token}

Success 200

Field Type Description
  meteringDay Number metering day of month
  meteringStart Number timestamp for start day of month(ms)
  meteringEnd Number timestamp for end day of target month (ms)
  meteringPeriodUsage Number electricity forecasted usage (mWh)
HTTP/1.1 200 OK
{
    "meteringDay": 10,
    "meteringStart": 1439175600000,
    "meteringEnd": 1441854000000,
    "meteringPeriodUsage": 218415844
}

400

Field Description
InvalidHeaderError Error is returned in following cases:
– ‘Authorization’ Header is missed
InvalidContentError Error is returned in following cases:
– Required paramters are missed
– Parameter is not valid
– Other errors in Parameter

403

Field Description
NotAuthorizeError Invalid apikey

404

Field Description
ResourceNotFoundError Requested Resource does not exist

500

Field Description
InternalError Other Server Errors
HTTP/1.1 400 Bad Request
{
    "code": "InvalidHeader",
    "message": "Authorization Header is missed"
}

Devices – Request Device Information

 
 

Request information of a device

get/devices/:deviceId

Permission: User

curl -H "Authorization: Bearer 62e4856d63e371c32e06540f9677850595cd993234d6fe8251890958d77ff0d8daa2eea7a2ce9c760fd7fc16a9b08d088303d50fd72ae0fab63f217ab02f0842"      
     http://api.encoredtech.com/1.2/devices/5ADC31B0-320A-11E5-9A2D-0FE805413009

Header

Field Type Description
Authorization String Bearer Auth or Basic Auth
Bearer {token}

URL Param

Field Type Description
deviceId String UUID of a device

Success 200

Field Type Description
model String device model name
serialNumber String device serial number (first 8 hex numbers. full serialnumber is 10)
macAddress String mac address of device wifi module
createdAt String registration date of device on cloud server
HTTP/1.1 200 OK
{
    "model": "EDM3",
    "serialNumber":"F3FFFFFF",
    "macAddress":"84:72:07:18:9a:c1",
    "createdAt": 1441711154000,
}

400

Field Description
InvalidHeaderError Error is returned in following cases:
– ‘Authorization’ Header is missed
InvalidContentError Error is returned in following cases:
– Required paramters are missed
– Parameter is not valid
– Other errors in Parameter

403

Field Description
NotAuthorizeError Invalid apikey

404

Field Description
ResourceNotFoundError Requested Resource does not exist

500

Field Description
InternalError Other Server Errors
HTTP/1.1 400 Bad Request
{
    "code": "InvalidHeader",
    "message": "Authorization Header is missed"
}

Devices – Request Device Metering Usage

 
 

Request usage of month between metering day and current time

get/devices/:deviceId/meteringUsage

Permission: User

curl -G 
    -H "Authorization: Bearer 62e4856d63e371c32e06540f9677850595cd993234d6fe8251890958d77ff0d8daa2eea7a2ce9c760fd7fc16a9b08d088303d50fd72ae0fab63f217ab02f0842"    
    -d "timestamp=1393599600000" 
    http://api.encoredtech.com/1.2/devices/5ADC31B0-320A-11E5-9A2D-0FE805413009/meteringUsage

Header

Field Type Description
Authorization String Bearer Auth or Basic Auth
Bearer {token}

URL Param

Field Type Description
deviceId String UUID of a device

Success 200

Field Type Description
  meteringDay Number 매월 검침일
  meteringStart Number 해당월 검침일의 타임스탬프 (ms)
  meteringEnd Number 해당월의 검침기간 마지막 날의 타임스탬프 (ms)
  meteringPeriodUsage Number 검침일로 부터의 누적 전력 사용량 (mWh)
  meteringPeriodBill Number 검침일로 부터의 사용량에 대한 전기요금 (원)
HTTP/1.1 200 OK
{
    "meteringDay": 20,
    "meteringStart": 1413730800000,
    "meteringEnd": 1414916168000,
    "meteringPeriodUsage": 6659708, 
    "meteringPeriodBill": 814.262
}

400

Field Description
InvalidHeaderError Error is returned in following cases:
– ‘Authorization’ Header is missed
InvalidContentError Error is returned in following cases:
– Required paramters are missed
– Parameter is not valid
– Other errors in Parameter

403

Field Description
NotAuthorizeError Invalid apikey

404

Field Description
ResourceNotFoundError Requested Resource does not exist

500

Field Description
InternalError Other Server Errors
HTTP/1.1 400 Bad Request
{
    "code": "InvalidHeader",
    "message": "Authorization Header is missed"
}

Devices – Request Device Metering Usages

 
 

Request metering usages of months in some period

get/devices/:deviceId/meteringUsages

Permission: User

curl -G 
    -H "Authorization: Bearer 62e4856d63e371c32e06540f9677850595cd993234d6fe8251890958d77ff0d8daa2eea7a2ce9c760fd7fc16a9b08d088303d50fd72ae0fab63f217ab02f0842"    
    -d "start=1413730800000&end=1419044400000" 
    http://api.encoredtech.com/1.2/devices/5ADC31B0-320A-11E5-9A2D-0FE805413009/meteringUsages

Header

Field Type Description
Authorization String Bearer Auth or Basic Auth
Bearer {token}

URL Param

Field Type Description
deviceId String UUID of a device

Query String

Field Type Description
period String period unit (15min, hourly, daily, monthly)
start Number start timestamp, inclusive (ms)
end Number end timestatmp, exclusive (ms)

Success 200

Field Type Description
meteringDay Number metering day of month
usages Object[]  
  meteringStart Number start timestamp of targer month (ms)
  meteringEnd Number end timestamp of target month (ms)
  meteringPeriodUsage Number eletricity usage from metering day (mWh)
  meteringPeriodBill Number bill for this usage (Korean Won)
HTTP/1.1 200 OK
{
    "meteringDay": 20, 
    "usages": 
    [
       {
           "meteringStart": 1413730800000,
           "meteringEnd": 1416452400000,
           "meteringPeriodUsage": 6659708, 
           "meteringPeriodBill": 814.262
       },
       {
           "meteringStart": 1416452400000,
           "meteringEnd": 1419044400000,
           "meteringPeriodUsage": 6659708, 
           "meteringPeriodBill": 814.262
       },
    ]
}

400

Field Description
InvalidHeaderError Error is returned in following cases:
– ‘Authorization’ Header is missed
InvalidContentError Error is returned in following cases:
– Required paramters are missed
– Parameter is not valid
– Other errors in Parameter

403

Field Description
NotAuthorizeError Invalid apikey

404

Field Description
ResourceNotFoundError Requested Resource does not exist

500

Field Description
InternalError Other Server Errors
HTTP/1.1 400 Bad Request
{
    "code": "InvalidHeader",
    "message": "Authorization Header is missed"
}

Devices – Request Device Periodic Usages

 
 

request (quaterhourly, hourly, daily, monthly) electricity usage of a device in a period.

get/devices/:deviceId/usages

Permission: User

curl -G                                                                     
     -H "Authorization: Bearer 62e4856d63e371c32e06540f9677850595cd993234d6fe8251890958d77ff0d8daa2eea7a2ce9c760fd7fc16a9b08d088303d50fd72ae0fab63f217ab02f0842" 
     -d 'period=hourly&start=1393772400000&end=1393779600000'                             
     http://api.encoredtech.com/1.2/devices/B3192D50-47E6-11E5-B4EF-3D4FDED8A409/usages

Header

Field Type Description
Authorization String Bearer Auth or Basic Auth
Bearer {token}

URL Param

Field Type Description
deviceId String UUID of a device

Query String

Field Type Description
period String period unit (15min, hourly, daily, monthly)
start Number start timestamp, inclusive (ms)
end Number end timestamp, exclusive (ms)

Success 200

Field Type Description
usages Object[]  
  timestamp Number start timestamp (ms)
  unitPeriodUsage Number electricity usages in this period (mWh)
  unitPeriodBill Number bill for elctricity usages (Korean Won)
HTTP/1.1 200 OK
[
     {
        "timestamp": 1393772400000,
        "unitPeriodUsage": 2000,
        "unitPeriodBill": 100,
     },
     {
        "timestamp": 1393776000000,
        "unitPeriodUsage": 5000,
        "unitPeriodBill": 250,
     }
 ]

400

Field Description
InvalidHeaderError Error is returned in following cases:
– ‘Authorization’ Header is missed
InvalidContentError Error is returned in following cases:
– Required paramters are missed
– Parameter is not valid
– Other errors in Parameter

403

Field Description
NotAuthorizeError Invalid apikey

404

Field Description
ResourceNotFoundError Requested Resource does not exist

500

Field Description
InternalError Other Server Errors
HTTP/1.1 400 Bad Request
{
    "code": "InvalidHeader",
    "message": "Authorization Header is missed"
}

Devices – Request Realtime Usage

 
 

Request device usage of current time

get/devices/:deviceId/realtimeUsage

Permission: User

curl -G                                                                     
     -H "Authorization: Bearer 62e4856d63e371c32e06540f9677850595cd993234d6fe8251890958d77ff0d8daa2eea7a2ce9c760fd7fc16a9b08d088303d50fd72ae0fab63f217ab02f0842" 
     http://api.encoredtech.com/1.2/devices/5ADC31B0-320A-11E5-9A2D-0FE805413009/realtimeUsage

Header

Field Type Description
Authorization String Bearer Auth or Basic Auth
Bearer {token}

URL Param

Field Type Description
deviceId String UUID of a device

Success 200

Field Type Description
  timestamp Number timestatmp (ms)
  voltage Number voltage (mV)
  current Number current (mA)
  activePower Number active power (mW)
  apparentPower Number apparent power (mVA)
  reactivePower Number reactive power (mVar)
  powerFactor Number power factor
  wattHour Number accumulated usage (mWh)
  powerBase Number power base (mWh)
HTTP/1.1 200 OK
    {
        "timestamp": 1390961400000,
        "voltage": 100000,
        "current": 1000,
        "activePower": 100000,
        "apparentPower": 100000,
        "reactivePower": 100000,
        "powerFactor": 1000,
        "wattHour": 0,
        "powerBase": 100000,
    }

400

Field Description
InvalidHeaderError Error is returned in following cases:
– ‘Authorization’ Header is missed
InvalidContentError Error is returned in following cases:
– Required paramters are missed
– Parameter is not valid
– Other errors in Parameter

403

Field Description
NotAuthorizeError Invalid apikey

404

Field Description
ResourceNotFoundError Requested Resource does not exist

500

Field Description
InternalError Other Server Errors
HTTP/1.1 400 Bad Request
{
    "code": "InvalidHeader",
    "message": "Authorization Header is missed"
}

Users

Users – Request User Information

 
 

Request specific information of user

get/me

Permission: User

curl -G -H "Authorization: Bearer 62e4856d63e371c32e06540f9677850595cd993234d6fe8251890958d77ff0d8daa2eea7a2ce9c760fd7fc16a9b08d088303d50fd72ae0fab63f217ab02f0842"      
     -d "app_version=0.9.2" 
     http://api.encoredtech.com/1.2/me

Header

Field Type Description
Authorization String Bearer Auth or Basic Auth
Bearer {token}

URL Param

Field Type Description
userId String user id

Query String

Field Type Description
appVersion String App version (ex. 0.9.2)

Success 200

Field Type Description
code Number response code for this request
message String response message for this request
userId Number user id
nickName String user nickname 사용자 별명
email String email address 사용자 이메일 정보
phone String phone number 사용자 휴대폰 번호
agreementSMS Bool agreement for SMS 문자 수신 동의 여부
agreementEmail Bool agreement for Email 이메일 수신 동의 여부
meteringDay Number metering day 검침일
contractType Number contract type (mW)
contractPower Number contract power
maxLimitUsage Number planed usage
maxLimitUsageBill Number expected bill for planed usage
needUpdate Bool whether mobile app need to be updated
HTTP/1.1 200 OK
{
      "code": 204,
      "message": "Device is not specified yet."
      "userId": 11111111,
      "nickName": null,
      "email": "test@encoredtech.com",
      "phone": "01010100101",
      "agreementSMS": false,
      "agreementEmail": false,
      "meteringDay": 5,
      "contractType": 1,
      "contractPower": null,
      "maxLimitUsage": null,
      "needUpdate": true,
}

400

Field Description
InvalidHeaderError Error is returned in following cases:
– ‘Authorization’ Header is missed
InvalidContentError Error is returned in following cases:
– Required paramters are missed
– Parameter is not valid
– Other errors in Parameter

403

Field Description
NotAuthorizeError Invalid apikey

404

Field Description
ResourceNotFoundError Requested Resource does not exist

500

Field Description
InternalError Other Server Errors
HTTP/1.1 400 Bad Request
{
    "code": "InvalidHeader",
    "message": "Authorization Header is missed"
}

Users – Update User Information

 
 

Update metering day, contract type, contract power, and limit usage setting

put/me

Permission: User

curl -i -X PUT -d '{"meteringday": 10, "contractPower": 200000}'          
    -H "Authorization: Bearer 39b91f08e03e99b76f55d17e0f8dec4cc36afb758b78b67eac8ea5ee8e0779e64b5658c65f1c0d05da90af5cc1c881927c6374909b79740882285fda13c562aa" 
    -H "Content-Type: application/json"                                    
    "https://api.encoredtech.com/1.2/me"

Header

Field Type Description
Authorization String Bearer Auth or Basic Auth
Bearer {token}

URL Param

Field Type Description
userId String user id

Body Param

Field Type Description
meteringDay optional Number metering da (1~28)
contractPower optional Number contract power
contractType optional Number contract type
maxLimitUsage optional Number usage you are expected
HTTP/1.1 200 OK

400

Field Description
InvalidHeaderError Error is returned in following cases:
– ‘Authorization’ Header is missed
InvalidContentError Error is returned in following cases:
– Required paramters are missed
– Parameter is not valid
– Other errors in Parameter

403

Field Description
NotAuthorizeError Invalid apikey

404

Field Description
ResourceNotFoundError Requested Resource does not exist

500

Field Description
InternalError Other Server Errors
HTTP/1.1 400 Bad Request
{
    "code": "InvalidHeader",
    "message": "Authorization Header is missed"
}

 

Generated with apidoc 0.13.1 – 2015-12-17T04:19:38.126Z