Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

how can I use invokehttp to get web api data with dynamic paramter in Apache Nifi?

Highlighted

how can I use invokehttp to get web api data with dynamic paramter in Apache Nifi?

Contributor

I want to get data from web api, which date parameter is dynamic; I don't know how to generate the dynamic url for invokehttp incoming.

4 REPLIES 4

Re: how can I use invokehttp to get web api data with dynamic paramter in Apache Nifi?

Hi @awen hu,

Some properties of the InvokeHTTP processor support the use of expression language. It allows you to get attributes from incoming flow files and also to manipulate dates. It should allow you to get what you want.

Expression language : https://nifi.apache.org/docs/nifi-docs/html/expression-language-guide.html

Re: how can I use invokehttp to get web api data with dynamic paramter in Apache Nifi?

Contributor

Hi Perre Villard,

Thanks for your help. My question is how to generate the dynamic url in the incoming flow files now. Do you have a sample?

Re: how can I use invokehttp to get web api data with dynamic paramter in Apache Nifi?

It depends of the URL you want to query... you tell me that it depends of dates and you can dynamically generate dates using expression language. It'd be easier to help you if you could give more details about what you want to achieve.

Re: how can I use invokehttp to get web api data with dynamic paramter in Apache Nifi?

New Contributor

I have a similar problem.

My HTTP query takes a sequence number as a parameter. Inside the HTTP response body, the highest found sequence number has to be extracted and be stored somewhere.

The next run should then use this value as the new sequence number.

How can I persist and access values between runs?