Support Questions

Find answers, ask questions, and share your expertise

InvokeHTTP Post Activity

avatar
Contributor

I need immediate help for the below use case:

To perform POST activity with one of the system we have to follow the below steps:
Step 1: Request a Token: To obtain a token by submitting an Authenticate request.

The authentication request must be sent to http://today/authentication/v1/login using the GET method. The request header must contain an Authorization header in the following format:
Authorization: Basic <EncodedCredentials>   where <EncodedCredentials> is the Base 64 encoded string for the credentials in the following format:
<username>:<password>

The token expiry is stored in the Authenticate response header.

 

Step2: To Call subsequent API request:
With a request token in hand, you can now submit a request (example: Create Projects) to update data to System
We must include your access token in the Authorization header of every request.

The authorization header must look like this:

Authorization: System <TokenValue>
...where <TokenValue> is the token obtained from the authentication call.

My query is that How to pass both the details (Authorization Key which is output from one processor and BODY part which we get from GetFile processor) to a single InvokeHTTP processor.

 

Looking for early Response.

Thanks in advance.

2 REPLIES 2

avatar
Master Mentor

@midee 

So the output from first invokeHTTP is your token response.
You could use the PutdistributedMapCache processor to write that token to a cache entry
Then in your other flow with the GetFile processor, you send success to a FetchDistributedMapCache processor to retrieve that token and write it to an attribute (token for example) on this FlowFile.

Now you have your token in an attribute on the same FlowFile that has your content for the next invokeHTTP processor in your flow

If you found this addressed your query, please take a moment to login and click "Accept" on this solution.
Thank you,
Matt

avatar
Community Manager

@midee 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. 

Screen Shot 2019-08-06 at 1.54.47 PM.png

 

 


Cy Jervis, Manager, Community Program
Was your question answered? Make sure to mark the answer as the accepted solution.
If you find a reply useful, say thanks by clicking on the thumbs up button.