skip to Main Content

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?

2

Answers


  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”}

    Login or Signup to reply.
  2. Currently, this is how you can solve it.

    import requests 
    
    IG_USER_ID = <YOUR INSTAGRAM USER ID>
    USER_ACCESS = <YOUR USER ACCESS TOKEN WITH VALID PERMISSIONS>
    CONTAINER1_ID = <ID OF FIRST CONTAINER>
    CONTAINER2_ID = <ID OF SECOND CONTAINER>
    
    URL = f"https://graph.facebook.com/v13.0/{IG_USER_ID}/media?caption=Fruit%20candies&media_type=CAROUSEL&children={CONTAINER1_ID}%2C{CONTAINER2_ID}&access_token={USER_ACCESS}"
    
    r = requests.post(URL)
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search