Data4Democracy / ati-broadcastapp

The ATI Broadcast app group is building a Facebook publishing app for the group America the Indivisible. Via this app an AITD trusted partner will be able to broadcast a message to multiply Facebook groups from one interface. This will allow the local groups in a region, of which there are many, to better communicate and mobilize toward specific actions.
MIT License
7 stars 2 forks source link

FB Graph API - how will access to multiple groups work #2

Closed alecfrancesconi closed 7 years ago

alecfrancesconi commented 7 years ago

We know that the API supports multiple requests but can those requests span multiple groups in the same HTTP request and how will the access tokens work

nausicaa-rose commented 7 years ago

Facebook Graph API

The Facebook Graph API makes it fairly easy to post to multiple groups with a minimal number of HTTP requests. By using batch requests, we can post to up to 50 groups at a time (which should mean 1 request for smaller states). To set up access tokens, we'll have to connect our app to the user's Facebook account, and get a User Access Token. There is a React SDK that should help in setting this up. Once we have an access token, we should be able to post to any group the user is a member of. Further documentation on access tokens can be found here.

Here's a summary of the data fields we'll need to create, update, and delete posts.

To post to group

To update/delete post

Facebook documents these operations here.

Facebook batch requests are documented here. There is currently a limit of 50 requests per batch. Batch requests are sent as a JSON array of HTTP requests.

When messages are posted, the API returns the post-id, so we need to make sure we capture and store those in case we need to update or delete a post.

jonganc commented 7 years ago

I'm going to refactor this issue into more current ones.