Viddler

Daily features, announcements, and much more!

We’ve added JSONP as a response format to the Viddler API

Published February 27, 2012 by Jeff Johns in Announcements,Development

We have recently updated our API to optionally respond using JSONP (JSON with padding). Using JSONP developers can call our API from the client-side using JavaScript.

With this response format you do not need to include a callback method. We will always send all responses back to a method named ‘jsonViddlerAPI’. We will call this method with one argument which will be the JSONP response from the API.

Below is a quick example to illustrate what you can do with JSONP using JavaScript. This example also uses jQuery but can be adapted to use whatever JavaScript framework you need.

Example

Just as we can specify XML, JSON, or PHP you’ll notice that the extension has changed to ‘jsonp’ within the API end-point URL: http://api.viddler.com/api/v2/viddler.api.getInfo.jsonp

Now all you’ll need to do is make sure the ‘jsonViddlerAPI’ JavaScript method exists in your codebase and is called after the response.

*NOTE: Since you are calling this on client-side please don’t expose any of your personal information, it is easily viewable. Also note that your API key will be viewable as well.

1 Comment Share on Twitter

1 Comment

RSS feed for comments on this post.

  1. Juliy says

    February 28, 2012 - 3:29 pm

    ????????? ????, ????????? ???????, ????????? ????, ??????? ?????????, ????????????? ????????, ????????? ???????, ?????????, ????????? ????????


Sorry, the comment form is closed at this time.