Skip to content

Latest commit

 

History

History
79 lines (53 loc) · 3.36 KB

README.md

File metadata and controls

79 lines (53 loc) · 3.36 KB

Summary

  • Integrate with Trello API
  • Extract data from Trello
  • Iterate over the data and filter only the relevant

API AutoFlow Version:

Configuration config.json was created using AutoFlow version 0.2.5

Need help?

Is you have questions about this example, feel free to post your question on the community "Ask Questions" website.

Trello integration + Data extraction

Flow overview

  1. HTTP Server
  2. Endpoint (Method: GET)
  3. Action string/join to prepare the URL query with incoming ID
  4. Action communication/http-request to make the HTTP API call to Trello
  5. Action json/decode to make the JSON easier to use
  6. Action data/set to create an empty array for storing the extracted database
  7. Action iteration/for-each to iterate over the Trello data which is in array
  8. Action array/insert-at to insert the extracted data into the array
  9. Action data/set to set the result in the response body

Image

Simulated Mock data

When build API solution, it is easier to mock the data, which makes it easier to build and test the solution.

Image

Step 1. Prepare URL Query

String/join

Here you will notice that we are joining an array with ID coming from the user. Image

Step 2. Make HTTP API Call to Trello

Set the URL to the path that was created from previous string/join action. The query comes from the user which consists of ID, Key, and Token. In our solution, you can simulate that. The returned data is stored in a new variable called "result"

Image

Step 3. Decode JSON data

Trello returns the data in JSON format. We can use the json/decode action to put the data in a more accessible format.

Image

Step 4. Create (declare) empty array

Array is commonly used to structure extracted data. Before we iterate over the Trello data, we use data set to delcare/create an empty array.

Image

Step 5. Iterate over Trello data

Notice that decoded Trello data was saved in a variable called "result_decoded". Each element's index and value are stored in index and value variables respectively.

Image

Step 6. Insert only the relevant data

As the Trello data is iterated, array/insert-at action inserts the selected data into the "sorted" array that was created earlier

Image

Step 7. Set data to response body

To make the data available, data/set action is used to set data in the response body.

Image

Configuring Trello API

For Additional help on Trello API: https://developer.atlassian.com/cloud/trello/guides/rest-api/api-introduction/

Get Trello Key (you must be signed in) https://trello.com/app-key