Resources

The following Resources are available from the FlowWorks WebAPI.

GET Site

Description:

Returns a collection of all sites.

Example URL:

https://developers.flowworks.com/fwapi/v1/<apikey>/sites

Example JSON Response:

{
"requeststatus":1,
"msg":"Request OK.",
"username":"jdoe",
"sites": [
{"id":1,"name":"Bay City Road","longitude":"49.0730927817148","latitude":"-122.316370010375","channels":null},
{"id":2,"name":"Bay City Marina","longitude":"49.0606509305222","latitude":"-122.297401428222","channels":null}]
}

GET site/<siteid>

Description:

Returns a site specified by the siteid parameter and includes the channels.

Example URL:

https://developers.flowworks.com/fwapi/v1/<apikey>/site/1

Example JSON Response:

{
"requeststatus":1,
"msg":"Request OK.",
"username":"jdoe",
"sites":[
{
"id":1,
"name":"Bay City Road",
"longitude":"49.0730927817148",
"latitude":"-122.316370010375",
"channels":
[{"id":22,"name":"Battery voltage","unit":"V"}],
[{"id":28,"name":"Velocity","unit":"ft/s"}]
}]
}

GET site/<siteid>/channel

Description:

Returns a site specified by the siteid parameter and includes the channels.

Example URL:

https://developers.flowworks.com/fwapi/v1/<apikey>/site/1/channel

Example JSON Response:

{
"requeststatus":1,
"msg":"Request OK.",
"username":"jdoe",
"sites":[
{
"id":1,
"name":"Bay City Road",
"longitude":"49.0730927817148",
"latitude":"-122.316370010375",
"channels":
[{"id":22,"name":"Battery voltage","unit":"V"}],
[{"id":28,"name":"Velocity","unit":"ft/s"}]
}]
}

GET site/<siteid>/channel/<channelid>

Description:

Returns a channel specified by the siteid and channelid parameters.

Example URL:

https://developers.flowworks.com/fwapi/v1/<apikey>/site/1/ channel/22

Example JSON Response:

{
"requeststatus":1,
"msg":
"Request OK.",
"username":"jdoe","channels":[{"id":22,"name":"Battery voltage","unit":"V"}]
}

GET site/<siteid>/channel/<channelid>/data/

Description:

Returns all data points for the channel specified by the siteid and channelid parameters.

Example URL:

https://developers.flowworks.com/fwapi/v1/<apikey>/site/1/channel/22/data/

Example JSON Response:

{
"requeststatus":1,
"msg":"Request OK.",
"username":"jdoe",
"datapoints": [
{"date":"2012-01-01T00:00:00","value":12.21},
{"date":"2012-01-01T00:15:00","value":12.21},

{"date":"2012-11-03T14:45:00","value":11.92}]
}

GET site/<siteid>/channel/<channelid>/data/startdate/<date>

Description:

Returns all data points for the channel, in the range between start date, and the current time, as specified by the siteid, channelid, and startdate parameters. The startdate is in the 'yyyyMMddHHmmss' format with the time component being optional.

Example URL:

https://developers.flowworks.com/fwapi/v1/<apikey>/site/1/channel/22/Data/startdate/20120321163000

Example JSON response:

{
"requeststatus":1,
"msg":"Request OK.",
"username":"jdoe",
"datapoints": [
{"date":"2012-03-21T16:30:00","value":12.07},
{"date":"2012-03-21T16:45:00","value":12.07},

{"date":"2012-11-03T14:45:00","value":11.92}]
}

GET site/<siteid>/channel/<channelid>/data/enddate/<date>

Description:

Returns all data points for the channel, in the range between the beginning of time until the end date, as specified by the siteid, channelid, and enddate parameters. The enddate is in the 'yyyyMMddHHmmss' format with the time component being optional.

Example URL:

https://developers.flowworks.com/fwapi/v1/<apikey>/site/1/channel/22/data/enddate/20120101

Example JSON response:

{
"requeststatus":1,
"msg":"Request OK.",
"username":"jdoe",
"datapoints": [
{"date":"2009-08-11T10:30:00","value":12.31},
{"date":"2009-08-11T10:45:00","value":12.31},

{"date":"2012-01-01T00:00:00","value":12.21}]
}

GET site/<siteid>/channel/<channelid>/data/startdate/<date>/enddate/<date>

Description:

Returns all data points for the channel, in the range between the start date, and the end date, as specified by the siteid, channelid, startdate, and enddate parameters. Both date parameters are in the 'yyyyMMddHHmmss' format with the time component being optional.

Example URL:

https://developers.flowworks.com/fwapi/v1/<apikey>/site/1/channel/22/data/startdate/20120403192712/enddate/20120409

Example JSON response:

{
"requeststatus":1,
"msg":"Request OK.",
"username":"jdoe",
"datapoints": [
{"date":"2012-04-03T19:30:00","value":11.89},
{"date":"2009-04-03T19:45:00","value":11.89},

{"date":"2012-04-09T00:00:00","value":11.73}]
}

GET site/<siteid>/channel/<channelid>/data/intervaltype/<type>/intervalnum/<num>

Description:

Returns all data points for the channel in the range specified by the interval type and interval number, for the specified siteid and channelid. This can be used to retrieve the last N intervals of data.

For example, an interval type of ‘D’ and an interval number of ‘7’ would return the data from the past 7 days. An interval type of ‘HH’ and interval number of ‘12’ would return the data from the past 12 hours. Valid interval types are: 'Y', 'M', 'D', 'HH', 'MM', and 'SS'.

Example URL:

https://developers.flowworks.com/fwapi/v1/<apikey>/site/1/channel/22/data/intervaltype/D/intervalnum/7

Example JSON Response:

{
"requeststatus":1,
"msg":"Request OK.",
"username":"jdoe",
"datapoints": [
{"date":"2012-10-27T15:00:00","value":11.98},
{"date":"2012-10-27T15:15:00","value":11.98},

{"date":"2012-11-03T14:45:00","value":11.92}]
}

 

GET site/<siteid>/channel/<channelid>/data/intervaltype/<type>/intervalnum/<num>

Description:

Returns all data points for the channel in the range specified by the interval type and interval number, for the specified siteid and channelid. This can be used to retrieve the last N intervals of data. For example, an interval type of ‘D’ and an interval number of ‘7’ would return the data from the past 7 days. An interval type of ‘HH’ and interval number of ‘12’ would return the data from the past 12 hours. Valid interval types are: 'Y', 'M', 'D', 'HH', 'MM', and 'SS'.

Example URL:

https://developers.flowworks.com/fwapi/v1/<apikey>/site/1/channel/22/data/intervaltype/D/intervalnum/7

Example JSON Response:

{
"requeststatus":1,
"msg":"Request OK.",
"username":"jdoe",
"datapoints": [
{"date":"2012-10-27T15:00:00","value":11.98},
{"date":"2012-10-27T15:15:00","value":11.98},

{"date":"2012-11-03T14:45:00","value":11.92}]
}

 

Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.