oEmbed

Introduction

oEmbed is an open format which standardizes the process of embedding photos, videos, links, or other media. It allows web sites to quickly and easily embed media when a user posts a link directly to that resource. The link will retrieve the embed code automatically from that resource.

You can read more on oEmbed here.

We are supporting oEmbed to allow users to embed polls, surveys and ratings into their page in a standardized way. You need to include the url to the embed resource you want and the format you want the oEmbed response to be in. We provide JSON and XML oEmbed responses.

Polls

The poll oEmbed call will accept the following arguments.

  • url, the URL to the embed resource ( in this case a poll )
  • format, the format of the oEmbed response ( json/xml )

This is an example of a call for a poll embed…
http://polldaddy.com/oembed/?url=http%3A//polldaddy.com/poll/7012505/&format=xml

The XML response for this is…

<oembed>
<type>rich</type>
<version>1.0</version>
<provider_name>Polldaddy</provider_name>
<provider_url>http://polldaddy.com</provider_url>
<title>Pick your top 3 holidays...</title>
<html>
<script type="text/javascript" charset="utf-8" src="http://static.polldaddy.com/p/7012505.js"></script><noscript><a href="http://polldaddy.com/poll/7012505/">Which design do you prefer?</a></noscript>
</html>
</oembed>

The JSON response is…

{"type":"rich","version":"1.0","provider_name":"Polldaddy","provider_url":"http:\/\/polldaddy.com","title":"Pick your top 3 holidays...","html":"<script type=\"text\/javascript\" charset=\"utf-8\" src=\"http:\/\/static.polldaddy.com\/p\/7012505.js\"><\/script><noscript><a href=\"http:\/\/polldaddy.com\/poll\/7012505\/\">Which design do you prefer?<\/a><\/noscript>"}

Surveys

The survey oEmbed call will accept the following arguments.

  • url, the URL to the embed resource ( in this case a survey )
  • format, the format of the oEmbed response ( json/xml )
  • link_text, the text used in the link to the survey pop-up

This is an example of a call for a survey embed…
http://polldaddy.com/oembed/?url=http%3A//polldaddy.com/s/ADF2AB9E60258D2A/&format=xml&link_text=Please%20take%20my%20survey!

The XML response for this is…

<oembed>
<type>rich</type>
<version>1.0</version>
<provider_name>Polldaddy</provider_name>
<provider_url>http://polldaddy.com</provider_url>
<title>Customer Survey</title>
<html>
<script type="text/javascript" src="http://i0.poll.fm/survey.js" charset="UTF-8"></script> <noscript><a href="http://davidlenehan.polldaddy.com/s/ADF2AB9E60258D2A">Take Our Survey!</a></noscript> <script type="text/javascript"> polldaddy.add( { type: 'iframe', auto: true, domain: 'davidlenehan.polldaddy.com/s/', id: 'ADF2AB9E60258D2A' } ); </script>
</html>
</oembed>

The JSON response is…

{"type":"rich","version":"1.0","provider_name":"Polldaddy","provider_url":"http:\/\/polldaddy.com","title":"Customer Survey","html":"<script type=\"text\/javascript\" src=\"http:\/\/i0.poll.fm\/survey.js\" charset=\"UTF-8\"><\/script>\n<noscript><a href=\"http:\/\/davidlenehan.polldaddy.com\/s\/ADF2AB9E60258D2A\">Take Our Survey!<\/a><\/noscript>\n<script type=\"text\/javascript\">\n  polldaddy.add( {\n    type: 'iframe',\n    auto: true,\n    domain: 'davidlenehan.polldaddy.com\/s\/',\n    id: 'ADF2AB9E60258D2A'\n  } );\n<\/script>"}

Ratings

The rating oEmbed call will accept the following arguments.

  • url, the URL to the embed resource ( in this case a survey )
  • format, the format of the oEmbed response ( json/xml )
  • unique_id, a unique identifier you can use to recognise the rating in the reports
  • title, used to help clarify the reports
  • permalink, used to help clarify the reports

This is an example of a call for a rating embed…
http://polldaddy.com/oembed/?url=http%3A//polldaddy.com/ratings/39/?format=xml&unique_id=123&title=Super%20Rating&permalink=http%3A//blog.polldaddy.com

The XML response for this is…

<oembed>
<type>rich</type>
<version>1.0</version>
<provider_name>Polldaddy</provider_name>
<provider_url>http://polldaddy.com</provider_url>
<html>
<div id="pd_rating_holder_39"></div><script type="text/javascript">PDRTJS_settings_39 = {"id":39,"unique_id":"123","title":"Super Rating","permalink":"http:\/\/blog.polldaddy.com"};</script><script type="text/javascript" src="http://i0.poll.fm/rating/rating.js"></script>
</html>
</oembed>

The JSON response is…

{"type":"rich","version":"1.0","provider_name":"Polldaddy","provider_url":"http:\/\/polldaddy.com","html":"<div id=\"pd_rating_holder_39\"><\/div><script type=\"text\/javascript\">PDRTJS_settings_39 = {\"id\":39,\"unique_id\":\"123\",\"title\":\"Super Rating\",\"permalink\":\"http:\\\/\\\/blog.polldaddy.com\"};<\/script><script type=\"text\/javascript\" src=\"http:\/\/i0.poll.fm\/rating\/rating.js\"><\/script>"}

If you have any questions, please contact support.

Polldaddy Tweets
%d bloggers like this: