Skip to main content
abhai
Silver ⭐️
Feb 19, 2022 4:07 PM UTC
Solved

NiFi design to include REST auth in SQL to JSON to HTTP POST

Hi All.

 

I'm relatively new to NiFi and would like a little help in designing a data flow that looks like this:

 

  1. SELECT from a SQL data source
  2. split/convert to JSON
  3. optionally transform JSON
  4. merge to 500 record batches
  5. POST to target via REST API (requires session token from API auth POST)

I know how to create this flow in NiFi. The part I'm having trouble with is including a step that gets a session token via the REST API auth endpoint. I can get the session token using InvokeHTTP no problem. I just don't know how to add the session token to the flow file(s) containing the data to POST to the API.

 

Thanks for your help.

araujo
araujoAnswer
Platinum ⭐️⭐️⭐️
Feb 20, 2022 11:22 AM UTC

Hi, @abhai ,

 

Please check my response to this question. It may also address yours.

 

Regards,

André

-- Was your question answered? Please take some time to click on "Accept as Solution" below this post. If you find a reply useful, say thanks by clicking on the thumbs up button.

2 replies

araujo
Platinum ⭐️⭐️⭐️
araujoAnswer
Platinum ⭐️⭐️⭐️
Feb 20, 2022 11:22 AM UTC

Hi, @abhai ,

 

Please check my response to this question. It may also address yours.

 

Regards,

André

Translate
-- Was your question answered? Please take some time to click on "Accept as Solution" below this post. If you find a reply useful, say thanks by clicking on the thumbs up button.
abhai
abhaiAuthor
Silver ⭐️
Feb 21, 2022 2:33 PM UTC

Hi @araujo ,

 

This is exactly what I was looking for. Thanks very much!

Translate