QuimbleApi : CreateAPoll

HomePage :: Categories :: PageIndex :: RecentChanges :: RecentlyCommented :: Login/Register

Creating a poll with XML on Quimble


url endpoint: quimble.com/api/create

To create a poll on Quimble - simply post an XML file to the url above.

header should look like:

POST /api/create HTTP/1.1
 Host: quimble.com
 Connection: Close
 Content-Type: application/xml
 Accept: application/xml
 Content-Length: $length
 Authorization: Basic $base64_encode_of_(username:password)


Please note the "Content-Type" and "Accept:" headers. Your Content-Length header must be accurate.

A minimum amount of XML for a poll would be:

<?xml version="1.0" encoding="UTF-8"?>
<poll>
  <question>Does this work</question>
  <options>
    <option>
      <name>Yes</name>
    </option>
    <option>
      <name>No</name>
    </option>
  </options>
</poll>


A post like that will return XML that will look something like:

<?xml version="1.0" encoding="UTF-8"?>
<poll>
  <created-on type="datetime">2005-12-21T08:05:10-05:00</created-on>
  <updated-at type="datetime">2005-12-21T08:10:06-05:00</updated-at>
  <votes-count type="integer">0</votes-count>
  <created-by type="integer">215</created-by>
  <id type="integer">306</id>
  <question>Does this work</question>
  <is-public type="integer">1</is-public>
  <comments-count type="integer">0</comments-count>
  <allow-options type="integer">0</allow-options>
  <options>
    <option>
      <name>Yes</name>
      <created-on type="datetime">2005-12-21T08:05:10-05:00</created-on>
      <votes-count type="integer">0</votes-count>
      <id type="integer">1262</id>
      <user-id type="integer">215</user-id>

      <poll-id type="integer">306</poll-id>
    </option>
    <option>
      <name>No</name>
      <created-on type="datetime">2005-12-21T08:05:10-05:00</created-on>
      <votes-count type="integer">0</votes-count>
      <id type="integer">1263</id>
      <user-id type="integer">215</user-id>
      <poll-id type="integer">306</poll-id>
    </option>
  </options>
</poll>


You will only be allowed to edit polls created by the username/password you sent in the authorization header. Save that returned <poll><id> somewhere for future reference.

There are 9421 comments on this page. [Display comments]

Valid XHTML 1.0 Transitional :: Valid CSS :: Powered by Wikka Wakka Wiki 1.1.6.1
Page was generated in 4.0173 seconds