Facebook Graph Api publishing to feed returns: “(#100) Param place must be a valid place tag ID”

♀尐吖头ヾ 提交于 2021-01-28 10:50:08

问题


I am searching at Facebook Graph Api, using graph api explorer, for some place using the following endpoint:

/search?type=place&q=centauro&fields=id,name,link

I am getting this as response:

 "data": [
    {
      "id": "492103517849553",
      "name": "Centauro",
      "link": "https://www.facebook.com/Centauro-492103484516223/"
    },
    {
      "id": "313439499156253",
      "name": "Centauro",
      "link": "https://www.facebook.com/Centauro-313439462489590/"
    },
    {
      "id": "175812113006221",
      "name": "Centauro",
      "link": "https://www.facebook.com/Centauro-175812079672891/"
    },
    {
      "id": "1423220914594882",
      "name": "Centauro",
      "link": "https://www.facebook.com/pages/Centauro/1423220891261551"
    },...

When I try to publish using the field "id" returned:

/me/feed

with fields:

message: Testing

place: 492103517849553

I get the following reponse:

{
  "error": {
    "message": "(#100) Param place must be a valid place tag ID",
    "type": "OAuthException",
    "code": 100,
    "fbtrace_id": "DfEKOjZX8g+"
  }
}

But if I use de final number of the link:

"link": "https://www.facebook.com/Centauro-492103484516223/"

492103484516223

And try again:

/me/feed

with fields:

message: Testing

place: 492103484516223

It works perfectly.

So, is there a way to get te correct place id for publishing? Or is it a bug?


回答1:


I was also getting the “(#100) Param place must be a valid place tag ID” error, but got it to go away by providing a JSON string within the 'place' element.

So where the content of your request was this:

place: 492103484516223

Format the place information like this instead:

place: {"id": "492103484516223"}



来源:https://stackoverflow.com/questions/51452394/facebook-graph-api-publishing-to-feed-returns-100-param-place-must-be-a-val

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