DATA-INTO when entire JSON Document is an array
Posted: Wed Mar 08, 2023 9:00 pm
I get the following response from an API call. I want to use DATA-INTO to parse it. I've used DATA-INTO with plenty of JSON responses in the past, but this is the first time when the entire document is an array. What would the data structure look like?
On a side note, I can't use "Rel" as a DS subfield as this is apparently a reserved word. I don't actually need the field so I've removed it from the DS and specified "allowmissing=yes" in the data options, but it would be good to know how to handle this in the future.
API Response:
[
{
"Rel": "detail",
"Href": "https://apisandbox.electioapp.com/consi ... 00-0C8-FJX"
}
]
On a side note, I can't use "Rel" as a DS subfield as this is apparently a reserved word. I don't actually need the field so I've removed it from the DS and specified "allowmissing=yes" in the data options, but it would be good to know how to handle this in the future.
API Response:
[
{
"Rel": "detail",
"Href": "https://apisandbox.electioapp.com/consi ... 00-0C8-FJX"
}
]