Can';t使用facebook instagram graph api创建媒体

Can';t使用facebook instagram graph api创建媒体,facebook,instagram,instagram-graph-api,Facebook,Instagram,Instagram Graph Api,我有一个测试业务应用程序,可以正常查询用户信息。 我可以在我的Facebook页面上成功验证所需的作用域 以下是我要求的范围:instagram\u basic、instagram\u内容\u发布、用户事件、用户视频、用户帖子 然而,当我尝试使用创建帖子时,我得到了一个错误。请求如下: curl --location --request POST 'https://graph.facebook.com/me/media?access_token={ommited}' \

我有一个测试业务应用程序,可以正常查询用户信息。 我可以在我的Facebook页面上成功验证所需的作用域

以下是我要求的范围:
instagram\u basic、instagram\u内容\u发布、用户事件、用户视频、用户帖子

然而,当我尝试使用创建帖子时,我得到了一个错误。请求如下:

curl --location --request POST 'https://graph.facebook.com/me/media?access_token={ommited}' \
                --form 'image_url="https://cdn1.vectorstock.com/i/thumbs/59/70/flat-robot-vector-20655970.jpg"' \
                --form 'caption="nothing to see here :-"'
答复:

"error": {
        "message": "Unsupported post request. Object with ID 'me' does not exist, cannot be loaded due to missing permissions, or does not support this operation. Please read the Graph API documentation at https://developers.facebook.com/docs/graph-api"
}
...

我用用户id而不是
me
尝试了这个请求,但也不起作用。

我找到了答案

基本上,当我们查询
/media
端点时,api需要一个“IG用户”id。在这种情况下,我使用的是FB用户令牌,因此api无法识别“我”是谁。我们只能在拥有
access\u令牌的对象(即用户和页面)上真正使用“我”

我通过传递我的instagram\u business\u帐户id解决了这个问题,可以通过传递以下字段在FB用户端点()上查询该id:

fields=accounts{instagram_business_account{id}}
它基本上返回与用户关联的帐户(即“页面”和与这些页面关联的“IG用户”)

--

因此,最后,实际创建媒体容器的最终请求将如下所示:

# Endpoint
https://graph.facebook.com/*instagram_business_id*/media
# replace instagram_business_id with the instagram_business_id you got upon querying the Graph API
# query params:
    
     - access_token=
     - image_url=https://cdn1.vectorstock.com/i/thumbs/59/70/flat-robot-vector-20655970.jpg
     - caption=your_image_caption

我建议你在Well提交一份bug报告也许你能帮上忙。。。当使用instagram\u business\u帐户进行呼叫时,以及在帖子中使用图像\u url和标题时,我不会返回容器id。。。那么,你能编辑你的答案来解释“你做了什么?”彼得也许你可以展示你试图做的请求,以及你得到的回应?把它上传到某个地方。