HTTP Drop Update


Required Fields


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.

Request


PUT https://api.flowthings.io/v0.1/<account_id>/drop/<flowId>/<dropId>

The above will update a Drop in its entirety. To modify specific object members individually, see Drop HTTP Member Update.

NOTE: Updating a Drop will trigger any Tracks monitoring the Flow in which that Drop resides to reprocess the updated Drop.

Headers

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

Example

PUT https://api.flowthings.io/v0.1/<account_id>/drop/f53c94e310cf2cc0ebb97e8a3/d53c988900cf2fba3c36426ca

{
  "location": {
    "lat": 40.703285,
    "lon": -73.987852
  },
  "elems": {
    "name": "bar",
    "status_codes": {
      "type": "sortedSet",
      "value": [
        {
          "type": "integer",
          "value": 100
        },
        {
          "type": "integer",
          "value": 110
        },
        {
          "type": "integer",
          "value": 100
        },
        {
          "type": "integer",
          "value": 75
        }
      ]
    },
    "stats": {
      "voltage": 15.4,
      "temp": 40.4,
      "uptime": 1992343.4
    }
  }
}

Response


HTTP Codes

CodeDescription
200Resource Updated
400Bad Request
401Unauthorized
503Service Unavailable

Example

{
  "head": {
    "status": 200,
    "ok": true,
    "messages": [
      "Your request has been processed successfully. A resource has been updated."
    ],
    "errors": []
  },
  "body": {
    "id": "d540296740cf2ee54bcc4cf33",
    "flowId": "f540296740cf23301a89a5806",
    "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": 40.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": 100
          },
          {
            "type": "integer",
            "value": 110
          }
        ]
      },
      "name": {
        "type": "string",
        "value": "bar"
      }
    }
  }
}