The process is simple:
- Use Assertions to capture the value.
- Set an environment variable to the captured value.
- Use the environment variable in your API calls.
This could be used to set OAuth tokens for use in other calls where a workflow runs every few hours to set the token or refresh the token used in several calls.
In the Assertions section of the API Call Edit tab, you can extract variables from your JSON or XML content and save them to a variable. For more in-depth tutorials on these content types, follow the JSON tutorial here and the XML tutorial here.
Firstly, go to the API call where you want to extract your variables. Scroll to the Assertions section in the Edit tab. From here you can put the JSON path of the variable you want and assign a name for the variable. Save these changes.
Next, create a new API call or use an existing one to set the variable. This example sets the variable 'access_token' to the value set in the previous API call.
Now, you will be able to see the different variables passing between your API calls in your Workflow.
Updated 6 days ago