Accessing an application page with facebook graph api - facebook

I'm trying to access a facebook page's conversations using the graph api.
Accessing the page itself (with /{page_id}) is fine, but I get on oauth exception for the conversations.
My request in the graph explorer is this one :
/{page_id}/conversations where {page_id} is, well, the page id :)
and the error is
{
"error": {
"message": "(#10) Application does not have permission for this action",
"type": "OAuthException",
"code": 10
}
}
According to the documentation, the required authorization is read_page_mailboxes, which I granted. Here are the rights of my token as shown in the oauth debugger :
public_profile, basic_info, read_page_mailboxes, manage_pages, user_friends
Are there other permissions I'm supposed to require ?

In fact, just asking for the permission itself is not the right way to access to this page informations.
You have to recover the page access token located at /{page_id}?fields=access_token and use this token in order to access the conversations.

Related

Why does facebook’s graph API return a permissions error when I try to get the “owner” of any facebook event that I am personally invited to?

I am using facebook's graph api. The access token I am using is the User's access token, (my personal access token). I am invited to these events personally. These events are public.
When I type /{eventid}/?fields=owner, I get
{
"error": {
"message": "(#200) Permissions error",
"type": "OAuthException",
"code": 200,
"fbtrace_id": "DcJaHySwF7S"
}
}
When I do /{eventid}/?fields=cover or most other fields it works just fine.
I am using the online graph tool v3.3 and tried it on v3.2 as well.
I have also tried this on curl on my personal terminal.
Below is the oath permissions I have set using the Graph API explorer.
Permission's Image
Since you cannot even get the list of Page Events right now (even if you own the Page), I assume it´s not possible: https://developers.facebook.com/docs/graph-api/reference/page/events/
This is a restricted edge. You cannot request access at this time.

Facebook Business page - Unsupported get request

I have admin access to a Business Facebook page, I created an app under the same account, when I then try to use the Graph API Explorer under that application using the access token generated I get:
get/v2.5/{client-name}/
"error": {
"message": "Unsupported get request. Please read the Graph API documentation at https://developers.facebook.com/docs/graph-api",
"type": "GraphMethodException",
"code": 100
}
I have full access so I do not know why I am getting a error. This normally works fine when I try it on a standard Facebook page, is there something extra I need to do for Business pages?
Since you are trying with an App Token, i assume that the Page is restricted by age or location. In that case, you have to use a User Token or Page Token of a user who is allowed to see the Page and its content.
More information about Tokens:
https://developers.facebook.com/docs/facebook-login/access-tokens
http://www.devils-heaven.com/facebook-access-tokens/

facebook error Metric requires app admin privileges

I'm trying to access Facebook insights payments_daily_spend with the API with this url:
https://graph.facebook.com/v2.1/APPID/app_insights/payments_daily_spend?since=1403506800&until=1412146800&summary=true&date_format=U&access_token=ACCESSTOKEN
but all I'm getting back is
{
"error": {
"message": "(#3003) Metric requires app admin privileges",
"type": "OAuthException",
"code": 3003
}
}
The app access token I'm using was gotten with an account that has admin privileges for the app, and I can't seem to find any reference to this error anywhere. Has anyone seen this before or know what's wrong?
I finally got an answer by submitting a ticket to Facebook. You need an access token with the read_insights extended permission. You can get it from the Graph API Explorer, but there's probably an API call for getting such a token.

Getting videos uploaded by facebook page without requiring user to log in

I'm trying to get videos of facebook page using facebook graph api.
I get it to work when I use my personal access facebook accounts access token but if I try to use my apps token it returns
{
"error": {
"message": "A user access token is required to request this resource.",
"type": "OAuthException",
"code": 102
}
}
Is there way to get pages public videos from the api by using app token?
If not, is there way to use just my personal access token and renewing it automatically without requiring the user to login. (Server would always make the request with MY OWN access token, not their)

Facebook Graph API, Unable to get user profile

When I http using graph API explorer in the context of "Graph API Explorer", I am able to query user information as -
/v2.0/{user-id}
when I http in the context of my app, I see the response as:
{
"error": {
"message": "Unsupported get request. Please read the Graph API documentation at https://developers.facebook.com/docs/graph-api",
"type": "GraphMethodException",
"code": 100
}
}
Permission lists are same both on Graph API Explorer as well as my App:
user_about_me
user_activities
user_birthday
user_events
user_friends
user_likes
user_location
user_photos
user_status
user_videos
email
publish_actions
read_friendlists
read_stream
I regenerated a new access token and tried different sets of user ids and it seems to be working now.