Reputation: 3
I am trying to build an automated flow to export profiles from a SaaS cloud platform where I have all the REST APIs. Here is what I am doing
Login to login API to get token (I have been able to successfully do that using InvokeHttp processor). I get the token in the response JSON as follows
{ "access_token" : "<some_token_value>", "links" : [ { "rel" : "self", "href" : "https://ccadmin-xxxx.oracleoutsourcing.com/ccadmin/v1/login" } ], "token_type" : "bearer", "expires_in" : 300 }
I extract the token from the JSON using EvaluateJSONPath and add dynamic property "token" to map to access_token of the JSON response I got. The output of evaluateJsonPath is an attribute "token" which has the value of access_token from step 1.
Now i am preparing a BODY for the next POST call, so i use UpdateAttribute processor to define my attributes.
Next i convert the attributes that i define in the previous step to JSON using AttributesToJSON processor. This adds the following to the attributes path in its output
JSONAttributes
{"mode":"standalone","filename":"profiles.json","format":"json","id":"Profiles"}
Also the token from step 1 still flows as an attribute
But the call fails. Is there anything i am missing. I have tried running this through POSTMAN and everything runs fine there.
Input to 2nd InvokeHttp Processor
Second InvokeHttp POST processor
Upvotes: 0
Views: 1779
Reputation: 3
I think i got the issue. i see all the things are flowing as attributes in the flow. The body needs to flow as content. so i cut short the UpdateAttribute and AttributeToJSON and instead put a ReplaceText processor and put the JSON body there. And i am able to make a successful call now.
Upvotes: 0