Get a users Facebook Credits Balance

799 views Asked by At

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!

1

There are 1 answers

0
DMCS On

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.