Skip to main content
Solved

How to download a zip file from an API using HTTPCaller

  • May 19, 2022
  • 2 replies
  • 144 views

a_ericsson
Contributor
Forum|alt.badge.img+3

Hi! I'm trying to download a .zip-file using HTTPCaller. The zip-file is accessed via API by an order number generated when I placed the order for the data.

 

The response body looks like this: [{"href":"https://download-geotorget.lantmateriet.se/download/99d120aa-9532-43a9-a5a7-6128b333bc88/files/root/anlaggningsomrade_kn0125.zip?q=_9yzl22V_4v728pM........"}] (shortened down, was way to long to post here).

 

The 'anlaggningsomrade_kn0125.zip' is what I'm after. Is this possible? Any help is much appreciated 🙂

 

 

Best answer by redgeographics

First you use a HTTPCaller to make that API call that gives you the URL of the zip file. Then a second HTTPCaller to retrieve the file and save it.

 

Depending on what you want to do with it, you can also plug the URL directly in a FeatureReader and have FME process the data that's in the zip file.

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

2 replies

redgeographics
Celebrity
Forum|alt.badge.img+59
  • Celebrity
  • 3699 replies
  • Best Answer
  • May 19, 2022

First you use a HTTPCaller to make that API call that gives you the URL of the zip file. Then a second HTTPCaller to retrieve the file and save it.

 

Depending on what you want to do with it, you can also plug the URL directly in a FeatureReader and have FME process the data that's in the zip file.


a_ericsson
Contributor
Forum|alt.badge.img+3
  • Author
  • Contributor
  • 12 replies
  • May 19, 2022

First you use a HTTPCaller to make that API call that gives you the URL of the zip file. Then a second HTTPCaller to retrieve the file and save it.

 

Depending on what you want to do with it, you can also plug the URL directly in a FeatureReader and have FME process the data that's in the zip file.

Great, thanks!