Files
-
- 5 KB
- Download
Introduction
In this article, you'll discover how to create a workspace in FME Workbench, the authoring application that accompanies FME Form, with a specific emphasis on utilizing web data. Follow along with the step-by-step instructions to learn how to trigger a workspace with a Creator transformer (no longer required as of FME 2025.2), get data from an API using the HTTPCaller, and then view the data in a human-readable format in Visual Preview.
As of FME 2025.2, many transformers have been updated to not require input from the creator transformer. For a list of all the transformers with this improvement, please see Transformers with an Optional Input Port
A rebranded interface was introduced in FME 2024.0. This tutorial can be used with any version of FME. The concepts are the same, but the screenshot appearances may differ.
In FME 2025.1, the toolbar menu has been organized. Readers and writers can now be found under the Build menu. Additionally, an Add button has been added to the canvas, where sources, destinations, and transformers can be selected.
Source Data
The source dataset is a road closure dataset that can be retrieved via an API.
Step-by-Step Instructions
1. Open a New Workspace
Start FME Workbench, then click the New button.
The FME Workbench canvas is where the workspace will be built using readers, writers, and transformers.
If you are using FME 2025.2+, you can start with the HTTPCaller on your canvas without requiring a Creator and skip to step 3. If you are using FME 2025.1 or older, please continue to step 2.
2. Start (Trigger) the Workflow
Usually, the first step when building a workspace is adding a data source, which triggers the data flow. Interacting with the web is different, and the workspace still needs an initial trigger to initiate the data flow. Instead of a reader, we will add a Creator transformer to the canvas.
Transformers are the building blocks of a workspace for manipulating data, and each has a specific function. There are a few ways to add a transformer to the canvas.
| Click anywhere on the blank canvas and start typing the transformer name to access the quick add menu | |
| Click on the Transformer button on the toolbar | |
| On the top menu bar, click Build > Transformers > Add Transformer |
In the quick add window, type Creator and double-click on the name to add it to your canvas
3. Add an HTTPCaller Transformer
An HTTPCaller transformer makes an HTTP request to a URL within FME. Add an HTTPCaller by typing HTTPCaller on the canvas and pressing Enter on your keyboard.
For FME 2025.1 and older, when the workspace is run (initiated) in a later step, the Creator will send out a null feature to trigger the workspace. For the Creator to trigger the HTTPCaller, they need to be connected. Click and drag from the arrow on the Creator to the HTTPCaller Input port. This connection line sends data from the Creator into the transformer for processing.
For FME 2025.2 and newer, the Creator is not required to trigger the HTTPCaller.
4. Modify Transformer Parameters
The HTTPCaller transformer can access content from a URL, such as an API. In this example, we will get road closure information from an API. Double-click anywhere on the HTTPCaller transformer to open the parameters. Fill in the following fields:
-
Request URL:
https://opendata.vancouver.ca/api/explore/v2.1/catalog/datasets/road-ahead-current-road-closures/records?limit=5 - HTTP Method: GET
The request in this tutorial requires no further parameters; we can leave all the other options as default. Click OK.
5. Run the Workspace
We can now run the workspace, which will GET the response from the road closure API. Click on the green Run button on the top toolbar (ribbon). Clicking Run will trigger the Creator to create a single null feature, and the HTTPCaller will send out a single GET call. The response received back will be stored in a new attribute created by the HTTPCaller called _response_body.
6. View Response
The API response can be viewed in Data Preview within FME Workbench. Click on the green eye icon on the HTTPCaller Output port to view the response.
In FME 2023.2 and prior, the cache icon is a magnifying glass.
In the Data Preview window, you will see a table of attributes. When working with web data, the _response_body contains the response back from the URL accessed, and the _http_status_code will return the status of the call. Double-click on the cell below _response_body to open the response in a larger window.
In the larger window, we can change the syntax highlighting to make the response more human-readable. In the bottom-left corner, click the ABCXYZ button, then select JSON from the drop-down.
Now we can easily see five road closures in Vancouver, British Columbia.
For more information on viewing data, see Data Inspection in FME.
7. Continue Workflow
Since web data varies greatly in structure and format, the following steps after the HTTPCaller will differ.
This API returned data as JSON, so the next step is to parse it into the information we want. See Transforming JSON using the JSONExtractor, JSONFlattener, and JSONFragmenter.
Additional Resources
Other Tutorials in the Getting Started Series
- Getting Started with FME Form: Working with Table/Tabular Data
- Getting Started with FME Form: Working with Databases
- Getting Started with FME Form: Working with Spatial Data
Want to learn about a specific format?
- Tutorial: Getting Started with JSON
- Tutorial: Getting Started with APIs
- Tutorial: Getting Started with XML
Want to continue learning FME Form basics?
- The FME Academy is a guided, on-demand way to learn the entire FME Platform, and it's FREE!
Interested in self-serve and automation?
Have a specific question?
- Reach out to the FME Community
Data Attribution
The data used here originates from open data made available by the City of Vancouver, British Columbia. It contains information licensed under the Open Government License - Vancouver.