GuidesChangelog
Guides

Introduction to data sinks and FLOW Insights' public API

Learn how sinks and FLOW's public API can help you receive traffic data in your own application quickly and on demand.

FLOW is an open platform. It was designed to easily interact with third-party applications and devices through HTTP and UDP protocols. These advanced guides will show you how you can integrate your own solution with it. If you're not familiar with FLOW and FLOW Insights, we recommend reading the introductory articles first.

If you’re interested in receiving the output of any FLOW operator in your own application, you first need to set this up in a client application like FLOW Insights. Consider the following setup:

1176

There’s a zone spatial filter named ZONE 1 on one of the lanes on the left. It considers only traffic objects that are within the marked zone in a given time frame. Any operator lets you assign a sink to it. This lets the server know that you intend to query for the operator’s output. Simply drag the desired sink type onto the filter.

1176

Then you can define the sink’s name and select an attribute the sink will be tied to.

708

Select Apply settings and the sink will be assigned.

640

Afterward, any client application can start communicating and querying the server as long as it's done right. There are two types of sinks based on the way data is obtained from them.

REST sinks

With REST sinks, your applications would use the HTTP protocol to send queries to the server and obtain responses. FLOW API conforms to the style and constraints of REST and message bodies use the JSON syntax. For example, the distribution sink shown above lets you retrieve a color or category distribution of trajectories that pass through the corresponding operator.

Learn the basics of authentication and communication with FLOW's REST API in the next guide.

Then learn more about REST sinks.

To handle any errors that you might encounter, see the Error reference.

UDP sinks

UDP sinks let applications subscribe to their output via the UDP protocol. All status updates are automatically sent to every device that has subscribed until a timeout expires. Therefore UDP sinks are suitable in applications where it’s critical to know about every situation update as fast as possible. Some UDP sinks also support the query-response mode of communication, but options regarding the types of outputs are not as wide. Learn more about UDP sinks.

Webhooks

With webhooks, you can have widget data sent to your server automatically each time its value changes. Its output is very similar to REST sinks. Learn more about them here.