Jump to content

API: Getting Poll Data from Topic: need POLL_CLOSED field


NAWAC

Recommended Posts

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
Link to comment
Share on other sites

  • 1 month later...
  • 1 month later...
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
Link to comment
Share on other sites

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. 

Link to comment
Share on other sites

  • 1 month later...
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Upcoming Events

    No upcoming events found
×
×
  • Create New...