Facebook Graph API error #200 even with correct permissions
Asked Answered
C

1

1

I'm setting up a bot to auto-post on a facebook page. But when i run the script, the graph API throws the following error:

facebook.GraphAPIError: (#200) If posting to a group, requires app being installed in the group, and
either publish_to_groups permission with user token, or both pages_read_engagement
and pages_manage_posts permission with page token; If posting to a page,
requires both pages_read_engagement and pages_manage_posts as an admin with
sufficient administrative permission

I give all the necessary privileges.

I try on both on group I manage and groups that I'm a member.

enter image description here

Hee is my pyhton code:

import facebook

groups=["887346338525098"]

access_token="tettrt"

msg="Apprenez l'arabe en dormant: Les 101 phrases quotidiennes les plus utiles"
link="https://youtu.be/8cZuLsYqhtA"
group="Funshoping" #887346338525098"

graph=facebook.GraphAPI(access_token=access_token)
x=graph.put_object(group, 'feed',message=msg, link=link)
Calendula answered 21/10, 2022 at 16:13 Comment(2)
Did you install the app in the group like the error message say?Holyhead
A page, and a group, are two different things.Tabbatha
W
0

Ensure that your app is in Live mode:

  1. Navigate to https://developers.facebook.com/apps/.
  2. Select the app you use.
  3. Convert the App Mode to Live

It might ask you to add a privacy policy link in the app settings. If so, navigate to App Settings -> Basic -> and put your Privacy Policy URL in the relevant field.
Note that you need to add a valid privacy policy URL, you can use https://www.freeprivacypolicy.com to generate a one and host it.

Workout answered 26/7 at 14:18 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.