AnsweredAssumed Answered

REST API Persisted Authentication from Response

Question asked by darren068106 on Feb 16, 2018

Hi

 

I have a REST API which requires three steps outlined below

 

  1. Authenticate
  2. Invoke Method
  3. Sign Out

 

1. We would be creating a HTTP Client Operation with a GET sending through in the resource path to the API the details required e.g. username and password and the output of this connector would contain a JSON format which has a session token to then be used in subsequent requests and in the sign out method

 

{"userID":"USER1","sessionToken":"a05056e2-663a-41db-av22-7fb28b9a5d72","userMiscInfo":null}

 

How best would it be to store this? I have tried using dynamic document properties but it does not persist between each connector because they each return their own set of data. I can't use process properties as it could be running multiple documents within the same execution scope and the value will be inconsistent between each document. Would the best case be to grab and set a unique identifier as a dynamic document property from the source document before going down the branch/execution path to the authenticate API request and then add the response to the document cache and on the next branch where we invoke the API method return the token using the load from cache component?

 

The diagram below shows what I would like to complete but I have tried many different approaches to try and get the format working correctly

 

 

The coloured rectangles indicate data from other branches in the flow. Blue is the original data from the process input. Orange is from the authentication. Green is the original data after it is mapped and outputted to the new format

 

I hope I am making sense with the above. Any input would be appreciated

 

Many thanks

Outcomes