Instagram API-使用视频短代码获取无效的媒体ID [英] Instagram API - Getting invalid media id with video shortcode

查看:83
本文介绍了Instagram API-使用视频短代码获取无效的媒体ID的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用instagram的/media/shortcode/shortcode端点来获取有关带有短码的某些媒体的信息.

I'm using the /media/shortcode/shortcode endpoint of instagram to get information about a certain media with a shortcode.

https://www.instagram.com/developer/endpoints/media/#get_media_by_shortcode

问题是,当我将照片的简码传递到端点时,一切正常,并且可以从Instagram获得期望的结果,但是,当我将视频的简码传递到该端点时,api返回以下内容:

The problem is when I pass a photo's shortcode to the endpoint everything works fine and I get the result I'm expecting from Instagram, however, when I pass a video's shortcode to that endpoint, the api returns the following:

{
  "meta": {
    "code": 400,
    "error_type": "APINotFoundError",
    "error_message": "invalid media id"
  }
}

这对我来说没有太大意义,因为给定的端点应该可以很好地处理视频.

Which does not make a lot of sense to me since the given endpoint should work just fine with videos.

推荐答案

我也遇到了这个问题-Instagram文档并不十分清晰,但这是由于沙箱模式的局限性所致.

I was running into this issue too---the Instagram documentation is not super clear, but this is because of the limitations of Sandbox mode.

为帮助您开发和测试您的应用,沙盒模式下可用的用户和媒体是真实的Instagram数据(即Instagram应用中通常可见的数据),但具有以下条件:

To help you develop and test your app, the users and media available in Sandbox mode are real Instagram data (i.e. what is normally visible in the Instagram app), but with the following conditions:

  • 沙箱中的应用程序最多只能有10个用户
  • 数据仅限于10个用户,并且每个用户最近的20种媒体
  • 降低的API速率限制

来自 https://www.instagram.com/developer/sandbox/.

TLDR,您需要批准您的应用程序才能使其他API调用正常工作.

TLDR you'll need to get your app approved to have your other API calls work.

这篇关于Instagram API-使用视频短代码获取无效的媒体ID的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆