OPEN API isTemperature and Humidity Monitoring Platform Open the platform interface which any third-party application or website can provide users with real-time high-quality services by using open APIs.API supports mainstream methods and is compatible with multiple programming languages.

Basic Instruction

  1. Authentication method:HTTP Basic Auth
  2. URL: http://t-api.tzonedigital.cn
  3. Account:Register link

I、Interface Instruction

URL HTTP Function
/openapi/openapi Get Get OpenAPI information
  1. Get OpenAPI information

    Get /openapi/openapi

    Parameters

    Name Type Required Description
    access_token String Yes Key

    For example

    curl http://t-api.tzonedigital.cn/openapi/openapi?access_token=xxxx -method get

    Parameters return description

    Name Type Required Description
    Status Int Yes When Status=0, it means error; when Status=1, it means normal
    Msg String No When Status=0, show an error description
    Content String No Content

    Key verification error

    {"Status":0,"Msg":"access_token is error !","Content":""}

    Return Value

    Name Type Required Description
    UserID Int Yes User ID
    TV Int Yes Total usage amount
    DV Int Yes Today's usage amount
    Version String Yes OpenAPI Version
    CreateTime DateTime Yes Create key time
    {"Status":1,"Msg":"","Content":"{"UserID":2,"TV":0,"DV":0,"Version":"1.0.0","CreateTime":"2019-02-25T08:58:06"}"}

II、Users/Users

URL HTTP Function
/openapi/user Get Get user information
  1. Get user information

    Get /openapi/user

    For example

    curl http://t-api.tzonedigital.cn/openapi/user?access_token=xxxx -method get

    Return Value

    Name Type Required Description
    ID Int Yes user ID
    UserName String Yes User name
    Email String Yes Email
    Tel String Yes Phone Number
    IsLocked Bool Yes The ccount is locked?
    FailedCount Int Yes Times of consecutive incorrect passwords
    LastLoginTime Long Yes Last login time
    EnterIP String Yes Last login IP
    CreateTime Long Yes Create user's account time
    TimeZone Double Yes User set the Time Zone
    Language String Yes User set the language
    {"Status":1,"Msg":"","Content":"{"ID":2,"UserName":"demo","Email":"demo@tzonedigital.com","Tel":"15012461234","IsLocked":false,"FailedCount":0,"LastLoginTime":1470120433000,"EnterIP":"1.1.1.1","CreateTime":1470120433000,"TimeZone":"8","Language":"zh_CN"}"}

III、Group/Groups

URL HTTP Function
/openapi/users/me/groups GET Group List
/openapi/users/me/groups POST Add Group
/openapi/users/me/groups/:id DELETE Delete Group
/openapi/users/me/groups/:id PUT Modify Group
  1. Group List

    GET /openapi/users/me/groups

    For example

    curl http://t-api.tzonedigital.cn/openapi/users/me/groups?access_token=xxxx -method get

    Return Value

    {"Status":1,"Msg":"","Content": "{"PageSize":1000,"PageIndex":1,"TotalCount":0,"TotalPage":0,"ResultList":null}"}

  2. Add Group

    POST /openapi/users/me/groups

    Parameters

    Name Type Description Required
    GroupName String Group Name Yes
    ParentID Int Parent ID (default is 0) No
    SortID Int Sort ID (the larger the serial number, the higher the order) No
    Description String Description No

    For example

    curl http://t-api.tzonedigital.cn/openapi/users/me/groups?access_token=xxxx -method post -body '{"GroupName":"Test","ParentID":0,"SortID":0,"Description":"test"}'

    Return Value

    {"Status":1,"Msg":"Added successfully","Content":""}

  3. Delete Group

    DELETE /openapi/users/me/groups/:id

    For example

    curl http://t-api.tzonedigital.cn/openapi/users/me/groups/0?access_token=xxxx -method delete

    Return Value

    {"Status":1,"Msg":"Added successfully","Content":""}
  4. Modify Group

    PUT /openapi/users/me/groups/:id

    Parameters

    Name Type Description Required
    GroupName String Group Name Yes
    ParentID Int Parent ID (default is 0) No
    SortID Int Sort ID (the larger the sequence number, the higher the order) No
    Description String Description No

    For example

    curl http://t-api.tzonedigital.cn/openapi/users/me/groups/0?access_token=xxxx -method put -body '{"GroupName":"Test","ParentID":0,"SortID":0,"Description":"test"}'

    Return Value

    {"Status":1,"Msg":"Modified successfully","Content":""}

IV、Device Type/ProductType

URL HTTP Function
/openapi/producttype GET Device Type
  1. Device Type

    GET /openapi/producttype

    For example

    curl http://t-api.tzonedigital.cn/openapi/producttype?access_token=xxxx -method get

    Return Value

    Name Type Required Description
    ID Int Yes Type ID
    TypeName String Yes Type Name
    {"Status":1,"Msg":"","Content":"[{"ID":14,"TypeName":"TZ-LORAWAN","Model":"LORAWAN","IsDelete":0},{"ID":13,"TypeName":"TZ-TAG07C","Model":"TAG07C","IsDelete":0},{"ID":12,"TypeName":"TZ-TT11B","Model":"TT11B","IsDelete":0},{"ID":11,"TypeName":"TZ-D01","Model":"D01","IsDelete":0},{"ID":10,"TypeName":"TZ-LoRa","Model":"LoRa","IsDelete":0},{"ID":9,"TypeName":"TZ-TAG06B","Model":"TAG06","IsDelete":0},{"ID":8,"TypeName":"TZ-TAG06","Model":"TAG06","IsDelete":0},{"ID":7,"TypeName":"TZ-TAG05","Model":"TAG05","IsDelete":0},{"ID":6,"TypeName":"TZ-TT03","Model":"TT03","IsDelete":0},{"ID":5,"TypeName":"TZ-TT01","Model":"TT01","IsDelete":0},{"ID":4,"TypeName":"TZ-BT04","Model":"BT04","IsDelete":0},{"ID":3,"TypeName":"TZ-TAG04","Model":"TAG04","IsDelete":0},{"ID":2,"TypeName":"TZ-TT18","Model":"TT18","IsDelete":0},{"ID":1,"TypeName":"TZ-TT11","Model":"TT11","IsDelete":0}]"}

V、Device/Products

URL HTTP Function
/openapi/users/me/products GET Device List
/openapi/users/me/products/:id GET Get device
/openapi/users/me/products POST Add device
/openapi/users/me/products/:id DELETE Delete device
/openapi/users/me/products/:id PUT Modify device
  1. Device List

    GET /openapi/users/me/products

    Parameters

    Name Type Description Required
    PageIndex Int Page Index No
    PageSize Int Page size No
    GroupId Int Group ID No
    Keys Int Keywords No

    For example

    curl http://t-api.tzonedigital.cn/openapi/users/me/products?PageIndex=1&PageSize=1000&GroupId=0&Keys=key&access_token=xxxx -method get

    Return Value

    Name Type Required Description
    PageSize Int Yes Number of page
    PageIndex Int Yes Which page
    TotalCount Int Yes Total amount
    TotalPage Int Yes Pages
    ID Int Yes Product ID
    IMEI String Yes IMEI/SN
    ProductName String Yes Product Name
    TypeID Int Yes Type ID
    GroupID Int Yes Group ID
    GroupName String Yes Group Name
    Description String No Description
    CreateTime Long Yes Create Time
    ExpireTime Long Yes Expire Time
    {"Status":1,"Msg":"","Content":"{"PageSize":1000,"PageIndex":1,"TotalCount":2,"TotalPage":1,"ResultList":[{"ID":20,"IMEI":"06160219","ProductName":"一区","TypeID":8,"GroupID":7,"GroupName":"北京","CreateTime":1470363960000,"ExpireTime":1506583200000,"IsExpire":1,"Description":""},{"ID":19,"IMEI":"866104024649132","ProductName":"TT18_office test 1","TypeID":2,"GroupID":6,"GroupName":"深圳","CreateTime":1470120259000,"ExpireTime":1517781300000,"IsExpire":1,"Description":""}]}"}
  2. Get Device

    GET /openapi/users/me/products/:id

    For example

    curl http://t-api.tzonedigital.cn/openapi/users/me/products/0?access_token=xxxx -method get

    Return Value

    Name Type Required Description
    ID Int Yes Product ID
    IMEI String Yes IMEI/SN
    ProductName String Yes Product Name
    TypeID Int Yes Type ID
    GroupID Int Yes Group ID
    GroupName String Yes Group Name
    Description String No Decription
    CreateTime Long Yes Create Time
    ExpireTime Long Yes Expire Time
    {"Status":1,"Msg":"","Content":"{"ID":20,"IMEI":"06160219","ProductName":"One Time Zone","TypeID":8,"GroupID":7,"GroupName":"Beijing","CreateTime":1470363960000,"ExpireTime":1506583200000,"IsExpire":1,"Description":""}"}
  3. Add Device

    POST /openapi/users/me/products

    Parameters

    Name Type Description Required
    IMEI String Device IMEI/TagID/SN Yes
    ProductName String Device Name Yes
    TypeID Int Type ID No
    GroupID Int Group ID No
    TerminalDataInterval Int Terminal data interval No
    TerminalPassword String Terminal password No
    Description String Description No

    For example

    curl http://t-api.tzonedigital.cn/openapi/users/me/products?access_token=xxxx -method post -body '{"IMEI":"06160219","ProductName":"1 Time zone","TypeID":8,"GroupID":7,"TerminalPassword":"000000","TerminalDataInterval":15,"Description":""}'

    Retuan Value

    {"Status":1,"Msg":"Add successfully","Content":""}

  4. Delete Device

    DELETE /openapi/users/me/products/:id

    For example

    curl http://t-api.tzonedigital.cn/openapi/users/me/products/0?access_token=xxxx -method delete

    Return value

    {"Status":1,"Msg":"Delete Successfully","Content":""}
  5. Modify Device

    PUT /openapi/users/me/products/:id

    Parameters

    Name Type Description Required
    ProductName String Device Name Yes
    TypeID Int Type ID Yes
    GroupID Int Group ID No
    TerminalDataInterval Int Terminal Data Interval No
    TerminalPassword String Terminal Password No
    Description String Description No

    For example

    curl http://t-api.tzonedigital.cn/openapi/users/me/groups/0?access_token=xxxx -method put -body '{"ProductName":"1 Time Zone","TypeID":8,"GroupID":7,"TerminalPassword":"000000","TerminalDataInterval":15,"Description":""}'

    Return value

    {"Status":1,"Msg":"Modify successfully","Content":""}

VI、Device Data/TerminalData

URL HTTP Function
/openapi/terminaldata/realtime GET All device real-time data
/openapi/terminaldata/realtime/:id GET Device real time data
/openapi/terminaldata/history/:id GET Device history data
  1. All device real time data

    GET /openapi/terminaldata/realtime

    Parameters

    Name Type Description Required
    PageIndex Int Page Index No
    PageSize Int Page Size No

    For example

    curl http://t-api.tzonedigital.cn/openapi/terminaldata/realtime?PageIndex=1&PageSize=1000&access_token=xxxx -method get

    Return Value

    Name Type Required Description
    PageSize Int No Number of Page
    PageIndex Int Yes Which Page
    TotalCount Int Yes Total Count
    TotalPage Int Yes Pages
    PID Int Yes Device ID
    Temperature Double No Temperature value,(-1000=none)
    Humidity Double No Humidity value,(-1000=none)
    L_wgs84 String No Latitude and longitude
    L_lbs String No Base station information
    Voltage Double No Voltage value,(-1000=none)
    Battery Int No Battery capacity; estimated by voltage, for reference
    RSSI Int No Signal strength,(-1000=none)
    RTC Long Yes Device uploading time
    ServerTime Long Yes Server receiving data time
    {"Status":1,"Msg":"","Content":"{"PageSize":1000,"PageIndex":1,"TotalCount":1,"TotalPage":1,"ResultList":[{"ID":6,"PID":19,"Temperature":-10.51,"Humidity":55.00,"Voltage":4.13,"Battery":90.00,"RSSI":-1000,"RTC":1470148558000,"ServerTime":1470120433000}]}"}
  2. Device real time data

    GET /openapi/terminaldata/realtime/:id

    For example

    curl http://t-api.tzonedigital.cn/openapi/terminaldata/realtime/0?access_token=xxxx -method get

    Return Value

    Name Type Required Description
    PID Int Yes Device ID
    IMEI String Device IMEI/TagID/SN Yes
    ProductName String Device Name Yes
    TypeID Int Type ID Yes
    GroupID Int Group ID No
    CreateTime Long Yes Create Time
    ExpireTime Long Yes Expire date
    IsExpire Bit Yes Is expire
    Description String No Description
    Temperature Double No Temperature value,(-1000=none)
    Humidity Double No Humidity value,(-1000=none)
    L_wgs84 String No Latitude and longitude
    L_lbs String No Base station information
    Voltage Double No Voltage value,(-1000=none)
    Battery Int No Battery capacity; estimated by voltage, for reference
    RSSI Int No Signal strength,(-1000=none)
    RTC Long Yes Device uploading time
    ServerTime Long Yes Server receiving data time
    {"Status":1,"Msg":"","Content":"{"ID":6,"IMEI":"0006","ProductName":"TH-0006","TypeID":2,"GroupID":5,"CreateTime":1454297116000,"ExpireTime":1457580316000,"IsExpire":1,"Description":"TH-0006","Temperature":"28.25","Humidity":"48","L_wgs84":"","L_lbs":"","Voltage":"0","Battery":"0","RSSI":"--","RTC":1466750223000,"ServerTime":1466750411000}"}
  3. Device history data

    GET /openapi/terminaldata/history/:id

    Parameters

    Name Type Description Required
    PageIndex Int Page Index No
    PageSize Int Page Size No
    BeginTime DateTime Start time, format: yyyy/MM/dd HH:mm:ss UTC time No
    EndTime DateTime End time, format: yyyy/MM/dd HH:mm:ss UTC time No

    For example

    curl http://t-api.tzonedigital.cn/openapi/terminaldata/history/0?access_token=xxxx -method get

    Return Value

    Name Type Required Description
    PageSize Int Yes Number of page
    PageIndex Int Yes Which page
    TotalCount Int Yes Total amount
    TotalPage Int Yes Pages
    ID Int Yes Number
    Temperature Double No Temperature value,(-1000=none)
    Humidity Double No Humidity value,(-1000=none)!
    L_wgs84 String No Latitude and longitude
    L_lbs String No Base Information
    Voltage Double No Voltage value,(-1000=none)
    Battery Int No Battery capacity; estimated by voltage, for reference.
    RSSI Int No Signal strength,(-1000=none)
    RTC Long Yes Device uploading time
    ServerTime Long Yes Server receiving data time
    {"Status":1,"Msg":"","Content":"{"PageSize":1000,"PageIndex":1,"TotalCount":1,"TotalPage":1,"ResultList":[{"ID":6,"Temperature":-10.51,"Humidity":55.00,"L_wgs84":"","L_lbs":"","Voltage":4.13,"Battery":90.00,"RSSI":-1000,"RTC":1470148558000,"ServerTime":1470120433000}]}"}