I managed to put together VBA code that parses specific JSON:
Set S = CreateObject("ScriptControl")
S.Language = "JScript"
S.AddCode "function keys(O) { var k = new Array(); for (var x in O) { k.push(x); } return k; } "
Set JSON = S.Eval("(" & H.responsetext & ")")
Set JSON = CallByName(JSON, "responses", VbGet)
Set JSON = CallByName(JSON, "0", VbGet)
Set JSON = CallByName(JSON, "aggregations", VbGet)
Set JSON = CallByName(JSON, "2", VbGet)
Set JSON = CallByName(JSON, "buckets", VbGet)
Set Keys = S.Run("keys", JSON)
Dim jsonWS As String, jsonAA As String, jsonTS As String
For Each Key In Keys
Set TableRow = CallByName(JSON, Key, VbGet)
jsonWS = CallByName(TableRow, "key", VbGet)
Set TableRow = CallByName(TableRow, "3", VbGet)
Set TableRow = CallByName(TableRow, "buckets", VbGet)
Set TableRow = CallByName(TableRow, "Item 1", VbGet)
jsonAA = CallByName(TableRow, "key", VbGet)
Set TableRow = CallByName(TableRow, "1", VbGet)
jsonTS = CallByName(TableRow, "value_as_string", VbGet)
Next Key
However I ran into a problem. When I run this code it stops at line referencing "Item 1" Set TableRow = CallByName(TableRow, "Item 1", VbGet)
and throws below error:
"Object doesn't support this property or method"
I guess there's a problem when working with names containing spaces. I've tried multiple brackets, quotes, it didn't work. I can't solve this problem as my javascript knowledge is non-existent.
JSON structure looks like: