<docbook><section><title>VirtOAuthTestToolExamplePolls</title><para> </para>
<bridgehead class="http://www.w3.org/1999/xhtml:h2">Polls OAuth REST API Example performed with the Virtuoso OAuth Testing Tool</bridgehead>
<para>The following example demonstrates adding and getting poll by the ODS REST APIs <emphasis>poll.new</emphasis> and <emphasis>poll.get</emphasis> using the OAuth Test Tool.
 Full list of the ODS REST APIs for ODS Polls you can find <ulink url="VirtuosoOdsControllersPolls">here</ulink>.</para>
<orderedlist spacing="compact"><listitem>Go to <ulink url="http://demo.openlinksw.com/ods">http://demo.openlinksw.com/ods</ulink> </listitem>
<listitem>Log in as user demo with password demo </listitem>
<listitem>Go to Settings-&gt;OAuth Keys <itemizedlist mark="bullet" spacing="compact"><listitem><figure><graphic fileref="VirtOAuthTestToolExamplePolls/o1.png" /></figure> </listitem>
</itemizedlist></listitem>
<listitem>Copy the Token value for an Polls instance or create such in not existing.
 For ex.: cb0c9e0335fa088f7c779b0fec826b5a6af120c4 </listitem>
<listitem>Go to <ulink url="http://demo.openlinksw.com/ods/oauth_test.vsp">http://demo.openlinksw.com/ods/oauth_test.vsp</ulink> </listitem>
<listitem>In the shown form enter for: <orderedlist spacing="compact"><listitem> <emphasis>Server</emphasis>: <ulink url="http://demo.openlinksw.com/ods/api">http://demo.openlinksw.com/ods/api</ulink> </listitem>
<listitem> <emphasis>Consumer Key</emphasis>: cb0c9e0335fa088f7c779b0fec826b5a6af120c4 </listitem>
<listitem> <emphasis>API method</emphasis>: poll.new </listitem>
<listitem> <emphasis>API parameters</emphasis>: inst_id=61&amp;name=<ulink url="MyPoll">MyPoll</ulink> <itemizedlist mark="bullet" spacing="compact"><listitem>An easy way to get the instance id is using the <ulink url="VirtuosoOdsUbiquity">ODS ubiquity commands</ulink> sequence: <programlisting>ods-host http://demo.openlinksw.com/ods
ods-set-mode sid
ods-authenticate-user demo password demo
ods-get-instance-id mypolls
</programlisting></listitem>
</itemizedlist></listitem>
<listitem>Select for <emphasis>Query options</emphasis>: &quot;Generate URI and Submit&quot;.
</listitem>
</orderedlist><itemizedlist mark="bullet" spacing="compact"><listitem><figure><graphic fileref="VirtOAuthTestToolExamplePolls/op1.png" /></figure> </listitem>
</itemizedlist></listitem>
<listitem>Click the &quot;Execute&quot; button.
</listitem>
<listitem>Enter the password for user demo and click the &quot;Login&quot; button.
</listitem>
<listitem>In the shown authorization form click the &quot;Authorize&quot; button.
<itemizedlist mark="bullet" spacing="compact"><listitem><figure><graphic fileref="VirtOAuthTestToolExamplePolls/op2.png" /></figure> </listitem>
</itemizedlist></listitem>
<listitem>As result will be shown the generated URI and the output message of executing the ODS REST API.
 In our case, the id of the new created poll will be: 1012 <itemizedlist mark="bullet" spacing="compact"><listitem><figure><graphic fileref="VirtOAuthTestToolExamplePolls/op3.png" /></figure> </listitem>
</itemizedlist></listitem>
<listitem>Now lets get the data for the created poll.
 In the form enter: <orderedlist spacing="compact"><listitem> <emphasis>API method</emphasis>: poll.get </listitem>
<listitem> <emphasis>API parameters</emphasis>: poll_id=1012 </listitem>
<listitem>Select for <emphasis>Query options</emphasis>: &quot;Generate URI and Submit&quot;.
</listitem>
</orderedlist></listitem>
<listitem>Click the &quot;Execute&quot; button.
</listitem>
<listitem>As result in the &quot;Response Body&quot; text-area will be shown the retrieved details for the poll with the given above id.
<itemizedlist mark="bullet" spacing="compact"><listitem><figure><graphic fileref="VirtOAuthTestToolExamplePolls/op4.png" /></figure></listitem>
</itemizedlist></listitem>
</orderedlist><para><ulink url="CategoryPolls">CategoryPolls</ulink> <ulink url="CategoryODS">CategoryODS</ulink> </para>
</section></docbook>