Answer the question
In order to leave comments, you need to log in
How to get survey results in a media topic?
There is a web application that, through WidgetMediatopicPost, has the ability to post with attached pictures and a poll on the user's wall.
Attachment looks like this:
$attachment = '{
"media":[
{
"type":"poll",
"question":"Что купить?",
"answers":
[
{"text":"То, что слева"},
{"text":"То, что справа"}
],
"options":"SingleChoice,AnonymousVoting"
},
{
"type": "photo",
"list": [
{
"photoId": "'.$photos[0]['assigned_photo_id'].'"
},
{
"photoId": "'.$photos[1]['assigned_photo_id'].'"
}
]
}
]
}';
Array
(
[type] => success
[id] => 65041556597688
[signature] => d668c42312d238a02883209c36a14ef6
)
OdnoklassnikiSDK::makeRequest("mediatopic.getByIds", ["topic_ids"=>"65041556597688", "fields"=>"poll.*"]);
Array
(
[media_topics] => Array
(
[0] => Array
(
[ref] => media_topic:65041556597688
)
)
[entities] => Array
(
)
)
Answer the question
In order to leave comments, you need to log in
You need to add
media_topic.media and media_topic.media_poll_refs to the fields.
The method initially returns a media topic, not a poll, so you must first get the dependency of the media topic on the poll.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question