tag facebook friends python sdk GraphApi in put_photo

孤人 提交于 2020-01-21 10:30:40

问题


I would to post pictures and tag with frieds.

graph = facebook.GraphAPI(self.cfg['access_token'])
tags = [{"tag_uid": "1234567890", "x": 0, "y": 0}, {"tag_uid": "0001234567890", "x": 0, "y": 0}]
graph.put_photo(image=open(str(file), 'rb'), message='Pictures test', **{'tags': tags})

but i've this error

facebook.GraphAPIError: (#100) param tags must be an array.

回答1:


error solved with

tags = [{"tag_uid": "1234567890", "x": 0, "y": 0}]
graph.put_photo(image=open(str(file), 'rb'), message='Pictures test', **{'tags[0]': tags})

but tags NOT appear on the facebook wall



来源:https://stackoverflow.com/questions/41484589/tag-facebook-friends-python-sdk-graphapi-in-put-photo

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!