View Channel

Overview

The View Channel call is used to retrieve the metadata and last sensor data associated with a specific channel. In the majority of cases each channel is a separate sensor device.

API URL

https://webapi.ubibot.com/channels/CHANNEL_ID?parameters

Where CHANNEL_ID is the ID of the target channel.

HTTP Method

GET

URL Parameters

Name Type Required Description
api_key or account_key String Required for private channels Specify the API write key or read key of the channel or the account_key obtained from the web console panel.

Response

An HTTP code of 200 is responded for each successful data requests. The message body contains a JSON object listing the metadata for the specified channel.

Error: See the separate list of error codes for more details.

The field value of “write_key” can be used to update Channel Feed.

Response Parameters

Data Field Description
public_flag Device Public Permissions
usage Device Used Space
size_storage Total Plan Space
traffic_in Device Upload Traffic
traffic_out Device Download Traffic
size_out Plan Traffic Limit
last_values Last Sensor Value
last_entry_date Last Sync Time
last_ip Last Synchronised IP Address
name Channle Name
channel_id Channle ID
field1, field2….field10 Name of each field (sensor name)
net 0: offline, 1: online, 2: unknown, -1: manually uploaded
vconfig Content of each field (with values, units and other information), corresponding to the sensor name

Examples

GET https://webapi.ubibot.com/channels/123?account_key=xxxxx-xxxxx-xxxxx-xxxx

This returns a JSON object listing all the metadata for the specified channel. For example:

{“
 result”: ”success”,
 ”server_time”: ”2017 - 08 - 20 T10: 01: 54 Z”,
 ”channels”: [{“
 channel_id”: ”123″,
 ”field1″: ”\u6e29\ u5ea6″,
 ”field2″: ”\u6e7f\ u5ea6″,
 ”field3″: ”\u5149\ u7167″,
 ”field4″: ”\u7535\ u91cf”,
 ”field5″: ”\u4fe1\ u53f7\ u5f3a\ u5ea6″,
 ”field6″: ”\u52a0\ u901f\ u5ea6″,
 ”field7″: ”\u6572\ u51fb”,
 ”field8″: ”\u5916\ u63a5\ u6e29\ u5ea6″,
 ”field9″: ”\u95e8\ u78c1″,
 ”field10″: null,
 ”latitude”: null,
 ”longitude”: null,
 ”name”: ”\u8bbe\ u5907 395″,
 ”public_flag”: ”false”,
 ”tags”: null,
 ”url”: null,
 ”metadata”: ”{\”
 fn_th\”: 60,
 \”fn_light\”: 60,
 \”fn_mag\”: 0,
 \”fn_mag_int\”: 2,
 \”fn_acc_tap1\”: 0,
 \”fn_acc_tap2\”: 0,
 \”fn_acc_act\”: 0,
 \”fn_acc_min\”: 5,
 \”fn_bt\”: 0,
 \”fn_ext_t\”: 300,
 \”fn_battery\”: 3600,
 \”fn_dp\”: 600,
 \”cg_data_led\”: 1
 }”,
 ”description”: null,
 ”traffic_out”: ”0″,
 ”traffic_in”: ”0″,
 ”created_at”: ”2017 - 07 - 11 T03: 17: 44 Z”,
 ”updated_at”: ”2017 - 07 - 11 T03: 17: 44 Z”,
 ”usage”: ”549397″,
 ”last_entry_id”: ”15403″,
 ”last_entry_date”: ”2017 - 07 - 14 T06: 41: 27 Z”,
 ”product_id”: ”ubibot - ws1 - cn”,
 ”device_id”: ”4 b1fca94ad758faab349bbd7a01cf00ea39e8ba4″,
 ”channel_icon”: null,
 ”last_ip”: ”175.171 .43 .88″,
 ”attached_at”: ”2017 - 07 - 11 T03: 17: 44 Z”,
 ”firmware”: null,
 ”serial”: ”E57 ** * WS1″,
 ”size_out”: ”5368709120″,
 ”size_storage”: ”1073741824″,
 ”plan_code”: ”ubibot_1g”,
 ”plan_start”: ”2017 - 07 - 11 T03: 17: 44 Z”,
 ”plan_end”: null,
 ”bill_start”: ”2017 - 08 - 10 T03: 17: 44 Z”,
 ”bill_end”: ”2017 - 09 - 09 T03: 17: 44 Z”,
 ”last_values”: ”{\”
 field1\”: {\”
 value\”: 26.220337,
 \”created_at\”: 1500014464
 },
 \”field3\”: {\”
 value\”: 0.4,
 \”created_at\”: 1500014464
 },
 \”field4\”: {\”
 value\”: 2.901859,
 \”created_at\”: 1500013142
 },
 \”field2\”: {\”
 value\”: 57,
 \”created_at\”: 1500014464
 },
 \”field5\”: {\”
 value\”: -49,
 \”created_at\”: 1500014484
 },
 \”field9\”: {\”
 value\”: 1,
 \”created_at\”: 1499749687
 },
 \”field8\”: {\”
 value\”: 25.6875,
 \”created_at\”: 1500014396
 }
 }”,
 ”vconfig”: ””,
 ”net”: ”0″,
 ”c_icon_base”: null
 }]
}