HTTP Drop Multi-Find (MGET)


This endpoint allows you to search for Drops within multiple Flows using a single request, and receive a single response containing every result. Use this endpoint to make more efficient, multi-flow queries.

Request data must be sent in the following format:

[
  {
    "flowId": "<flow id 1>",
    "params": {"<optional map of query parameters>"}
  },
  {
    "flowId": "<flow id 2>",
    "params": {"<optional map of query parameters>"}
  }
]

See Drop Find for a list of possible parameters.

Request


MGET https://api.flowthings.io/v0.1/<account_id>/drop

Searches for Drops

Headers

NameDescription
Content-Typeapplication/json
X-Auth-TokenAuthentication Token

Example

[
  {
    "flowId": "f54ad6428d4c6b0419a019285",
    "params": {"limit": 2}
  },
  {
    "flowId": "f54aec5c7d4c6770dba95801b",
    "params": {"filter": "EXISTS elems.a", "limit": 5}
  }
 ]

Response


HTTP Codes

CodeDescription
201Resource Created
400Bad Request
401Unauthorized
503Service Unavailable

Example Response Body

{
  "head": {
    "status": 200,
    "ok": true,
    "messages": [ ],
    "errors": [ ],
    "references": { }
  },
  "body": {
    "f54ad6428d4c6b0419a019285": [ {
      "id": "d54ad9d8bd4c68117a914ba25",
      "flowId": "f54ad6428d4c6b0419a019285",
      "creationDate": 1420664203776,
      "path": "/alice/:inbox",
      "elems": {
        "namespacesAffected": [ "alice" ],
        "kind": "NOTIFICATION",
        "action": "CREATE",
        "details": {
          "summary": {
            "path": "/alice/sensor2"
          }
        },
        "user": {
          "name": "alice",
          "id": "i54ad6428d4c6b0419a01927f"
        },
        "object": {
          "kind": "FLOW",
          "id": "f54ad9d8bd4c68117a914ba24"
        }
      }
    } ],
    "f54aec5c7d4c6770dba95801b": [ {
      "id": "d54aec650d4c6770dba958025",
      "flowId": "f54aec5c7d4c6770dba95801b",
      "creationDate": 1420740176213,
      "path": "/alice/drinks",
      "elems": {
        "a": 2
      }
    }, {
      "id": "d54aec5dcd4c6770dba958020",
      "flowId": "f54aec5c7d4c6770dba95801b",
      "creationDate": 1420740060915,
      "path": "/alice/drinks",
      "elems": {
        "a": 1
      }
    } ]
  }
}

Each of the results is nested beneath the flowId. However, it will return everything in a single arry of drops, the same response you would get from a normal find, if you add the query string flatten=flat to the url:

MGET https://api.flowthings.io/v0.1/<account_id>/drop?flatten=flat

The response will be formatted like this:

{
  "head": {
    "status": 200,
    "ok": true,
    "messages": [ ],
    "errors": [ ],
    "references": { }
  },
  "body": [
    {
      "id": "d54ad9d8bd4c68117a914ba25",
      "flowId": "f54ad6428d4c6b0419a019285",
      "creationDate": 1420664203776,
      "path": "/alice/:inbox",
      "elems": {
        "namespacesAffected": [ "alice" ],
        "kind": "NOTIFICATION",
        "action": "CREATE",
        "details": {
          "summary": {
            "path": "/alice/sensor2"
          }
        },
        "user": {
          "name": "alice",
          "id": "i54ad6428d4c6b0419a01927f"
        },
        "object": {
          "kind": "FLOW",
          "id": "f54ad9d8bd4c68117a914ba24"
        }
      }
    },
    {
      "id": "d54aec650d4c6770dba958025",
      "flowId": "f54aec5c7d4c6770dba95801b",
      "creationDate": 1420740176213,
      "path": "/alice/drinks",
      "elems": {
        "a": 2
      }
    },
    {
      "id": "d54aec5dcd4c6770dba958020",
      "flowId": "f54aec5c7d4c6770dba95801b",
      "creationDate": 1420740060915,
      "path": "/alice/drinks",
      "elems": {
        "a": 1
      }
  } ]
}