Enter code here...
import facebook
page_token = 'XXX'
graph = facebook.GraphAPI(access_token=page_token, version="2.12")
page_id = '#####'
print(graph.get_object(id=page_id, fields='about, category'))
graph = facebook.GraphAPI(access_token=page_token, version="3.1")
default_info = graph.get_object(id=page_id)
# pages_data = graph.get_object("/me/permissions")
print(default_info)
page_impressions = graph.get_connections(id=page_id,
connection_name='insights',
metric='page_impressions',
date_preset='yesterday',
period='week',
show_description_from_api_doc=True)
posts1 = graph.get_object(id=page_id, fields='posts.fields(type, name, created_time, object_id)').limit(1)
print(posts1)
Then I got this error
GraphAPIError: (#12) type field is deprecated for versions v3.3 and higher
--
You received this message because you are subscribed to the Google Groups "PythonForFacebook" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pythonforfaceb...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pythonforfacebook/e3a17446-4db2-4677-87ce-cd8d7f13d5ce%40googlegroups.com.