Integration with postgres can be used to store data from Apiโs, as well as retrieving data from databases.
Configuration config.json was created using AutoFlow version 0.2.5
Is you have questions about this example, feel free to post your question on the community "Ask Questions" website.
- Create an HTTP Server
- Create an endpoint
- NOTE: under properties the method must be GET
- From the right panel, press Action tab -> communication, Drag and drop HTTP-Request to the end of the flow
- From the right panel, press Action tab -> json, Drag and drop decode to the end of the flow
- From the right panel, press Action tab -> database -> postgres, drag and drop PostgresSQL-Query
- url: Api of which data is being requested
- Method: GET
- Body: blank
- Header: blank
- Query: blank
- Timeout: Default
- Output-location: Drag and drop the request body from right panel
- json: drag drop the request body from right data panel
- At-location: drag and drop the response body from the right panel
Since the data from API is going to change, we need to prep the Postgress query with whatever we get from the API.
To do that we use the String/join action and join the query message with data from the API call.
- json: drag drop the request body from right data panel
- Query: SQL string for entering database
- Address: location of database
- Port: 5432
- Username: username of database server
- Password: password of database server
- Database: Which database to query
- Format: Processed