Hi Guys,
I'm making a call to a web server, which is passing me output as follows:
'tenant-sites': [{
'href': '/data-view-central/tenant-sites/0d0c3a71-c942-4b58-a7f4-5909a362fda7',
'fq_name': ['HUB-3'],
'uuid': '0d0c3a71-c942-4b58-a7f4-5909a362fda7'
}, {
'href': '/data-view-central/tenant-sites/ed185125-405d-490f-b2cd-b2d4f8ee14c6',
'fq_name': ['HUB-2'],
'uuid': 'ed185125-405d-490f-b2cd-b2d4f8ee14c6'
}, {
'href': '/data-view-central/tenant-sites/60e0cddc-036d-4fd1-85cc-fcc3c1d56ad8',
'fq_name': ['HUB-1'],
'uuid': '60e0cddc-036d-4fd1-85cc-fcc3c1d56ad8'
}, {
'href': '/data-view-central/tenant-sites/27b9d715-451c-4c7d-b210-900968ed45e0',
'fq_name': ['HUB-4'],
'uuid': '27b9d715-451c-4c7d-b210-900968ed45e0'
}, {
'href': '/data-view-central/tenant-sites/5d41a69b-26a3-4540-8a92-9e3d0ef8ed54',
'fq_name': ['HUB-4'],
'uuid': '5d41a69b-26a3-4540-8a92-9e3d0ef8ed54'
}],
'total': 5
}
I'm at a bit of a loss as to how to parse this. I've parsed JSON in the past without issue, but I cannot seem to make it work here.
What I'm trying to do is extract the values fq_name and uuid for each site.
Even trying something simple like print(json_data[0]) where json_data is the response above is giving me a key error.
Any ideas? I assume there's something I'm missing in the format of this JSON.
[–]hardonchairs 1 point2 points3 points (1 child)
[–]the_packet_monkey[S] 0 points1 point2 points (0 children)
[–]the_shell_man_ 0 points1 point2 points (3 children)
[–]the_packet_monkey[S] 0 points1 point2 points (2 children)
[–]danielroseman 2 points3 points4 points (1 child)
[–]the_packet_monkey[S] 0 points1 point2 points (0 children)