[cisco-voip] UCCX REST JSON Array Response to String

Brian Meade bmeade90 at vt.edu
Thu Jul 30 17:24:10 EDT 2020


This is probably something Anthony knows off the top of his head but at
least we'll get his answer archived.

I've got a UCCX Script doing a REST Call and the response JSON is actually
an array (indicated by the square brackets) even though it's only one
response.  The resulting String looks like this:
U"[{\"status\":\"Delivered\"}]"

Converting this into a Document then JSON Document seems to not work
properly because of this bracket issue.  The JSON Document ends up looking
like this:
TEXT[[{\"status\":\"Delivered\"}]]"

The GET JSON Document Data step then fails to find anything using the
JSONPath.

To work around it, we used substring to remove the set of square brackets
around the original response string before converting to a Doc which works
and resolves the issue but I'm thinking there's gotta be a better
solution.

I imagine many JSON responses are probably going to contain arrays.  In
this case, we're always getting a single result but I can imagine this
would be an issue where the REST step actually comes back with multiple
items in the array.

Any ideas?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://puck.nether.net/pipermail/cisco-voip/attachments/20200730/8b268f3c/attachment.htm>


More information about the cisco-voip mailing list