For the “HTTP Call” Widget in Zoom Contact Center flows, there is the option to map a result path to a variable after the HTTP request is completed, however the documentation is lacking and we cannot determine the exact path format that the widget is looking for. Customizing the Http Call widget
The response comes back in a JSON
Hi @emily.garner
The response uses JSON dot Notation.
If you have an array in the JSON, we start counting the first item as number 1 in the JSON dot Notation.
{
"name":"Justin",
"tickets":[
{
"id":"100",
"status:"open"
},
{
"id":"200",
"status:"closed"
}
]
}
name=Justin
tickets.1.status = open
tickets.2.id = 200
@justin.steinberg , just to verify zoom has decided to make arrays ‘1’ indexed instead of ‘0’ indexed like virtually all other programming languages ?
If true, could you work with your documentation folks on items such as ZCC flow, HTTP widget, ZVA HTTP API widget and similar to have that documentation updated to state the return values in json dot notation are ‘1’ indexed
Hi @bvanbenschoten the no-code HTTPCall widget does start at 1 for array items.
When using javascript code in the ‘script’ widget, the items start at 0, to be consistent with traditional programming languages as you mentioned.
I’ll request an example to be added to the HTTPCall widget in the support article.
@justin.steinberg
Thanks, appreciate the response. I was looking all over for that info in the help docs.
it would be really helpful on both the doc for the HTTP widget and the Script widget to show some examples of a typical JSON return and how to map the return variables in the widget themselves.
"0’ indexed for Script widget and “1” indexed for the HTTP widget.
Another related question. There seems to be a difference between the Script widget available in the ZVA Chat flow vs the ZVA voice flow.
The voice flow example javascript code shows supporting the global_var_set, where the chat flow script widget only shows supporting var_set. Is this intentional ? Its a subtle difference but its impactful.