JSON for RenderParameters?

12 views
Skip to first unread message

existdissolve

unread,
May 31, 2011, 8:23:46 PM5/31/11
to Aviary API
Hey guys--

Quick qn: can the RenderParameters argument of the Render() method
take a JSON string? I think I remember that in the former version of
the docs the spec said to send through an XML string of parameters
(e.g., parameters -> parameter: id value).

The XML still works of course, but am wondering if there's support for
JSON instead? I've tried several iterations of JSON, but with no luck.
My app is currently running all JSON except for this one bit, so it
would be awesome if I could use it here too.

If it already does support JSON, could you post an example of a valid
RenderParameters argument?

Thanks!

Ari Fuchs

unread,
Jun 2, 2011, 12:20:04 PM6/2/11
to avia...@googlegroups.com
Hey there! it does indeed accept JSON. Below is a sample for reference:

xml version:

<filtermetadata>
<parameter uid="0" value="true"></parameter>
<parameter uid="1" value="true"></parameter>
<parameter uid="2" value="true"></parameter>
<parameter uid="3" value="true"></parameter>
<parameter uid="4" value="true"></parameter>
</filtermetadata>

json version:

"filtermetadata":
    {
        "parameters":
        {
            "parameter":
            [
                {
                    "@uid":"0",
                    "@value":"true"
                },
                {
                    "@uid":"1",
                    "@value":"true"
                },
                {
                    "@uid":"2",
                    "@value":"true"
                },
                {
                    "@uid":"3",
                    "@value":"true"
                },
                {
                    "@uid":"4",
                    "@value":"true"
                }
            ]

existdissolve

unread,
Jun 2, 2011, 10:42:18 PM6/2/11
to Aviary API
Awesome--that did the trick--thanks!!

On Jun 2, 12:20 pm, Ari Fuchs <a...@aviary.com> wrote:
> Hey there! it does indeed accept JSON. Below is a sample for reference:
>
> *xml version:
> *
>
> <filtermetadata>
> <parameter uid="0" value="true"></parameter>
>  <parameter uid="1" value="true"></parameter>
> <parameter uid="2" value="true"></parameter>
>  <parameter uid="3" value="true"></parameter>
> <parameter uid="4" value="true"></parameter>
> </filtermetadata>
>
> *json version:*
Reply all
Reply to author
Forward
0 new messages