I am using the API to create topics successfully. However, I cannot seem to be able to add a poll to a topic via the API . Here is what I'm using as my post fields that is sent to the API via curl. Note, everything below the /* poll variables below */ comment is what I'm trying to post as the poll data to the topic. The topic still gets posted, but the poll does not get created in the topic. What am I doing wrong?
$post_fields = array(
'key' => urlencode($apiKey) // the topic id
,'forum' => urlencode(IPBFORUM_ID) // the forum id
,'title' => urlencode('This is the title') // the title
,'post' => urlencode($message)
,'author' => urlencode($user_id)
,'author_name' => urlencode($author_name)
,'hidden' => urlencode('0')
/* poll variables below */
,'poll_title' => 'Cast your vote'
// poll_options: Array of objects with keys 'title' (string), 'answers' (array of objects with key 'value' set to the choice) and 'multichoice' (bool)
,'poll_options' => array('title' => urlencode('Make your choice, either Yes or No:')
,'answers' => array('Yes','No')
,'multichoice' => '0'
)
,'poll_public' => '0' // bool Make the poll public
,'poll_only' => '0' // bool Make this a poll-only topic
);