Facebook Ads API Insights Error - facebook

I'm encountering a strange issue when it comes to retrieving data from the php facebook ads api. In our account, we are running several types of ad programs, one being a page like boost campaign. I am able to get several page likes stats, however after about 17 calls to the api, I receive the following error. Any ideas as to what's going on here. It's a strange error message, because I'm able to retrieve actions in every call prior (17 calls).
Uncaught exception 'InvalidArgumentException' with message 'actions is not a field of FacebookAds\Object\Insights' in C:\wamp\www\api_integration\facebook_ads\vendor\vendor\facebook\php-ads-sdk\src\FacebookAds\Object\AbstractObject.php on line 56

To me, this is an issue with the sdk.
Retrieving data of the same type do not have to success sometimes and throw some other based on the presence of an attribute.
I've opened an issue and offered a pull request.

Related

Can't get Google Chat messages with Gmail API

What are the details of your problem?
Until recently, in my own web application, I used the Gmail API to retrieve Google Chat messages as follows.
I was able to get it from "Label: CHAT" by executing as follows.
(1) Acquisition of thread ID belonging to CHAT label
https://gmail.googleapis.com/gmail/v1/users/me/messages?labelIds=CHAT
(2) Get message information from thread ID
https://gmail.googleapis.com/gmail/v1/users/me/threads/[Thread ID]
However, it seems that it has been impossible to obtain it since around December 2022, and when I searched for "in: chats" in Gmail, the messages after December 10th were not displayed.
Any method is fine, so I would like to be able to get Google Chat messages as before.
Anyone know the cause and solution?
Please check.
I also tried using the Google Chat API to see if it was possible to get messages, but I could only get messages in the space, and I couldn't get direct messages, so I wasn't able to use it.
I checked all the messages in the labels that can be obtained at "https://gmail.googleapis.com/gmail/v1/users/me/labels", but it seems that chat messages are not included.
Also, in another answer, there was a description that the state included in the Gmail API was a bug, so it is possible that this bug was adapted and it was not displayed, but in that case, there is another way to deal with it. Are you there?
Access CHATS label with Gmail API

Unexpected "Cannot call API on behalf of this user" after upgrading to graph api 2.10

We've allowed sign up/access to our website using Facebook Login for a long time. Two days ago, after upgrading to graph api 2.10, this stopped working for a portion of our users. Myself and most others are unaffected.
The error message received in the Access Token response reads "Cannot call API on behalf of this user".
I can't find anything in the 2.9 -> 2.10 changelog that mentions anything remotely connected to this problem, and I've found very little on this issue externally.
A few posts suggests that it might have something to do with insufficient privacy policy settings in our Facebook app settings, but everything is in place expect the non-mandatory Data Deletion Request URL. The fact that it also works perfectly fine for me as an EU citizen (affected by GDPR) says to me that it's something else. We do not have any country restrictions in place, and those who are affected by this comes from a variety of countries both inside and outside of the European Union.
Does anybody recognize this problem?
I ran into the same problem, also after an update (from 2.9 to 3.1). The fix for me was to remove location restrictions within the facebook console (Settings > Advanced > App Restriction > Contry Restricted):
I got this idea from a comment on this similar question, and this google group thread.
ref: https://developers.facebook.com/docs/audience-network/optimization/apis/FB-login-Reporting-API
sounds like the app type should be Business
today I meet this error, follow above document, I new create a business app, then error be resolved.

Suddenly, pages_messaging_subscriptions permission is required

I have a simple message bot that was set up according to the Messenger Platform guide. It has been working fine for the last few months, with about half a dozen messages sent a day. I have not touched it at all, but suddenly, sending a message, ie calling https://graph.facebook.com/v2.6/me/messages?access_token=..., returns:
{"message":"(#230) Requires pages_messaging_subscriptions permission to manage the object","type":"OAuthException","code":230,"fbtrace_id":"DVs...."}
This was out of the blue. Things were working fine, I did not even log on to Facebook during this time, and I haven't even looked at my webhook callback website. But some time from Aug 17 onward, this exception was returned for every attempted message send.
Has something changed? Anyway, I could not find a subscription field by the name pages_messaging_subscriptions in the Webhooks Page Subscription page.
What do I need to get my message bot to work again?
August 15 was Updater Messenger Platform Policies.
official post in blog
Now, to send a message a day after the activity of the user is necessary to request additional permission in the application settings.

Page Conversations API: Error Message for More than 2 Responses

I'm working on building an app that (among other things) uses the Facebook Graph API for Pages to reply to direct messages to a page. I send a POST request to /CONVERSATION_ID/messages as per the documentation, and everything seems to be working well.
The problem I'm encountering is that the documentation claims
"Also, a page can respond not more than twice to a user's message before the user has replied back,"
but I'm not seeing this happen during my testing.
https://developers.facebook.com/docs/reference/api/page/#conversations
I've so far sent 4 responses to the message initiated by the Facebook user that I am using to test my app with, and the Graph API has not yet given me an error message. The documentation also does not say what error message is supposed to be returned if a page attempts to send more than 2 responses to a message before the user replies back.
Does anyone know what the error message is that the Graph API returns when a page attempts to send more than 2 responses to a message?
I seem to have found the answer to my own question. While I could not find official documentation for the error messages, I found unofficial documentation for them at:
http://fbdevwiki.com/wiki/Error_codes
The error code I was looking for was there:
User has sent too many messages

Integrating Facebook Credits results in "The application you are using is not responding."

I've been trying to integrate Facebook Credit purchases into my app, but any call to the pay dialog results in the error message "The application you are using is not responding." To eliminate any application specific problems, I've downloaded the Credits API Example and am just trying to get that to work -- it results in the same error message.
I've been trying for a couple of days to pinpoint this error message, but with no luck. Here's what I know so far:
Clicking the "Pay with Facebook" button results in error code 1383008, but there's no error_message being displayed.
I'm running Apache 2.2 on Windows 7. As far as I can tell, Apache is configured to allow requests from any source.
The canvas page is configured to point at http://localhost:8080/facebook.../ while the callback page is configured to point at http://localhost:8080/facebook.../callback.php. However, I have verified that the callback page is not being accessed.
I'm not sure how to verify whether or not Facebook is receiving my data correctly or if it's passing anything back. Any help in this regard would also be appreciated!
Credits attempts to make a callback to a web accessible url (or IP). If Facebook's spider cannot fetch the information from the callback script, then it will continue to return errors, since Facebook expects you to send information like the cost, name, image, custom parameters in order to process the payment.
Have a look at the creating a callback section of the docs:
http://developers.facebook.com/docs/creditsapi/
Adding to Fancis' answer, what you can do is setup a hole in your firewall and connect it to a dynamic dns service such as http://dyn.com/. Then you will be able to test your credits code.