Solved

Try to use HttpCaller for merging APIs

  • 17 March 2020
  • 3 replies
  • 0 views

I´m trying to use api http-url as a data source and merge two APIs.

The url is:

 

https://alpha-nuukaopenapi.azurewebsites.net/api/v1.0/EnergyData/Monthly/ListByProperty?Customer=Helsinki&Record=PropertyCode&SearchString=PROPERTYCODE&ReportingGroup=Electricity&StartTime=01%2F01%2F2019&EndTime=12%2F31%2F2019

 

 

PROPERTYCODE changes and it is read for another data source / table.

 

HTTPCaller I tried to make proper URL call with text editor:

 

Any hints, why this is not working? Thanx!

Please see the attachment:

 

icon

Best answer by debbiatsafe 17 March 2020, 20:36

View original

3 replies

Badge +2

@niilahti First create a URL that works in a browser. Then use that URL in the HTTPCaller. Then start to replace some of the URL parameters with FME attributes, like PropertyCode.

Userlevel 3
Badge +17

Hi @niilahti

The HTTPCaller fails as your query strings are not provided in the format that the API requires. Note that your workspace does not match the screenshot you have provided.

In the workspace you have provided, you did not use @Value(propertyCode) within the URL as shown in your screenshot.

As an additional note, you can move all query strings to the Query String Parameters section. Benefits of this would be not needing to URL encode your strings and better readability. I have attached a workspace demonstrating this approach.

niilahti_json2none_safeSupport.fmw

Big thanx!

Reply