- Startup
- Business
- Enterprise
- On-Premise
- Add-on
Overview
Use PULL API to expose a data source as a REST API endpoint.
Any data source which Etlworks can read can be exposed as a REST API endpoint. Read more about available data sources.
PULL API definition
PULL API is a variation of the user-defined API.
Steps to build a REST API
Step 1. Create a new HTTP Listener. Select GET
as the HTTP Method
.
Step 2. Create a Format for the Response
. The following Formats are supported: JSON, JSON Dataset, XML, XML Dataset, CSV, and Fixed Length Text Format.
Step 3. Create a Flow where the Source
is any supported data source and the Destination
is the HTTP Listener ( any to web service
) which was created in Step 1 and the Format created in Step 2.
Step 4. Configure the Source query
, Mapping, and Flow parameters if needed.
Step 5. Schedule an event-driven Flow.
Work with databases
Follow the same steps as you would normally when the source is a database.
Work with files and API endpoints
Follow the same steps as you normally would when the source is a file or API endpoint.
You can define an SQL query that will be executed on the source data object, even if it is a file, web service, or data in key-value storage.
Test the GET API endpoint
Test using Etlworks
Step 1. Create an Etlworks API Connection
Set the following parameters to call the API endpoint:
Endpoint path
: the API endpointMethod
:GET
User
: the user ID of the user with the appropriate permissions to call the particular API (refer to the API docs)Password
: password of the user with the appropriate permissions to call the particular API (refer to the API docs)
Step 2. Use the Etlworks Explorer to browse the API endpoint and view the data.
Test using Postman
Step 1. Create a POST
authentication request in Postman:
URL
:https://app.etlworks.com/rest/v1/token-auth/issue
.Body
:{"login":"user","password":"password"}
. Theuser
andpassword
must be an existing Etlworks user and password.
Step 2. Click Send
.
Step 3. Copy the token body from the response.
Response example:
{
"token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJpc3MiOiJldGx3b3Jrcy5jb20iLCJpYXQiOjE0OTMyNDMwNDQsImV4cCI6MTQ5MzI0MzY0NCwianRpIjoiMjJiMzQ5NjktOTU5MS00NGRlLTg5OTEtOWExMjZiMmNmNDIzIiwic3ViIjoiYWRtaW4ifQ.fgjJRqjPfVSXpgB7o7A6Q7ohYyoWovKZwdvatojx5xBXi1NLJapMVaPyIaJGg3jKdiQDaKPgwYk6daH_nut5vg"
}
Step 4. Create a GET
request in Postman using endpoint configured in Etlworks.
URL
:https://app.etlworks.com/rest/v1/httplistener/patients/123
.
Step 5. Specify that the Authorization
header parameter will have a Bearer
prefix, and pass it to the value received from the response in Step 3.
Example: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJpc3MiOiJldGx3b3Jrcy5jb20iLCJpYXQiOjE0OTMxNjQwNjAsImV4cCI6MTQ5MzE2NDY2MCwianRpIjoiNjc2Nzk5NTgtODQ3OC00Y2MzLWFiOWMtYmJmNjYyYjQxOGNlIiwic3ViIjoiYWRtaW4ifQ.Loxfquv-qjuQRT15eRiunFCFWuWwtZTosrn86ZcWguoPbiiC00toXmFTJ4QqYYgdAHO7QFIEeqqNdgAXwED2lg
.
Step 6. Click Send
.
Comments
0 comments
Please sign in to leave a comment.