【问题标题】:In Instagram Graph API, when I try to publish to Instagram, I receive error 24 subcode 2207006 and cannot publish在 Instagram Graph API 中,当我尝试发布到 Instagram 时,收到错误 24 子代码 2207006 并且无法发布
【发布时间】:2022-07-12 00:35:18
【问题描述】:

在过去的 3 个月里,我一直在自动将图像发布到我的 Instagram 帐户。但是今天它不再起作用了,我想是因为我的访问令牌过期了。只是发布不起作用,我仍然可以创建对象,这让我感到困惑,因为新的访问令牌适用于某些 api 调用,但不是全部。

我用于创建对象的端点参数:

{'caption': 'Filler caption',
'access_token': 'removed',
'image_url': https://www.smashbros.com/assets_v2/img/fighter/mega_man/main.png'}

对象网址: https://graph.facebook.com/v6.0/17841406231094676/media

我为 python 导入请求,然后做

data = requests.post( url, endpointParams )

我回来了

{'creation_id': '17900592242391633',
'access_token': 'removed'}

publish Url:
https://graph.facebook.com/v6.0/17841406231094676/media_publish

---- PUBLISHED IMAGE RESPONSE -----

Response:
{
"error": {

"message": "The requested resource does not exist",

"type": "OAuthException",

"code": 24,

"error_subcode": 2207006,

"is_transient": false,

"error_user_title": "Media Not Found",

"error_user_msg": "The media with 17,900,592,242,391,633 cannot be found.",

"fbtrace_id": "AIYNvGl2IQQp5L9G7kb9F7O"

}
}

有谁知道我该如何解决这个问题?

编辑:我的脚本又开始工作了,我相信这是 Facebook 的错误

【问题讨论】:

  • 此错误对您来说持续了多长时间?

标签: facebook instagram instagram-graph-api


【解决方案1】:

问题是您需要 2 种不同类型的令牌。用于创建媒体对象的页面令牌,然后是用于实际发布到 Instagram 的用户令牌。我猜在你的情况下它一开始是有效的,因为两个令牌都是有效的,但随着时间的推移,两者都过期了,但只有一个被你的系统更新。

我遇到了同样的问题,我只能上传媒体对象但不能发布它,直到我使用页面令牌创建媒体对象,然后使用新的用户令牌发布它。通过这样做,我可以立即使用它。

我从这里得到了那个解决方案,希望对你有帮助

Media Builder Not Found Exception while Publishing into Instagram using Graph API

【讨论】:

    猜你喜欢
    • 2021-07-10
    • 1970-01-01
    • 2022-07-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-02-28
    • 2021-08-05
    • 1970-01-01
    相关资源
    最近更新 更多