Using Facebook's GraphAPI I am trying to post to a public group. It appears that a page by the same name also exists and it is defaulting to post to that instead.
Currently I am using
posts = graph.get("NAME_OF_GROUP/feed", page=True, limit=1):
Hopefully there is a way to default it to group over page. I cannot find much in the documentation.
Only pages have a name that they are accessible by via API. A group name is "just for people", for display purposes, it was never possible to use that to access the group in API calls. So there is no defaulting of page over group going on here; if the page did not exist at all, you would still not be able to access the group this way - the group ID is the only way to do that.
And posting to a group will require an access token from the group admin these days, https://developers.facebook.com/docs/graph-api/reference/v2.12/group/feed#publish
Related
I am making a website for a teacher and he wants to be able to take attendance easily and he wants me to use the google classroom api to access his roster in his class so that it can then display that list of names on the website and he can easily take attendance there
Roster importing is a common use case we see with the Classroom API. Here's what the workflow typically looks like:
On your website, the teacher chooses the option to import a Classroom Course.
On your backend, call the courses.list method through the Classroom API, which will return a json response.
From this json response, list the titles of the teacher's courses for them to select 1. Note: you'll need to keep track of the course IDs to continue onto the next step.
With the course ID, call the students.list method and display all names on your website for teachers to take attendance.
On each of the links above, you can use the API Explorer to see exactly how these methods behave. I also recommend you check the documentation for managing courses and students/teachers -- there are code snippets for a few different languages, including Python.
Hope this helps!
The best thing to start with is to navigate in the official documentation for Classroom API.
The Classroom API provides a RESTful interface for you to manage
courses and rosters in Google Classroom.
For python, you can refer to the quickstart guide designed for Python implementation. See sample code.
To access students, use REST Resource: courses.students.
You will be able to use the supported methods such as create, delete, get and list.
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!
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
Is there a way to get the hometown and gender of users who comment on a specific Page Post, using the facebook graph API or any other?
More precisely, when I do extract comments on a Page Post with Graph API, it shows me all the IDs of Users who had posted comments. But I need also hometown where they live in order to assign the results of Sentiment Analysis to each city.
GET /v2.6/{PageID_PostID}/comments?fields=from&limit=150
so far as I know Twitter API has such a possibility (using Python’s Tweepy library), but is it possible to extract such a data from Facebook?
I appreciate any help you might have.
Vahid
That´s not possible, you even need an extra permission to authorize a user in order to get his hometown, and you can´t get the gender without authorization either.
I'm trying to update the groups assigned to users via an API (via rest) with Tastypie.
I tried passing the group id's directly in, however it says that the URL provided is not a valid resource. I then tried passing in a URL such as '/api/v1/groups/1/' but that is saying that's not a link to a valid resource.
Any hints? I'm creating user records just fine from a standard django view/form, but I would like to do this as a REST action.
Do you need to specify the format, such as: /api/v1/groups/1/?format=json ?