- 5 Minutes to read
REST API Source Walkthrough
- 5 Minutes to read
The REST River is the place to load the data of any Action to a target table.
A REST River is a “data source to target river” (this is its river type), that its data source is REST.
In order to load data received from an Action in Rivery to a target table in your cloud database, it is necessary to run this Action inside a REST river.
REST River can run any Action in which the type of its result is data or any Multi-action with at least one Action which has results type “data”.
- It is impossible to select Actions or Multi Actions which with results type different than data.
- Data action that will be executed not from a REST River, won’t return the full results, but only a sample. Only when running a “data” result type in the Action REST River, all of its results will be returned.
When running an Action from a REST River, it is possible to update the Action’s variables values. it will run for other values decided by the REST River. A common scenario for that will be running action by date variables. When running that Action from a REST River, we’d like to run each time for the upcoming days and not always for the dates that were configured inside the action.
Another use case can be an Action with one variable that is populated by many values. We can run that action multiple times from multiple REST Rivers, and in each river sending into the Rest river other values.
Therefore, in this case, the Action river is used as a template for pulling data from external APIs into a target.
Create a REST River
- Click on Create new river from any screen in Rivery and select the Data Source to Target option.
- The first step is the General info .
Insert a name for the river and proceed to the next step called Source .
- Go to Step 1 ( Source ) and select the source type called Rest which is located in the section of Toolkits
- After selecting the source REST , its source details will be shown up.
Select the Action River to run in this REST River.
- Click on the list of the Action rivers and search for the required Action to run.
- The list contains all the available Actions and Multi Actions in your Rivery account which the type of its result is Data .
If the selected Action/Multi-Action has variables that are not private, all of those variables will be visible in the REST river (as regular inputs), ready to be updated by the REST River. Leaving those inputs will let the action to run using the values of its original variables.
REST River Mapping
The Action that the REST River executes determines the REST River's columns. As a result, if this action has been modified to return different columns, the Auto mapping in the REST River must be rerun.
To Pick the number of records to automap, follow these steps:
- Click on Additional Options.
- Under Records numbers for mapping stage choose the number of records to automap.
The default value is 1000, and the highest value that may be selected is 10000.
REST River Inputs
After selecting an Action in the REST River, there are 3 types of inputs that might be shown up, according to the variables of the selected Action:
- Note that any of those inputs will be visible only if they were not configured as “private” inside the Action.
Connection - If there is a selected connection in the Action and it was not configured as Private, it will be shown up in the REST River.
In this example, the selected connection in the Action called “mixpanel”.
Click on Edit to update this connection.
- When updating this connection, its new details will affect any other Action and REST River which uses this connection.
Click on New connection to create a new connection.
Leave that input, to let the Action run with its original connection.
The Connection of the Action and the REST River is a Custom connection .
See the custom connection documentation to read about it more.
The details of the connection that was selected in the REST River will be used in the Action. Make sure that the new details are valid and will be accepted by the Action.
DateTime Range variables
if there were configured time period inputs in the Action, the next inputs will be shown up in the REST River:
Start date & End date - those are the selected dates in the Action. The shown values are the original values of the Action. Select any other dates in order to change the dates of the Action.
`After the river runs, the start date will be updated with the end date and the end date will be updated with an empty value, so the next run will run until the time when the river runs. `
Until Running Day - Check this input in order that every run of the river will run send to the Action the current time as the end date.
Last days back - Insert the number of days to move the start date back. If inserting a value, the river will take the start date- 5/1/17 for example - and will move it back - for example, 2 days back, will move the start date to 3/1/17, so this will be the start date the will be sent to the Action.
Interval chunks size - In the case that the service which the Action connects to might have some difficulties in handling requests of large time periods, use the interval chunks in order split the request to smaller requests according to the selected interval.
Interval size - after selecting the interval, it is possible to insert the interval size. For example for a daily interval, and interval size 5, each interval will be 5 days.
Any other variables that were configured in the River.
Each variable of the Action will be presented with its original value (that was configured in the Action). If the variable doesn’t have a value in the Action, it will be empty in the REST River as well.
Insert any other value in any input. Make sure the value is valid and should be accepted by the Action. The values are being passed to the Action exactly as it is written in the REST River.
` Leave any variable (input) in order to let the Action using its own original variables values. `