1

I try to access the historian information from bluemix IoTF. The official documentation describes the REST call here:

https://docs.internetofthings.ibmcloud.com/swagger/v0002.html#!/Historical_Event_Retrieval/get_historian

So the result should be like this:

{
 "bookmark": "string",
 "events": [
  {
   "device_id": "string",
   "device_type": "string",
   "evt_type": "string",
   "timestamp": {
     "$date": 0
   },

but it is like this:

{
 "events": [
 {
   "device_id": "bluefish",
   "device_type": "esp8266",
  "evt_type": "tank",
  "timestamp": {
    "$date": 1447262923695
  },
  "evt": {
    "heater": "92",
    "westCloud": "70",
    "plateTemp": "27.50",
    "moon": "27",
    "centerCloud": "70",
    "waterTemp": "26.69",
    "eastCloud": "70"
  }
 },

which looks like the V1 version of the API call but I call the V2 version:

https://5rn7ip.internetofthings.ibmcloud.com:443/api/v0002/historian/?start=1447200000000&end=1447286399165

The query should return more then 100 entries so the bookmark is really necessary to access the rest of the data.

Is there a problem in the IoTF or do I do something wrong?

2 Answers2

2

is there not a bookmark at the end of the JSON response ?

Although the order in the swagger docs suggests that bookmark comes first before the events, you should not rely on this as JSON objects are an unordered set of name/value pairs and so ordering from serializer to serializer will vary and parsers should not infer anything from the order.

http://www.json.org/

I've tested it locally and bookmarks are created for responses containing more than 100 entries, but the bookmark appears at the end of the JSON object.

Paul Slater
  • 451
  • 3
  • 6
1

We currently have a defect open for historian not matching the swagger doc. We will investigate further based on your results.

ValerieLampkin
  • 2,620
  • 13
  • 27