Sending App Notification via Facebook Graph API - facebook

In their docs, Facebook indicates you can send notifications to users with an App Token
I've converted my app to be of category game, have an app token, and try to send a notification to a user, but get this in response to API POST /v2.12/some-user-id/notifications
{
"error": {
"message": "(#200) Only web canvas apps can send app notifications",
"type": "OAuthException",
"code": 200,
"fbtrace_id": "sometraceid"
}
}
Is simply case where the documentation is outdated and notifications are no longer allowed or am I'm missing something?

Looks like simply adding the category 'Game' to your app does not make it a Web Games Platform needed to send notifications (as noted in comments). You need to add a Platform to your app of type Facebook Web Game.

Related

cannot subscribe FB page to FB app recently

I have a FB app that works well before. It allows users to subscribe their pages to our app.
Recently, I got the error below when trying to subscribe a page to our app:
'Access to this data is temporarily disabled for non-active apps or apps that have not recently accessed this data due to changes we are making to the Facebook Platform.'
I am using this request url: https://graph.facebook.com/me/subscribed_apps?access_token=xxx
It worked great before but not for now.
However, when I try to submit the same request with the
https://developers.facebook.com/tools/explorer
it works.
Anyone canshow me how can I fix this problem?
Thanks,
Thanh
Have the same issue here. My APP uses Facebook Graph API to import events. Credentials for APP (token) was enabled a long time ago....
Now seems its throwing and error also at https://developers.facebook.com/tools/explorer/1405126029586258?method=GET&path=157956504840454%2Fevents&version=v2.12
Nether my APP or Graph API is working. Below the error message....
{
"error": {
"message": "Unsupported get request. Object with ID '157956504840454' does not exist, cannot be loaded due to missing permissions, or does not support this operation. Please read the Graph API documentation at https://developers.facebook.com/docs/graph-api",
"type": "GraphMethodException",
"code": 100,
"error_subcode": 33,
"fbtrace_id": "EHCB6/XyJsA"
}
}
Same error on my app at Wordpress to import events
Message from Facebook answering the question...
As we begin enhancing our new app review process and make changes to our platform, the Events, Groups, Pages and Instagram APIs will no longer be available to new developers. Testing of our more robust process starts today and the new process should resume in a few weeks, but apps currently accessing Events and Groups APIs will lose access today. Going forward, access to these APIs will require a formal app review and for apps using the Pages API, submission is required within 90 days once app review resumes or access will be removed.
https://developers.facebook.com/blog/post/2018/04/04/facebook-api-platform-product-changes

Publishing Facebook Open Graph Stories from Backend

When I try to make a POST to https://graph.facebook.com/v2.4/me/<app_namespace>:<action>
with user access_token into body I'm getting the following error:
{
"error": {
"message": "(#15) This method must be called with an app access_token.",
"type": "OAuthException",
"code": 15
}
}
Why Facebook is asking me for app access_token? I want to publish a story into wall of user specified by access_token, so I really need to use the application access_code?
Check the details of your action configuration in app dashboard. On the bottom, under “Advanced Options”, there is a option “Requires App Token to Publish” – sounds like you have that set to “Yes”.
This option exists to prevent users from “cheating” by publishing actions themselves, by using their user access token for your app – for example if you have a game with an Open Graph story about the user reaching a certain level or amount of points, then you probably wouldn’t want users to be able to publish that on their own, without actually achieving the necessary level/points in your app.

Accessing Facebook Ads API request error 270

I have a whitelisted Facebook App that is out of sandbox mode and has been approved for the Ads API, but I am receiving the following error when trying to make requests to the Ads API.
{
"error": {
"message": "(#270) This Ads API request is not allowed for apps with only developer access",
"type": "OAuthException",
"code": 270
}
}
This occurs when using adgroupstats, adcampaignstats, and reportstats requests, etc. The adaccounts request does return my account information though. My dashboard does read "This app is public and available to all users", as I needed to get out of sandbox mode in order for my app to be whitelisted.
Is there another setting that I have missed in order to gain access to the Ads API calls that I need?
Answer:
This is most likely due to your dev/admin accounts of the app not being set as "Admins" in facebook's ad manager. Let me know if this solves this issue for you.
Old response:
I am running into the same issue. Can not run api calls against reportstats even though the user that the app/ad account belongs too was an admin, i change that user to a developer and its still happening.
I opened a bug report for this: https://developers.facebook.com/bugs/786289188058999

Are non-app users' pictures still avalible in Facebook Open Graph v2.0?

In Graph API v1.0, I could get the profile picture of any user with the following call graph.facebook.com/{uid}/picture (fb doc).
In Graph API v2.0 facebook says it will return (a) app-scoped user ids for app users, and (b) temporary tokens for non-app users (through /me/taggable_friends and /me/invitable_friends api calls). Based on this, I would assume that the picture api call is deprecated in v2.0. However, the documentation makes it seem like there was not change to this call in v2.0.
Anybody knows if (full-size) public profile pictures of non-app users will be available in v2.0?
It is still possible to get a person's profile picture in v2.0.
http://graph.facebook.com/v2.0/APP_SCOPED_ID/picture will redirect to a picture of the user represented by that app-scoped ID.
If a user previously logged into your app when your app was coded against v1.0, they may still be known to your app by their original Facebook user ID. For this reason, http://graph.facebook.com/v2.0/ORIGINAL_USER_ID/picture will also still work.
/<user id>/picture does not require an access token in V2.0 and will work even when <user id> is an app scoped ID
The ID provided needs to be the user's actual ID or an app scoped IDthe response from /<user id>/invitable_friends or /<user_id>/taggable_friends won't work in the same way
Both of those APIs will also return you the full URL of the invitable or taggable user's photo
as part of the response, though.
It does work fine with original user IDs. For app-scoped IDs I haven't figured out how to use them.
While http://graph.facebook.com/v2.0/APP_SCOPED_ID/picture is supposed to work with the new app-scoped IDs, I can only get this response:
{
"error": {
"message": "Unsupported get request.",
"type": "GraphMethodException",
"code": 100
}
}
Note that this response is different from the response for completely invalid IDs. If you use an invalid user ID, you would get:
{
"error": {
"message": "(#100) No node specified",
"type": "OAuthException",
"code": 100
}
}
EDIT: As of May 10, 2014 this is a known bug.
The Graph API request that is currently working is
http://graph.facebook.com/v2.0/APP_SCOPED_ID?fields=picture

Admin of my app but still can't test action

I am an admin of my app. I am trying to test an action in the graph API explorer and comes back with....
{
"error": {
"message": "(#100) The Action Type namespace:Place is not approved, so app 1456349955xxxxx can only publish to administrators, developers, and testers of the app. User 63114xxxx is not one of those roles.",
"type": "OAuthException",
"code": 100
}
}
The user id is actually my user id. Anyone else struck this?
You should select the app for which you are admin. By default, it uses graph api explorer app.
You can find the app in timeline