Using Facebook Graph API to automatically delete comments in a group - python

I'm trying to automatically delete certain comments on posts within a facebook group which I admin.
When I try and delete it, I get this:
facebook.GraphAPIError: (#3) Publishing comments through the API is
only available for page access tokens
I happen to have a page which I have a page access token for. When I use it I get:
facebook.GraphAPIError: Unsupported delete request. Object with ID
'722227087901405' 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
I've set every permission possible and have also tried to see if it's possible to get a page access token for the group I admin to no avail.
Is what I'm trying to do possible or just not supported?
Also I don't know how much it matters but I'm doing this with the python SDK.
Any help would be appreciated, thank you!

Related

Using cookies to store oauth authorization tokens

I’ve seen a couple examples of this ( Storing auth tokens in a cookie )already; but I’d like to understand the reason for doing this.I think this would create more problems because you have to specifically remember to delete the cookie after you’re finished. For my specific example ; I am dealing with Instagram via the API
Thank you for any and all help
I`m not sure exactly what you're asking for. You need to know how to store the token? However, then is no need to remember to delete a cookie, just set an expiration date.
Regarding the API, you will need a valid token everytime you do a request to API, so don`t delete it, otherwise you will need to re-authenticate everytime.
Note: For Instagram Business Accounts you need to use Facebook API.
https://developers.facebook.com/docs/instagram-api/v2.10

Who get comments from post group with Facebook API

I try to get the comments of a post from a group that I am a member (only member) and that by the way, the group is closed, but it does not return anything ..
I try it this way: {postid}/comments
I really do not know if you're allowed what I'm trying to do. What if you let me get is information about the videos that have been posted in the group.
I have never used the Facebook API before, so I know very little about the topic.
If I remember right facebook api allows you to programmatically access content of only public groups. To get data from private/closed groups you need to be admin, as user #WizKid pointed out

Calling "me/groups" using Python Facebook SDK returns empty data

I want information from groups where I am and I can not get it. Always the code returns an empty data.
{u'data': []}
My code is as follows:
import facebook
graph = facebook.GraphAPI(access_token='my token')
a = graph.get_object('me/groups')
print(a)
What is wrong? I'm using Python 2.7.10 and Facebook official sdk.
I've tried with facepy and it's the same, empty data.
Is it a bug?
First you question isn't complete. You need to show what permissions you are asking for and what API version you are using. That said I suspect one of two things.
You are not using the necessary permission "user_managed_groups".
Or
You don't realize that with that permission that "groups" edge will only return the groups which the user is an admin of.
It is not possible to do anything with a group that the logged in user is not an admin of via the API. Learn about me/groups HERE

Can facebook access token be used for someone else's data?

Does facebook allow to use one person's access token to fetch post info of another person (post comments, likes)?
I am thinking of implementing a pool of tokens in my app, so if token is broken I can use other persons token. Wondering if it's allowed and whether facebook have some restrictions on such a use case.
Additionally, I am currently using FQL, is there a difference for Graph API in how tokens work?
Short answer: It is not possible. That would be an incredibly large privacy problem anyway.
Also, for user postings you need the "read_stream" permission and you probably will not get this one approved:
This permission is reserved for apps that replicate the Facebook
client on platforms that don’t have a native client.
(https://developers.facebook.com/docs/facebook-login/permissions/v2.0)
About FQL: There is no difference, although keep in mind that FQL is deprecated and will be removed when support for v2.0 runs out. See this link for more information: https://developers.facebook.com/docs/apps/versions#versioning
(thanx to Tobi for clarification)

How to fetch user's mobile number from facebook?

I am using django-social_auth to make users register and login via facebook. I want to access the phone number of the user.
Tried searching on google and stackoverflow , but didn't find any answer. Searched the facebook docs as well. There I found that there used to be permission for 'user_mobile_phone' but it has been removed.
It was also written than now it will be provided with basic permissions but it wasn't available(what I found).
I tried using Graph API, but was unsuccessful.
So, Someone please tell me the way ,if there is any, to get user data.
EDIT:17 June 2014 -
Is this possible now to get User's Mobile number via the Graph API ?
The API does not let you access the user's contact number. You will have to request the user's contact details manually using a form.

Categories