MKS_AWS
MKS_AWS

Reputation: 37

Using nifi - I have to invoke an API with multiple API endpoints

I have similar request, I have to invoke an API with multiple endpoints. With the same API key. Example -

  1. https://imwebapi/user_info?Api_Key=XXXXXXXXXXX
  2. https://imwebapi/class_info?Api_Key=XXXXXXXXXXX
  3. https://imwebapi/subject_info?Api_Key=XXXXXXXXXXX
  4. https://imwebapi/grade_info?Api_Key=XXXXXXXXXXX I just dont want to copy/paste my nifi processors multiple times. Is there a way?

Upvotes: 0

Views: 707

Answers (1)

Up_One
Up_One

Reputation: 5271

You can use multiple setups here, and since you have the same key for all api`s you should put this into Variable, parameter context or even as a new attibute.

1 - using attribute : You trigger the flow with generateflowfile >> updateattribute(create the key attribute - that you pass to your url) enter image description here

2 - You ad a variable to you PG / canvas and use it the same way you used the attribute enter image description here

enter image description here 3 - here is how you use the key attribute/variable in yout http request

There are more ways to tackle this, but this would a basic option

Upvotes: 1

Related Questions