Jump to content

API: Getting Poll Data from Topic: need POLL_CLOSED field


Recommended Posts

Posted (edited)

We run statistics on poll data on our site.  I am GETting the poll data on topics via an API call. I notice that the only poll sent back from the API is something similar to the following (as an example):

[poll] => Array
(
	[id] => 255
	[title] => Cast your vote
	[votes] => 8
	[questions] => Array
		(
			[0] => Array
				(
					[question] => Cast your vote, either Yes or No.
					[options] => Array
						(
							[Yes] => 5
							[No] => 3
						)

				)

		)

)

It would be nice if the other poll data was also sent back. Example, like the pole_closed field (from the core_polls table). It would be nice to know if the value of the pole_closed field is either set to "0" or "1". It would also be nice to even include the value of the poll_close_date. 

It could look something like:

[poll] => Array
(
	[id] => 255
	[closed] => 1
	[close_date] => 2023-01-08 08:30:00
	[title] => Cast your vote
	[votes] => 8
	[questions] => Array
		(
			[0] => Array
				(
					[question] => Cast your vote, either Yes or No.
					[options] => Array
						(
							[Yes] => 5
							[No] => 3
						)

				)

		)

)

Thanks.

Edited by NAWAC
  • 1 month later...
Posted

Just a quick update to let you know that was added in the recent 4.7.8 release of our platform. Please upgrade your site to resolve this issue. 

  • 1 month later...
Posted (edited)
On 3/10/2023 at 2:15 AM, Marc Stridgen said:

Just a quick update to let you know that was added in the recent 4.7.8 release of our platform. Please upgrade your site to resolve this issue. 

I've noticed that when GETting the topic information via an API call, if the poll is closed (i.e. [closed] => 1) the poll data (topic) is not returned in the call (nothing is returned). Even if the poll is closed, the API call should still return poll data from topic.

However, if the poll is still open (i.e., [closed] => ), the API call returns poll data back to the calling script just fine.

Edited by NAWAC
Posted
On 4/10/2023 at 6:41 PM, NAWAC said:

I've noticed that when GETting the topic information via an API call, if the poll is closed (i.e. [closed] => 1) the poll data (topic) is not returned in the call (nothing is returned). Even if the poll is closed, the API call should still return poll data from topic.

However, if the poll is still open (i.e., [closed] => ), the API call returns poll data back to the calling script just fine.

Thanks, I have logged this in our bugtracker. 

  • 1 month later...
Posted

We're not actually able to reproduce this. Could you please provide more info on the specific API request you are making and the output you see? In testing, the poll data is always included whether the poll is closed or open.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...