Example

An example Application that demonstrates how to use this Connector to return Sydney's current weather from a REST API operation, can be found below.

You can download the files here to try it out for yourself - adjusting the steps to use your own Restful API details.

Refer to configuration to understand all configuration options of this Agent.

Step 1: Add the Connection

From the Properties blade of the widget to which the REST API Connector will be linked, a data grid in our example, select the Data Source tab.

Click the plus icon next to Data Source, then Connection, and select the REST API Connector.

Step 2: Configure Service Details

Enter the Service Details for the REST API: Base URL, the metadata, and any authorization.

In this case, select the Base Url for the OpenWeather API and upload WeatherMetadata.json for the Metadata File. Keep Use Authentication unchecked.

Step 3: Configure Operation

Select the Operation (defined in the uploaded metadata file). In this case, set the Operation to Get Current Weather.

Step 4: Configure Input Mapping

The Input Mapping grids are populated when an Operation is selected. In this case, set the Lat parameter to -33.86785, Lon to 151.20732, and Appid to your Open Weather API key.

Read this article for instructions to create an Open Weather API key and start using it.

Step 5: Use the Connection

Set the Name to Weather REST API Connector and Save the new Connection.

Enter a name for the Data Source and select the Connection that was just created. In this case, set the Name to Current Weather Info.

Select the Entity to read from the Outputs of the REST API Operation. In this case, select main for the Entity and select any column for the Primary Key. Save the Data Source.

Step 6: Use the Data Source

Select the Data Source we just added for the Grid block and save the Application.

Step 7: Results

Click the Launch button and view the results. Observe that the weather data is returned from the OpenWeather API

Files

See the Import, Export, and Clone - XMPro article for steps to import a Data Stream and Application.

Last updated