HTTP is coming to deepstreamHub! Our upcoming HTTP API will allow any HTTP capable programming language or device (so pretty much everything) to read, write and delete records, send events or make RPCs using a simple JSON format.

deepstreamHub and HTTP

Why is this awesome?

  • Because it allows PHP, Ruby on Rails and other Fast CGI languages to be used with deepstreamHub (PHP client coming very soon, watch this space!)
  • Because it allows you to bulk-import thousands of records into deepstreamHub using a single HTTP request
  • Because it allows any website to quickly read a record, send an event or request an RPC via Ajax without having to use the deepstream SDK or establishing a deepstream connection
  • Because it allows swarms of low powered IoT devices to emit stateless updates

How does it work?

Our HTTP API uses a simple standard we call JIF (pronounced squirrel), short for JSON Interchange Format. Every request consists of a header with authentication data and an array of operations, e.g.

{
   "token": "cxsdf-435-ert34-eggd",
   "body": [
      {
         "topic": "record",
         "action": "read",
         "recordName": "item/345"
      },
      {
         "topic": "record",
         "action": "write",
         "recordName": "item/543",
         "data": {
            "description": {"color": "red"}
         }
      },
      {
         "topic": "event",
         "action": "emit",
         "eventName": "message/32",
         "data": {
            "stuff": "happened"
         }
      }
   ]
}

which returns

{
    "result": "SUCCESS",
    "body": [
        {
            "version": 1,
            "data": {
                "name": "Tomato Sauce",
                "price": 3.14
            },
            "success": true
        },
        {
            "versions": [
                -1
            ],
            "error": null,
            "success": true
        },
        {
            "success": true
        }
    ]
}

When can I get it?

The API will be officially released next week’s Friday (June 23rd)