tshrinivasan / post-to-facebook-groups

python script to post content to multiple facebooks groups
38 stars 28 forks source link

what is the API code? #3

Open xixiaofinland opened 7 years ago

xixiaofinland commented 7 years ago

Hi,

I try to figure out what API code to fill in, but couldn't.

  1. I go to https://developers.facebook.com/tools/explorer,
  2. use "get user access token" to retrieve the token and insert into the python script
  3. script throws error The user hasn't authorized the application to perform this action, retries remaining: 0

Do I need to grant specific permissions before hitting "get user access token" button?

Thanks, Xi

tshrinivasan commented 7 years ago

if you open the link https://developers.facebook.com/tools/explorer it automatically generates a token and displays on the access token box.

Do you get the access token?

if not, share a screenshot of that page.

2017-09-21 13:25 GMT+05:30 Xi Xiao notifications@github.com:

Hi,

I try to figure out what API code to fill in, but couldn't.

  1. I go to https://developers.facebook.com/tools/explorer,
  2. use "get user access token" to retrieve the token and insert into the python script
  3. script throws error Error validating access token: The session was invalidated explicitly using an API call., retries remaining: 0

Do I need to grant specific permissions before hitting "get user access token" button?

Thanks, Xi

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/tshrinivasan/post-to-facebook-groups/issues/3, or mute the thread https://github.com/notifications/unsubscribe-auth/ABNbON3xzBlkrRdZD9i5OP3Aj6nPuUatks5skhZugaJpZM4Pe733 .

-- Regards, T.Shrinivasan

My Life with GNU/Linux : http://goinggnu.wordpress.com Free E-Magazine on Free Open Source Software in Tamil : http://kaniyam.com

Get Free Tamil Ebooks for Android, iOS, Kindle, Computer : http://FreeTamilEbooks.com

xixiaofinland commented 7 years ago

I did use the auto generated token (in the access token field) as screenshot below. The error came from it.

screen shot 2017-09-21 at 14 00 55

xixiaofinland commented 7 years ago

Here is the code, blank lines were cut off so it fits in one screenshot. The group ID is from a group I recently created. I also tried with another group that I belong to and have permission to post, but the error is the same.

screen shot 2017-09-21 at 14 08 56

Error stack

Posting to http://www.facebook.com/groups/1667747819923309
WARNING:root:Exception on https://graph.facebook.com/1667747819923309/feed: [200] (#200) The user hasn't authorized the application to perform this action, retries remaining: 0
Traceback (most recent call last):
  File "post_to_fb_groups.py", line 22, in <module>
    graph.post(path =str(group_id) + '/feed', message=message)
shynigami commented 7 years ago

posting the same message to all groups you manage at once would not be allowed - it would be autoposting and prefilling, both not allowed according to the platform policy. and the question was about access to groups you are a member of, not only groups you manage.

ShinNinth commented 6 years ago

@Xixiao007 I ran in to this same issue it is a permission I am unsure exactly which as i just turned them all on and it began working correctly. best bet is to trial and error it or turn them all one =/