Created 06-25-2023 09:45 PM
Hi Team, I require to pass the json created via JoltTranformJSON into the InvokeHTTP call as the body of the rest api post request, require to authenticate the api call via api key (need to send in the header) and need to get the api call response into a variable in Nifi 1.21.0. Can someone please help on this ?
Thank you
Created 06-26-2023 06:10 AM
Welcome to the community @madhs. @stevenmatison is this something you can provide clarity on?
Created on 06-26-2023 06:51 AM - edited 06-26-2023 08:48 AM
Use an UpdateAttribute processor to add attributes with your header values. i.e. Content-Type with value of application/json and in the InvokeHTTP you'll notice there's a field called Attributes to Send (or something like this... They will be the headers) and list those Accept|Authorize|Any other (it's regular expression so you might have to escape some characters). FlowFile content should be sent as the body.
Created 06-26-2023 09:04 AM
@madhs @joseomjr A great example of the configuration is above.
Here is a full flow definition file/example showing how to get values from JSON and prepare ahead of an InvokeHTTP processor:
Flow Def File:
https://raw.githubusercontent.com/cldr-steven-matison/NiFi-Templates/main/InvokeHttp_Demo_2.json
Created 06-30-2023 05:19 AM
@madhs Have you resolved your issue. If so, please mark the appropriate reply as the solution, as it will make it easier for others to find the answer in the future.