WebSocket Drop Create

flowId
The Flow where the Drop is to be written.
elems
A map of data elements for the Drop. Values in the map may be of any data type that flowthings.io supports. If the type is not one that JSON supports, it must be supplied. See Drop Data Types for a list of types which must be specified in a {type:..., value:...} mapping.

Optional Fields


location
A location for the Drop. For more on specification options, see Location Data.
fhash
Unique Drop hash value. System generated if Drop is created with fhash as a top-level property. See FHashes for further information.

Request


Example

 {
      "msgId":"my-request",
      "object":"drop",
      "type":"create",
      "flowId":"f53b1d1600cf27b75148de02e",
      "value":{
        "location": {
            "lat": 40.703285,
            "lon": -73.987852
        },
        "elems": {
            "name": "foo",
            "error_rate": 0.15,
            "service_available": true,
            "status_codes": {
                "type": "sortedSet",
                "value": [
                    {
                        "type": "integer",
                        "value": 100
                    },
                    {
                        "type": "integer",
                        "value": 90
                    },
                    {
                        "type": "integer",
                        "value": 100
                    },
                    {
                        "type": "integer",
                        "value": 75
                    }
                ]
            },
            "stats": {
                "voltage": 15.4,
                "temp": 30.4,
                "uptime": 1992343.4
            }
        }
      }
  }

Response


Example

 {
      "head": {
          "msgId": "my-request",
          "ok": true,
          "messages": [
              "Your request has been processed successfully. A new resource has been created."
          ],
          "errors": []
      },
      "body": {
          "id": "d540296740cf2ee54bcc4cf33",
          "flowId": "f53b1d1600cf27b75148de02e",
          "creationDate": 1409455732680,
          "path": "/my_account_id/my_first_flow",
          "location": {
              "lat": 40.703285,
              "lon": -73.987852,
              "specifiers" : {}
          },
          "elems": {
              "error_rate": {
                  "type": "float",
                  "value": 0.15
              },
              "stats": {
                  "type": "map",
                  "value": {
                      "temp": {
                          "type": "float",
                          "value": 30.4
                      },
                      "uptime": {
                          "type": "float",
                          "value": 1992343.4
                      },
                      "voltage": {
                          "type": "float",
                          "value": 15.4
                      }
                  }
              },
              "service_available": {
                  "type": "boolean",
                  "value": true
              },
              "status_codes": {
                  "type": "sortedSet",
                  "value": [
                      {
                          "type": "integer",
                          "value": 75
                      },
                      {
                          "type": "integer",
                          "value": 90
                      },
                      {
                          "type": "integer",
                          "value": 100
                      }
                  ]
              },
              "name": {
                  "type": "string",
                  "value": "foo"
              }
          }
      }
  }