Below is a guide to assist with setting up API Data Sources and calling them from the Data rule.
<aside> đź’ˇ In this example, I will use the free AlphaVantage stock data API. In practice, you will likely be using your own APIs or third-party data providers relevant to your business.
</aside>
Click on the “Data Sources” link in the left sidebar.
Click on “New Data Source” and select the “API” tab
Using the AlphaVantage API at https://www.alphavantage.co/documentation/#fundamentals, you can use the base URL from that page or the screenshot below, and click “Save”.
Now we will build a simple Ruleset that uses this new Data Source.
When creating the Ruleset and dragging the Blue “Data” rule into your Ruleset, you will then be asked to pick your Data Source. “AlphaVantage Test” should show up in your dropdown list.
To complete the Data rule using an API, you will need a sample of the expected values (JSON response) you would get from the API.
In this example, this can be obtained here: https://www.alphavantage.co/query?function=OVERVIEW&symbol=IBM&apikey=demo
For other third-party APIs, your data vendor should be able to provide a sample. For your own internal API, your engineering team should be able to provide a sample.
example of a filled up Data Call rule.
After clicking the “JSON Schema (click here)” link, you’ll be taken to an external site.
In the left side, paste your API data sample (for this example, the content from the link https://www.alphavantage.co/query?function=OVERVIEW&symbol=IBM&apikey=demo).