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
- Next i pass all this to my 2nd InvokeHttp processor to call the bulk export. Now, I want to pass this token as the Header and also pass the JSON body to the Invoke HTTP processor. So i just make the following change. Add a dynamic attribute to the InvokeHTTP called "Authorization" and pass value as Bearer ${token} and i believe the body will automatically be taken from the attributes from previous processor.
But the call fails. Is there anything i am missing. I have tried running this through POSTMAN and everything runs fine there.
{"errorCode":"120001","message":"Missing export processes information","status":"400"}which doesnt make sense as this error comes if mode:standalone is missing from request body, but i see that getting passed. Here is the JSONattributes that i see{"mode":"standalone","fileName":"profile.json","format":"json","id":"Profiles"}- Gurvinder