Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I am trying to build a job that will take a json list of (books: genre, url) and loop through each result to call an api by passing the url to a tRest component. The resulting json needs to be saved using the genre as the file name.
I can call individual tRest objects and save the json but I want to make this work in 1 job looping through a list of apis.
* The NYTimes apis are free and you can register here ( https://developer.nytimes.com/apis )
* Sorry json that I'm trying to loop through doesn't paste well.
{
"Books": [
{
"Genre": "Hardcover-Fiction",
"url": "https://api.nytimes.com/svc/books/v3/lists/current/hardcover-fiction.json?api-key=<--secret access key-->"
},
{
"Genre": "Trade-Fiction-Paperback",
"url": "https://api.nytimes.com/svc/books/v3/lists/trade-fiction-paperback?api-key=<--secret access key-->"
},
{
"Genre": "Paperback-Nonfiction",
"url": "https://api.nytimes.com/svc/books/v3/lists/paperback-nonfiction.json?api-key=<--secret access key-->"
}
]
}
Hello
You can use tFlowToIterate to iterate each URL extracted from JSON string and pass the current URL to tRest for next API calling. You can learn how to use tFlowToIterate component and how to access the current URL on tRest by reading this scenario: Transforming data flow to a list.
Let me know if you still have any questions.
Regards
Shicong
Hello
You can use tFlowToIterate to iterate each URL extracted from JSON string and pass the current URL to tRest for next API calling. You can learn how to use tFlowToIterate component and how to access the current URL on tRest by reading this scenario: Transforming data flow to a list.
Let me know if you still have any questions.
Regards
Shicong