首页 > 解决方案 > 在 Python 错误中通过 Instagram Graph api 发表评论

问题描述

我正在使用以下 python 代码尝试向 Instagram 媒体帖子发表评论。我收到错误:

    post_id ='nnnnnnnnnnnnn'
    params = dict() 
    params['message'] = 'This is a comment from code'
    params['access_token'] = 'xxxxxxxxxxxxx'
    url = 'https://graph.facebook.com/v6.0/'+post_id+'/comments?'   
    resp = requests.post(url,params)

这是传入的 post_id 为 'nnnnnnnn' 的错误:

'{"error":{"message":"不支持的发布请求。ID为' nnnnnnnnnn '的对象不存在,由于缺少权限而无法加载,或者不支持此操作。请阅读https上的Graph API文档: \/\/developers.facebook.com\/docs\/graph-api","type":"GraphMethodException","code":100,"error_subcode":33,"fbtrace_id":"ADoNTClMQwRIi8LEXpkfMr2"}}'

标签: python-3.xinstagram-graph-api

解决方案


推荐阅读