curly brackets in JSON response

Dominik's Avatar

Dominik

29 Mar, 2012 10:48 AM

Hello,

We've been using Tender in http://vzaar.com/ and it works really well,
however yesterday I noticed some problems with JSON response I got from Tender while sending a message via our contact form.
It's about "comments_href" piece wich contains curly brackets now, e.g. https://api.tenderapp.com:443/vzaar/discussions/6440118/comments{?p...
I have to escape these brackets now to avoid problem with parsing the URL.
Can you confirm you changed these URLs by adding the brackets?
If so, what is the reason? Will you add brackets to other URLs as well? Can I just escape them?

Thanks,

Dominik

  1. 2 Posted by marc on 29 Mar, 2012 04:08 PM

    marc's Avatar

    That looks like a bug to me and I'm having the same problem. Curlies are not valid uri characters and are unsightly in many other locations.

  2. 3 Posted by marc on 29 Mar, 2012 04:45 PM

    marc's Avatar

    Confirmed that there are many other URIs within the POSTed webhook data which now include what appear to be some sort of template merge fields. Here are some examples:

    ... discussions/6456966/queue?queue={queue_id}
    ... discussions/6456966/change_category?to={category_id}
    ... discussions/6456966/comments{?page}
    ... categories/30142/discussions{-opt|/|state}{state}{-opt|?|page,user_email}{-join|&|page,user_email}
    

    That last one is extra interesting ;)

  3. 4 Posted by Hobson on 29 Mar, 2012 05:26 PM

    Hobson's Avatar

    Those are URI Templates, we describe them in our API introduction article in the knowledge base:

    http://help.tenderapp.com/kb/api/introduction

    In fact, URI templates only recently became RFC 6570:

    http://www.ietf.org/mail-archive/web/ietf-announce/current/msg10098...

    Hope this helps,

    -hobson

  4. 5 Posted by marc on 29 Mar, 2012 08:05 PM

    marc's Avatar

    Ok, that's nice but it appears that the {?page} bit was only just added within the last day or so to the comments_href URI in the new discussion webhook. That breaks our listener.

  5. 6 Posted by Hobson on 30 Mar, 2012 05:46 PM

    Hobson's Avatar

    Sorry we broke your listener. We use URL templates all over the API and didn't think twice about adding them to another URL. As with most of the templated URLs in the API it's possible to ignore the template part.

    Regards,

    -hobson

  6. Amanda closed this discussion on 03 Apr, 2012 06:58 PM.

Discussions are closed to public comments.
If you need help with Tender please start a new discussion.