Hello again,
I have 2 REST calls that need to be made.
Call 1 uses a query in the URL to replace part of its request/URL.
This works fine and I get the intended response and manipulate it to give me a string.
This string from REST 1 now needs to form part of the REST 2 call, to a slightly different request/URL.
I see @Bart has previously spoken about using REST Triggers to store session variables, but I do not know if this would work in my case or what action to call the trigger on.
Example: User visits my-site.com/rest-call?param=abc .
This asset runs: my-api.com/query-param=%globals_get_param%
Returns “12345”
That “12345” needs to form part of second, different REST call: my-api.com/query-2-param={....} <== I need to insert the output from call 1 into this. The “12345” in this example.
I tried using the SSJS of the first call, to run the second call, but I cant work out how to pass the variable, as I can only think of using ‘%globals_asset_contents_raw:my-second-query%?query-2-param=’+firstResult and this runs the second call and returns it before appending the ‘?query-2-param…’ to the end.