我在玩googlemirrorapi,我正在努力找到一种方法,只把一张卡推给一个特定的用户。你知道吗
当我尝试用以下Python代码发布卡片时,给出了userid(12345677):
timeline_item = {'text': 'Test10'}
timeline_item['recipients'] = [{'id':'12345677'}]
self.mirror_service.timeline().insert(body=timeline_item).execute()
该卡在所有其他测试用户的时间线上可见。你知道吗
我做错什么了?你知道吗
recipients
字段没有指定时间线项应该发送给谁。它包含有关谁已被发送的信息卡上的信息-它是为所有回复卡使用,以便能够处理应发送给多人的回复(不一定使用玻璃)。你知道吗不清楚您使用的是哪种语言,但听起来好像您正在将项目发送给服务的所有经过身份验证的用户。你知道吗
通常,您将指定特定用户的OAuth令牌以写入其时间线。你知道吗
看起来您正在用Python编写代码并使用Google APIs Client Library for Python。要将时间线项目推送到特定的用户id,请在创建镜像服务时设置用户id。Mirror API Python Quickstart在它的notifications code中有一个例子说明了如何做到这一点。
recipients
字段与将项推送到谁的时间线无关。你知道吗^{} 的代码
相关问题 更多 >
编程相关推荐