Reading JSON from HTTPGet

Hey guys,
New user, been trying to wrap my head around vvvv, for what should be a simple use case.
I’m trying to use an HTTP Get to return a JSON result from ProPresenter, and it’s been incredibly frustrating.

I’ve spent hours on it, and the furthest I’ve gotten is getting a JSON result in Base64, with no way to convert it into regular JSON. I’ve tried serializing, decoding, 3 different AI engines (all of whom recommend non-existent nodes), and every Github and forum post I can find.

What am I missing?

The gibberish is Base64 of the JSON result, and should look something like this:


{
  "current": {
    "text": "Amazing Grace, how sweet the sound\nThat saved a wretch like me.",
    "notes": "Start quiet, leave open",
    "uuid": "1C43092A-B254-45F0-8F8A-9A8FEE26F4DE"
  },
  "next": {
    "text": "I once was lost, but now I'm found\nWas blind, but now I see.",
    "notes": "Build from last chord",
    "uuid": "242BAEBB-FAC5-4B7B-A19D-F4C09A66D711"
  }
}

Here’s the relevant ProPresenter API docs, but it’s just a simple JSON call. Nothing fancy.

Yo,

Which FromBytes are you using?

You should the Primitive.String version, which is available when you enable the Advanced nodes by pressing TAB with the node browser open.

Let us know if that works!

ciao

Ah, that did it.
Both FromBytes use the Primitive version, however I was using the Base64 version.

OK, another problem: how do I pull out the text value?

All the relevant nodes are giving errors about being too Generic, or how they have many compatible implementations.

How do I fix either of those errors?

Does it work when you connect a String IOBox to the XPathGetValue node output?

@jgale for the generic nodes (like XPathGetValue) the type will be defined automatically once you connect an IOBox to their outlet (as @chk mentioned).

Regarding the implementation there are several ways to go, or at least two in VL.

you can always take in account the XPath syntax (when working with xpath nodes) like here

feel frree to check this quick example which assumes that you acquired a json file:

json_to_xml_getvalue.vl (8.4 KB)