Skip to main content
Solved

Try to use HttpCaller for merging APIs


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:

 

Best answer by debbiatsafe

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

View original
Did this help you find an answer to your question?

3 replies

Forum|alt.badge.img+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.


debbiatsafe
Safer
Forum|alt.badge.img+20
  • Safer
  • Best Answer
  • March 17, 2020

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


  • Author
  • March 17, 2020

Big thanx!


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings