Introduction
The FlowWorks WebAPI has been created to allow developers to extract site, channel and data point information for their sites using a RESTful web service.
The data is formatted in JSON for quick and easy app development across multiple platforms.
Restrictions and limits
There is a rate limit for each API user to prevent an individual from consuming too may resources. If the rate limit is exceeded, no data will be returned and the response message will indicate the problem. If this is happening frequently, please contact support to discuss your requirements, application, and scenario. In some cases, this limit can be increased.
It’s possible to request a set of data that is too large to return in a single response. The maximum size of a response is capped at ~1.5 million data points. Applications should be checking the response message to see if this has occurred, and then make additional requests by varying the date range to complete the set of data.
Making requests
Requests to the FlowWorks WebAPI use the following basic format:
https://developers.flowworks.com/fwapi/<version#>/<resource>"Additionally, each request will need an Authorization Header in the form of a Bearer token.
- version#
- Refers to the API version you are requesting.
- Bearer Token
- A token you can obtained by sending your FlowWorks credentials to the /tokens resource as a raw json object (see the resources section below for details)
- resource
- Describes the resource you are requesting. For a complete list of available resources, see the Resources section below.
Response Objects
Each response contains the following:
- ResultCode
- A predefined code to represent different exceptions that could happen with the request where 0 represents "OK" and any other value represents different exception codes. This code is generally used for application exceptions. Whenever possible, the api will return also standard http codes.
- Result Message
- A short description explaining the ResultCode value
- Resources
- A collection of the requested resource, if the result code was "OK".
Resources
Tokens
Obtain JWT Tokens used to authenticate with the Web API
API | Description |
---|---|
POST tokens |
Require a new JWT token from the web api. The process to use a JWT token is as follows:
If the token is expired, you will receive a 401 Unauthorized http status code. |
Sites
Query general information about the sites. Also, provides mechanisms to create new sites and channels and send channel data.
API | Description |
---|---|
GET sites?siteNameFilter={siteNameFilter}&siteTypeFilter={siteTypeFilter} |
Gets a list of all of the sites or a filtered list of sites by name |
GET sites/{id} |
Gets a specific site based on the id |
POST sites |
Creates a new site |
POST sites/{id}/channels |
Creates new channels in the corresponding site |
GET sites/{id}/channels |
Gets the channel's part of a specific site. |
GET sites/{id}/channels/{channelId} |
Gets the channel out of an specific site. |
GET sites/{id}/channels/{channelId}/data?startDateFilter={startDateFilter}&endDateFilter={endDateFilter}&intervalTypeFilter={intervalTypeFilter}&intervalNumberFilter={intervalNumberFilter} |
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 or by the interval type and interval number |
GET sites/{id}/data?startDateFilter={startDateFilter}&endDateFilter={endDateFilter}&intervalTypeFilter={intervalTypeFilter}&intervalNumberFilter={intervalNumberFilter} |
Returns all channel's data points for the site, in the range between the start date and the end date, as specified by the siteid, channelid, startdate, and enddate parameters or by the interval type and interval number |
POST sites/{id}/data |
No documentation available. |
POST sites/{id}/channels/{channelId}/data |
No documentation available. |
Channels
Query channels information
API | Description |
---|---|
GET channels/{channelNameFilter} |
Gets a list of channels filtered by name. |
Units
Query channel units information
API | Description |
---|---|
GET units |
Gets a list of valid names for channel units. |
SiteTypes
Query channel units information
API | Description |
---|---|
GET sitetypes |
Gets a list of valid names for site types. |
SiteFiles
API | Description |
---|---|
POST sitefiles/{siteName} |
Attach files to a site using the site's display name. The request "Content-Type" should be set to "multipart/form-data" with the file data in the body of the request. Overall size of the request cannot exceed 25MB. |