Support Questions

Find answers, ask questions, and share your expertise

From InvokeHTTP Json response value call another InvokeHTTP in apache nifi

avatar
Contributor

Hi Sir,

I am using apache nifi. I have called first InvokeHTTP which provides json response. From json response, I need transactionReference and post another InvokeHTTP using transactionReference with some other value using jsonbody request. Here is the  first InvokeHTTP json response:

    

enam_0-1704198906260.jpeg

Getting transactionReference from above json resposne,  I need to call second InvokeHTTP using  json reqeustbody . Here is second InvokeHTTP  reqeustbody need to send:

{
    "transactionReference": "22229999999",
     "companyAccId": 0,
    "selectedCompanyId":"116",
    "userId":22977,
    "updateSignatoryFlag": 0,
    "sigIdList": [
        22902,
        22903
    ]
}

 

I have tried below like diagram:

enam_1-1704198949571.jpeg

Flow is: Getfile->UpdateAttribute->InvokeHttp->EvaluateJsonPath->UpdateAtribute ->AttributeToJson->InvokeHTTP

Here is Screen shot start from EvaluateJsonPath :

enam_2-1704199251540.jpeg

UpdateAtribute 

enam_3-1704199383634.jpeg

AttributeToJson:

enam_4-1704199453289.jpeg

InvokeHTTP

enam_5-1704199767868.jpeg

My request json not updated. I got first json response. That means I got first invokeHTTP response  when I called second invokeHTTP .

What is wrong of my configuration?

1 REPLY 1

avatar

@enam   I cant see the entire configuration of the second InvokeHTTP so I am not sure if you are passing those new attributes into the HTTP URL.   If you are not doing that, I think the solution you are looking for is to have the AttributesToJson set Destination to FlowFile Content.  Then when you post that to invokeHttp,  those values are seen as the post content.