Get a users Facebook Credits Balance - facebook-fql

We are in the process of implementing Facebook Credits as a virtual currency on Facebook.
We have applied and have been whitelisted for access to the Facebook Credits balance method, however from the little documentation I had been able to find (mostly forum posts) it doesn’t seem to be working!
I am using the following url to get a user’s Credits balance: https://api.facebook.com/method/users.getStandardinfo?fields=credit_balance&format=json&uids=FB_USER_ID&access_token=DEVELOPMENT_APP_ACCESS_TOKEN
And I am getting the following error back:
"error_code": 13, "error_msg": "The underlying FQL query made by this
API call has encountered the following error: credit_balance is not a
member of the user table.",
Can you confirm that the above URL is correct, and if not point me in the direction of some documentation, after about an hour of searching in the docs I have come up with nothing!

First, the REST API is being deprecated and you should be using the new Graph API. See: https://developers.facebook.com/docs/reference/rest/
We are in the process of deprecating the REST API. If you are building
a new Facebook application, please use the Graph API. While there is
still functionality that we have not ported over yet, the Graph API is
the center of Facebook Platform moving forward and where all new
features will be found.
Also on https://developers.facebook.com/docs/reference/rest/users.getStandardinfo/ there is no field called credit_balance.
I also went to https://developers.facebook.com/docs/reference/fql/user/ and no field called credit_balance there too.
But I did go to https://developers.facebook.com/docs/credits/ and read up on the credits. It appears they've removed the ability for an app to get that information in lieu of their Facebook's new credit dialogs that don't require the app to need to know a user's credit balance as Facebook will display it to the user for the app in their dialog.
You can learn about how to integrate the new dialogs by following the guide here: https://developers.facebook.com/docs/credits/build/
My belief is that too many boneheads abused the privilege of know a user's credit level to their advantage and so this "feature" was removed.

Related

Not able to get permission for Facebook API call

Our client wants to show the three latests posts from their Facebook wall on their website. Therefore we follow the procedure described here (the second answer) which seems pretty straight forward: How to embed a Facebook page's feed into my website
I can generate an access token easily but the call to the following URL fails and gives me the following error message:
https://graph.facebook.com/juwelierwagnervienna/posts?fields=full_picture,picture,link,message,created_time&limit=5&access_token=MY_ACCESS_TOKEN
This endpoint requires the 'manage_pages' or 'pages_read_engagement' permission or the 'Page Public Content Access' feature.
Therefore I requested manage_pages and in a separate request Page Public Content Access via the App interface. They declined both for the same reason over and over again although I made a pretty detailed description and a video to document my approach including code samples.
We determined that your app's use case for this permission is invalid, or it's not needed to support its core functionality. You can learn more about the allowed use cases by visiting our Permissions Reference or Features pages. Please resubmit your request, and ensure that you provide a valid use case with notes and screencast clearly explaining: [...]
I followed all of the instructions and resubmitted the request for approval several times already.
Would love to hear some feedback and recommendations on this one since I'm at a dead end here and the Facebook Support Chat can not help me either.

Instagram API deprecation 2020

I'm building an app that has the user log in through instagram, it then reads their feed and uses that information for the app. Instagram has a page that says their API's will be deprecated in 2020 but some things will still work. It's not straightforward as to what is being deprecated and what isn't, and I have not found any way to contact them directly. Does anyone know if the following URL will continue working, and if not if this type of app will even be viable in the future? Why is IG and Facebook becoming much more closed platforms to 3rd party integrations?
https://api.instagram.com/v1/users/self/media/recent/
Deprecation notice:
https://www.instagram.com/developer/
The legacy Instagram API - https://www.instagram.com/developer/ will be deprecated in favor of Instagram Graph API provided by Facebook - https://developers.facebook.com/docs/instagram-api
In order to use https://api.instagram.com/v1/users/self/media/recent/ this endpoint you need Basic permission. As documentation says, it will be deprecated in early 2020, which means that the legacy API will be most probably shut down, since there will be no more capabilities to request for.
You should most definitely start building your app with Graph API. Please keep in mind that it takes some time before you can go live with your app. It requires couple of things like Business Verification, review of requested permissions in App review and it can take some time to be able to go live.
Please keep in mind that the Graph API works only for Instagram Business type of accounts. You can't use it for regular accounts at the moment. It is not clear yet if it will be available for all accounts, but most probably it will be in the future. It was the same as with deprecating Public Content permission on Instagram legacy API. They added similar functionality in Graph API.
If you plan to support all users, you will also have to apply for Basic capability in legacy API. In other words, you need to support both Instagram API and Instagram Graph API if you plan to target all Instagram users, both regulars and Business profiles.
Another thing to keep in mind is that you can't really report bugs or get any help from legacy Instagram API. If you will find the bug you can't report it as they do not accept it due to deprecation.
So start building with Instagram Graph API, once you will be good to go, try to add Instagram legacy API support. If everything will be fine and Facebook will add support for legacy accounts, your Graph API should easily take over Instagram legacy API functionality.
Most probably the reason why they are tightening the integrations and makes it harder for the developers is user privacy. They do not want to have yet another incident like Cambridge Analytica for instance.
It does not make sense to build something with the old API, that old API URL will definitely stop working (with all the old api.instagram.com endpoints). There is a new API though: https://developers.facebook.com/products/instagram/

Facebook Marketing API - no app?

I want to pull ad data (campaigns, ad sets, & metrics like clicks/impressions/ctr) from Facebook using their API and put it into a database. Facebook's documentation says I need to create an app on their site in order to access the API, but that doesn't seem right. I'm not trying to create an app for my fb page, just want to extract data.
My first choice was to use an ODBC driver from
CData
, which does allowed me to successfully pull data from AdAccounts but threw an error when trying to get AdSets or AdStatistics:
OAuthException Code 10: You do not have sufficient permissions to perform this action.
I made sure to add in a target='act_{myAdAccountId}' parameter to the query, as per their documentation, but it didn't help. I figured this meant I didn't configure the driver properly, so maybe I'd have better luck just coding up a solution in python or php.
Next, I tried to run similar API calls using the Graph API Explorer and got the same error message. I created an access token that had all the extended permissions and then made a request to
GET /v2.4/act_{myAdAccountId}/adcampaigns.
This gave me the exact same OAuthException Code 10 error that I was getting through the ODBC Driver.
Can someone confirm whether it's possible to pull data from the API without building an app? If so, what permissions do I need to enable for my account? I'm already an Ad Account Admin in the "Ads Manager", and couldn't find anywhere else to set permissions.
Thanks!
Apps have no direct relation to Pages. You need to create an App for any API access. I did not use the Ads API yet, but i assume you need to use the ads_management permission with your App.
How to create Apps and authorize with the required permissions is explained in the docs: https://developers.facebook.com/docs
Since you asked about Login Review, all the information you need about that can be found in the docs too: https://developers.facebook.com/docs/facebook-login/review
I understand this is an old post, but in case if anyone was looking at a similar situation, I was able to call the Facebook Marketing API without building an app.
I posted a similar answer on another more recent question (Do I need a publicly accessible webserver in order to user Facebook's marketing API?), and was curious if this situation puzzled anyone else, which led me to here.
I wrote my API calls using Python 2.7 on Juypter notebook, and I just followed Facebook's Marketing API documentation and examples, modifying with my access tokens and account information.

Integrating Facebook into Google analytics

I want to add the 'Log in with Facebook' option to my website, however I'm unsure how to integrate the information gained when someone logs into my website with Facebook with my current Google Analytics.
Is it possible to link up a visit in Google Analytics with a user who has logged into the site with Facebook to enable me to see things like age, gender etc?
Any help you can give me on this would be much appreciated.
Thanks,
Ben
you may have to do this via a redirection or possibly a frame.
Google Analytics does nolt track individual users, it provides anonymized data. So at the top level, no you cannot do this. However, there are a few more things avaiable to you. One: Facebook provides facebook insights, their own tracking suite, that will give you demographic information on the users of a facebook app or fan page. You site will effectively become a facebook app when you use their user authenication, so you will be able to get insights tracking on you site. At the present moment, facebook insights and google analyitcs do not itegrate or share data. Facebook insight also provides anonymized data, so you will not be able to identify an individual through the tracking.
The final option is, now that you are tracking users through login, you can implement your own tracking info on your site to see what individual users are doing, and attempt to track their preferences.
Its also entirely legal (in the United States at least) to buy access to marketing data and use use your registered user name pool to get additional information.
If you wanted, you could set up a "funnel" in Google.
When a user logs in through Facebook, you could send them to a specific page and then track their progress from there...
http://www.google.com/support/analytics/bin/answer.py?answer=55515
So using this you could get the percentage of users who log in through Facebook... etc.
But to collect information other than that, you would have to get the correct permissions documented here eg. user_birthday (to get the user's Birthday) and query the Graph API from there, thus implementing your own tracking of users.
You can query the Graph API using the various SDKs that Facebook provide explained here.
First of all you should check out this Google document. It explains, how you set a custom unique user id via google analytics.
Further you've to send an event to google analytics (e.g. 'fb_login') via the callback function of your facebook login function.

Facebook shows news feed messages that aren't returned by any of the APIs

I noticed that my feedback news feed shows certain posts that aren't returned by any of the API's. (I tried the GraphAPI and the legacy REST API and FQL).
I can see those status updates at http://facebook.com on my news feed and I can also see them in the Facebook mobile app on iPhone and the mobile app on Windows Mobile.
Some of my friends seem to have set a privacy setting. I think it is this one: "How people bring your info to apps they use" - decheck "My Status Updates", although I can't confirm that is the only reason their posts don't show up, it seems one possible explanation.
So, what API are these facebook mobile applications using which returns the same data as the web site ? Is it possible for me to build another facebook client using that API?
Have you acquired the read_stream extended permission? This is required to see all postings. Typically without it you don't see any posts, but I think you can see posts that are marked as being completely public.