Automation Action: Read JSON Document
Parse a JSON document from any URL and assign element values variables.
Parses a Json formatted document from any URL or text/variable and assigns element values to variables.
Parsing Json From Web Responses
Select the Get Json From URL tab to read a Json document from a URL.
Enter the Json Document URL to read. This can be a secure HTTPS URL if required.
If the web resource requires authentication then specify the Authentication method and optionally a User Name/Password or an OAuth Auth Token retrieved from a previous OAuth SignIn action.
The HTTP status code can be assigned to a variable from the Assign Status Code To list.
The full Json text returned from the URL can be assigned to a variable. Select from the Assign Returned JSON To list.
You can also map specific path values to ThinkAutomation variables by entering the Full Path and selecting the variable from the Assign Value To column.
The Full Path entries used when extracting specific attributes can contain %variable% replacements.
Note: The paths used are XPath notation.
Click the Test button to parse the response from current URL or text. This results will be shown in the tree. Click each node to expand the child nodes. The Selected Path & Selected Value entries will show the value for the currently selected Path. You can copy/paste the Selected Path into the Assign grid.
Parsing Json Text
You can also specify any Json text directly instead of reading from a URL. This can be a variable from a previous action. Select the Json Text tab.
Enter or paste the Json text or specify a %fieldname%. When developing your Automation you can paste some sample Json text into the Json Text entry & click Test to parse and view the paths. Then remove the sample Json text or replace it with a %variable% replacement.