在put_photo中标记facebook朋友python sdk GraphApi

时间:2017-01-05 12:01:42

标签: python facebook facebook-graph-api facebook-javascript-sdk facebook-php-sdk

我会发布图片和标签与炒。

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})

但我有这个错误

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

1 个答案:

答案 0 :(得分:0)

错误已解决

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

但不会在Facebook墙上显示标签