How to get a token from invokeHTTP to use it in another invokeHTTP without losing the flow content
Hello
I have the following :
- Tomcat server (local)
- Nifi (local)
- customer csv file
In my flow I am getting the file content and transforming it to a json body (the body I need to send it in the API post).
The problem is to use the invokeHTTP processor to send the api (onboard) I need to get a token via another API (auth) and add it in the header of the main api (onboard).

Auth API :
Sends a json to the tomcat :
{
"user_name": "User",
"password": "Password"
}
And get a json with a token valid for 2 min
{
"id": 1,
"user_name": "user",
"token": "eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJzdXBlcmFkbWluIiwidGV...",
"roles": [
"USER",
"ADMIN"
],
"homePage": null,
"priorite": 0
}
The problem is when I pass the customers json to the auth API it will take that json as the body for that API and I lose my customer json.
Is there another way to get the token from the auth API and use it in the onboard API header without losing the customers json (main flow)?




