HTTP Statistics


The flowthings provides statistics for certain actions by request. For each type, you submit a request for the given type and the id of the resource. Each type represents a time series keyed by the id of the resource you're interested in. For example, "flowDropAdded" contains, for a given flowId, the number or drops added to that flow.

Request


GET https://api.flowthings.io/v0.1/<account_id>/statistics/<statisticType>/<objectId>/<year>/<month>/<day>?level=<level>

Params

  • objectId: the unique identifier for the object you're interested in

  • statisticType: the available statisticTypes for each objectType are as follows:

    • objectType: flow
    • flowDropAdded - for a given flow, when a drop's been added. This can include tracked values.
    • flowTracked - track added to a flow

    • objectType: track

    • trackHit - every time a drop hits a track, tagged by the track id
    • trackPass - every time a drop passes a track, tagged by the track id

    • objectType: identity

    • apiCallByIdentity - number of api calls by this identity
    • dropCreatedBy - drop created, tagged by the identity id of the creator
  • year: The year you're interested in

  • month: The month you're interested in, exclude if you're only examining the year
  • day: The day you're interested in, exclude if you're only examining the month or year
  • level groups the response by time period, available values are 'YEAR', 'MONTH', 'DAY', or 'HOUR'

Headers

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

Example: Drops added to a Flow in January

GET https://api.flowthings.io/v0.1/<account_id>/flowDropAdded/f54ac4aff0cf2e25602c6b882/2015?level=MONTH

Response


HTTP Codes

CodeDescription
200Request Successful
400Bad Request
401Unauthorized
503Service Unavailable
{
  "head" : {
    "status" : 200,
    "ok" : true,
    "messages" : [ ],
    "errors" : [ ],
    "references" : { }
  },
  "body" : [20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
}

Example: Drops added to a flow in January 2015

GET https://api.flowthings.io/v0.1/<account_id>/statistics/flowDropAdded/f54ac4aff0cf2e25602c6b882/2015/1?level=DAY

{
  "body" : [ 0,0,0,0,0,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
}

Example: Drops added to a flow on 6 January 2015

GET https://api.flowthings.io/v0.1/<account_id>/statistics/flowDropAdded/f54ac4aff0cf2e25602c6b882/2015/1/6?level=HOUR

{
  "body":[0,0,0,0,0,0,0,0,0,0,0,0,0,20,0,0,0,0,0,0,0,0,0,0]
}