Posts under category facebook-graph-api

I am getting this error when click on Send Message In API setup section (Sending of message failed. There was a problem with the access token or permissions you are using for the API call) [First Issue]

Its working perfect few hours ago facing problem after creating a new Facebook business profile in same Facebook profile and verified it and other thing i do is add a new number in meta business suite, and in my other business profile i unable to add phone number for onboarding.

getting this error in second profile

There was a problem registering your phone number This page is not available right now. Please try reloading in a few minutes. (Second Issue)

is there anybody who face this problem or have any solution for this.

My website uses FacebookClient to get the company's Facebook feed and display the latest posts on the site. It's no longer working (not sure how long ago it stopped). The access token expired a while ago, so I updated the access token, and the access token now works (I don't get an exception now on dynamic feedData = (IDictionary<string, object>)client.Get($"{pageId}/feed", new Dictionary<string, object> { { "limit", numResults } }); but it just returns an empty array.

I know that the pageId and accessToken are valid, because this code works:

dynamic coverImage = client.Get(pageId, new Dictionary<string, object> {     { "fields","picture" } }); 

but the call to get the feed returns no posts.

To make testing easier, I'm testing in https://developers.facebook.com/tools/explorer?method=GET&path={pageId}%2Ffeed&version=v20.0. I get the same results in the explorer. No error, just an empty data array:

{   "data": [   ] } 

I verified there are posts on the Facebook page as recent as 4 hours ago. If the access token and pageId are valid, why is {pageId}/feed returing no data?

How can I post via API to a Facebook Page without having my "Facebook App" suspended/deleted?

I need to share a URLs per day, via API, from my own script to a Facebook Page I manage.

I followed these instructions to create a "Facebook app" and get the "never-expiring" token.

Once I have the token, I can easily post like this:

<?php class FacebookMessenger{     protected string $pageId = '<my-page-id>';     protected string $token  = '<my-token>';     public function sendUrlToPage(string $url){         $endpoint = "https://graph.facebook.com/v19.0/{$this->pageId}/feed";         $this->lastResponse =             HttpClient::create()->request('POST', $endpoint, [                 "headers" => [                     "Content-Type" => "application/json",                 ],                 "query" => [                     "link"          => $url,                     "access_token"  => $this->token                 ]             ]);         $content = $this->lastResponse->getContent(false);         var_dump($content);         die();     } } (new FacebookMessenger())->sendUrlToPage('https://example.com'); 

This works beautiful for a few days, but then the Facebook App I created gets "restricted":

TLI Sharer App DEV is restricted due to violations

The app TLI Sharer App DEV is in violation of Meta’s Platform Terms or Developer Policies and has been restricted, as described below: Platform Term 7.e.i.2 - Negatively impacting platform, products, data, or users

We determined that your app is negatively impacting the platform, products, data, or users and has violated or may have violated our terms. This violates Platform Term 7.e.i.2.

This is the linked page: https://developers.facebook.com/terms/dfc_platform_terms/#compliancereviewrightsandsuspensionandterminationoftheseterms

I fail to see how running 5/6 API requests like this is a problem, and I have absolutely ZERO ideas on how to proceed.

I'm desperately trying to post a post with an image and an image URL via the Facebook Graph API. No matter what I do, I always get error messages.

Does anyone here have any sample code or ideas on how to implement this with Python? I would be very grateful for constructive answers!

import requests from io import BytesIO def post_facebook_photo(message, image_url):     access_token = 'DEIN_ACCESS_TOKEN'     feed_url = "https://graph.facebook.com/v20.0/me/feed"          try:                image_response = requests.get(image_url)         image_response.raise_for_status()     except requests.exceptions.RequestException as e:         print(f"Fehler beim Herunterladen des Bildes: {e}")         return     image_file = BytesIO(image_response.content)             photo_upload_url = "https://graph.facebook.com/v20.0/me/photos"     photo_data = {'access_token': access_token}     photo_files = {'file': ('image.jpg', image_file, 'image/jpeg')}          photo_response = requests.post(photo_upload_url, data=photo_data, files=photo_files)     photo_response_data = photo_response.json()     if 'id' in photo_response_data:         photo_id = photo_response_data['id']         post_data = {             'message': message,             'attached_media': [{'media_fbid': photo_id}],             'access_token': access_token         }                  post_response = requests.post(feed_url, json=post_data)         return post_response.json()     else:         return photo_response_data response = post_facebook_photo("Hier ist ein neues Bild!", "IMAGE-URL") print(response) 

I hope your day is going well. When I make a request using this endpoint:

  url = "https://graph.instagram.com/access_token"   params = {       "grant_type": "ig_exchange_token",       "client_secret": client_secret,       "access_token": short_lived_access_token   } 

I encounter the following error:

{'error': {'message': 'Unsupported request - method type: post', 'type': 'IGApiException', 'code': 100, 'fbtrace_id': 'Ape_-PbPFO_idh_eqtMB3jz'}} 

I'm unsure of the problem. I have added a verified business, but I have not submitted my app for app review. Should I do that first?

Additionally, it's not just this endpoint; I encounter issues with every endpoint I attempt to request, although I can obtain the short-lived access token without any issues.

I tried to exchange short lived token for the long lived once, and I was expecting to recieve the long lived token