标签Facebook的朋友python sdk GraphApi在put_photo [英] tag facebook friends python sdk GraphApi in put_photo

查看:179
本文介绍了标签Facebook的朋友python sdk GraphApi在put_photo的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

  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 ='图片测试',** {'tags':tags})

但我有这个错误

  facebook.GraphAPIError:(#100)param标签必须是一个数组。 


解决方案


  tags = [{tag_uid:1234567890,x:0,y:0}] 
graph.put_photo = open(str(file),'rb'),message ='图片测试',** {'tags [0]':tags})

但标签不会出现在Facebook墙上


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.

解决方案

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

这篇关于标签Facebook的朋友python sdk GraphApi在put_photo的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆