Facebook API: How to get option results (votes)

早过忘川 提交于 2019-12-12 04:06:15

问题


Perhaps a stupid question but I'm trying to get the vote results from a Facebook poll using the Facebook API (using CuRL).

What is succeeding so far is the following:

  • I'm able to get the post using the ID from Facebook:

1697904123837315?fields=created_time,message,attachments{title,type,subattachments,url}

{
  "created_time": "2017-05-04T08:29:50+0000",
  "message": "Hey All, 
It's time for Temptation Thursdays!
For this week, we have decided to pick a puzzle/adventure video game series! As follows:-
TT49 - Professor Layton from the Professor Layton series.
Question: I'll get straight to the point, If F4F opened a preorder for this, would you buy?
Last week's TT48 - Rikimaru from the Tenchu series results can be viewed at the below link.
Happy Voting:)
----------------------------
To nominate for characters that you would like to appear in a future poll, please add comments at the following link.
F4FNOMINATE - Character nominations - 
https://www.facebook.com/groups/first4figures/permalink/1570468996580829/
TT48 - Rikimaru from the Tenchu series poll - https://www.facebook.com/groups/first4figures/permalink/1695290604098667/
Note: Every week on this day there will be a spotlight poll for everyone to participate in. 
This spotlight poll is to give the lesser known characters a chance to shine and if there is enough interest, we will look into it with serious thoughts. Of course, this is just to gauge interest for now and doesn't mean its guaranteed to be made. Though, never say never:P",
  "id": "1522682788026117_1697904123837315",
  "attachments": {
    "data": [
      {
        "title": "Hey All, 
It's time for Temptation Thursdays!
For this week, we have decided to pick a puzzle/adventure video game series! As follows:-
TT49 - Professor Layton from the Professor Layton series.
Question: I'll get straight to the point, If F4F opened a preorder for this, would you buy?
Last week's TT48 - Rikimaru from the Tenchu series results can be viewed at the below link.
Happy Voting:)
----------------------------
To nominate for characters that you would like to appear in a future poll, please add comments at the following link.
F4FNOMINATE - Character nominations - 
https://www.facebook.com/groups/first4figures/permalink/1570468996580829/
TT48 - Rikimaru from the Tenchu series poll - https://www.facebook.com/groups/first4figures/permalink/1695290604098667/
Note: Every week on this day there will be a spotlight poll for everyone to participate in. 
This spotlight poll is to give the lesser known characters a chance to shine and if there is enough interest, we will look into it with serious thoughts. Of course, this is just to gauge interest for now and doesn't mean its guaranteed to be made. Though, never say never:P",
        "type": "question",
        "subattachments": {
          "data": [
            {
              "target": {
                "id": "128333874381596"
              },
              "title": "No",
              "type": "option"
            },
            {
              "target": {
                "id": "205859476588093"
              },
              "title": "Yes",
              "type": "option"
            }
          ]
        },
        "url": "https://www.facebook.com/groups/first4figures/permalink/1697904123837315/"
      }
    ]
  }
}
  • But I'm unable to get the amount of votes for each option. When calling the option ID, I'm getting the error "An access token is required to request this resource." (OAuthException, 104). But:
    • I'm using an AccessToken
    • I've tried enabling all checkboxes to no avail

I'm using the latest version (v2.9) and the Graph API Explorer for testing.

来源:https://stackoverflow.com/questions/43799787/facebook-api-how-to-get-option-results-votes

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!