-
-
Notifications
You must be signed in to change notification settings - Fork 9
tutorial scheduled rest call
In this tutorial you learn how to create a request/reply flow calling a REST API through a scheduler. We start with the flow created in the Quick Start.
- Like in tutorial1 clone the 'TestFlow'.
- Give the flow the name 'REST'.
- Change the URI scheme of the From endpoint to Scheduler and the Path context to "foo"
- Set the URI option "Delay" to "60000"
This means the connector will run every 60 seconds. Triggering the To endpoint.
-
Set the URI scheme of the To endpoint to REST and the Path context to "get:api/v1/employees"
Tip: Use the Enter key after filling a context value. Alternative use the context editor (blue pencil button) to change context values.
-
Set the URI option "Host" to "http://dummy.restapiexample.com"
As a last step we add a Response endpoint:
- Click in the To endpoint "Add Reponse Endpoint"
- Set the URI scheme of the Response endpoint to FILE and the URI context to "C:\test1"
After the changes you can save the flow.
-
Start the flow 'REST'
-
Check the folder "C:\test1" (after 60 seconds a file with content should appear on disk)
Tip: Check the log file to see what's happing on the background. Administration --> Log viewer.
The REST Component can be used to host a REST endpoint (as a server) or call a REST Endpoint (as a client). More info you can find on the REST Component page.
next tutorial to create simple route.