pollCreate
public static string pollCreate(string token, PollStructure pollData)
Create a new Poll based on the details provided. Return the ID of the newly created Poll.
Section
Poll Related Methods

Parameters
string tokenA valid token for your account. To generate a token, use the login method.
array pollDataThe array containing the poll details.
string nameThis will only be seen by you and is used to organize your poll.
string questionQuestion for your poll.
string answer1Option1 for your question.
string answer2Option2 for your question.
string answer3Option3 for your question.
string answer4Option4 for your question.
string answer5Option5 for your question.
integer answercolorFont Color of your poll answers.
string answerfontFont which is used for the appearence of your answers.
string borderbgBackground color of your Poll's Border
string buttontextText which is to be appeared on the button of your poll
string formbgPreffered background color for the form of your poll.

Returns
stringReturns the ID of the newly created poll.


Examples
download example code
xmlrpc_pollCreate.php


  1. <?php
  2. /**
  3. This Example shows how to authenticate a user using XML-RPC.
  4. Note that we are using the PEAR XML-RPC client and recommend others do as well.
  5. **/
  6. require_once 'XML/RPC2/Client.php';
  7. require_once 'inc/config.php';
  8. $client = XML_RPC2_Client::create($apiURL);
  9. $token = $client->login($apiLogin, $apiPassword);
  10.  
  11. $pollDetail['name'] = 'Resturant Poll';
  12. $pollDetail['question'] = 'Do you eat out regularly';
  13. $pollDetail['answer1'] = 'Never';
  14. $pollDetail['answer2'] = 'Once a year';
  15. $pollDetail['answer3'] = 'Every Month';
  16. $pollDetail['answer4'] = 'Every Week';
  17. $pollDetail['answer5'] = 'Daily';
  18. $pollDetail['answercolor'] = '#0000ff';
  19. $pollDetail['answerfont'] = 'Comic Sans Ms';
  20. $pollDetail['borderbg'] = '#777700';
  21. $pollDetail['buttontext'] = 'Submit';
  22. $pollDetail['formbg'] = '#FDF000';
  23. $newSurveyID = $client->pollCreate($token, $pollDetail);
  24. ?>