简体   繁体   English

Instagram Business Discovery API:按 ID 检索单个媒体

[英]Instagram Business Discovery API: retrieve single media by ID

Is there any way to get data for a single media obtained with business discovery?有什么方法可以获取通过业务发现获得的单个媒体的数据? Here's my use case:这是我的用例:

I use business API to get media from certain users.我使用业务 API 从某些用户那里获取媒体。 I save all the posts data, including media ID, images, etc. to build a gallery.我保存所有帖子数据,包括媒体 ID、图像等,以建立画廊。

Once in a while, some media urls expire and the gallery start to show broken images, so I need a function that refresh the posts that have expired images via API, in order to get the new media urls.偶尔,一些媒体 url 过期并且画廊开始显示损坏的图像,所以我需要一个 function 通过 API 刷新具有过期图像的帖子,以获得新的媒体 url。

In order to do that, I need to access the single media.为此,我需要访问单一媒体。 I tried with direct media ID我尝试使用直接媒体 ID

GET /{media-id}

but I got但我得到了

Unsupported get request. Object with ID '17893828628657031' does not exist, cannot be loaded due to missing permissions, or does not support this operation.

It seems that I don't have direct access to media discovered with business discovery API.似乎我无法直接访问通过业务发现 API 发现的媒体。

Any suggestions?有什么建议么?

It seems that I don't have direct access to media discovered with business discovery API.似乎我无法直接访问通过业务发现 API 发现的媒体。

Yes, that appears to be the case.是的,情况似乎如此。 In the endpoint documentation, in the section titled "Getting Basic Metrics on Media" , it explicitly says:在端点文档中,在标题为“Getting Basic Metrics on Media”的部分中,它明确表示:

You can use both nested requests and field expansion to get public fields for a Business or Creator Account's media objects.您可以使用嵌套请求和字段扩展来获取企业或创作者帐户的媒体对象的公共字段。 Note that this does not grant you permission to access media objects directly — performing a GET on any returned IG Media will fail due to insufficient permissions.请注意,这并不授予您直接访问媒体对象的权限 - 由于权限不足,对任何返回的 IG 媒体执行 GET 将失败。

So I guess you could only make the original business discovery request again - and then update your data storage with the current URLs this returns.所以我猜你只能再次发出原始业务发现请求 - 然后使用返回的当前 URL 更新你的数据存储。 If the account added new media since your last request, you might need to paginate through the results, to find your specific older media item IDs in there again.如果帐户在您上次请求后添加了新媒体,您可能需要对结果进行分页,以便再次在其中找到您的特定旧媒体项 ID。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM