I'm using the confluence API. As a response value to the https GET request Suppose you want to get the following data example.
body = {results = [{ope = abc, rest = {user = {results = [{xxx, Id = 12345}]}}, ope = def, rest = {user = {results = [{xxx, Id = 67890}]}}]}
I want to get only Id = 12345 from the above data example. If you specify "body.results.rest.user.results.Id", two Id = 12345 and Id = 67890 will be specified.
If you want to get only the first Id = 12345, you will get it. How should I modify "body.results.rest.user.results.Id"?
Hi @青山 明
Use jq tool to extract data from JSON Body
Please find the reference here for documentation
https://stedolan.github.io/jq/manual/#Basicfilters
Thanks,
Pramodh
In your case, it should be modified as an array to get the data for the first id
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Would you please give me the exact JSON response? I would give an answer to the requirement you need
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Please use the example below.
body = {results = [{ope = abc, rest = {user = {results = [{xxx, Id = 12345}]}}, ope = def, rest = {user = {results = [{xxx, Id = 67890] }]}}]}
How can I modify the smart values below?
{{body.results.rest.user.results.Id}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Could you please include the screenshot of the response so that I can have a look at it please
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Could you please include the answer as well so that it can help others in community!!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.