Question

Trying to pass location ID into URL for HTTPCaller

  • 11 December 2018
  • 2 replies
  • 1 view

Hi, I'm new to pulling data from an API and looking for some advice.

 

So far I have been able to get part of the JSON data I need from an API using the HTTPcaller and using the JSONFragmentor. I have a header and an API key to access the data.

 

My data now looks like this.

I now need to grab each location id (location id field is "lid") and pass that value into another URL using the HTTPcaller to extract more detailed data for each location.

My end goal is to have the all the data in the above screen cap joined to the additional detailed data that I get from passing the "lid" into the url. Then I can have a point feature for each location "lid" with a complete set of attributes.

 

Any advice would be appreciated. I am just not sure how to pass the "lid" into the URL for each record, then move or loop onto the next record in the dataset.

Thanks

Sherriff


2 replies

Badge +22

There is no need for looping. The JsonFragmentor has produced one feature for every record from the original API request. When you connect the second HTTPCaller, it will be triggered once for every feature that enters.

Set the Request URL to the detailed API endpoint using @Value(lid) in the appropriate place.

ex. https://api.endpoint/getData?id=@Value(lid)

Great, thank you for the help. This was exactly what I need.

 

Sherriff

Reply