新Instagram的API - 你如何要求标记的媒体? [英] New Instagram API - How do you request tagged media?
问题描述
此问题是要看起来像解决此问题的所有previous那些重复,特别是这个问题的<一个href=\"http://stackoverflow.com/questions/29264434/php-instagram-api-how-to-get-min-tag-id-and-max-tag-id\">PHP Instagram的API - 如何获得MIN_TAG_ID和MAX_TAG_ID 。但随着新的API改变了previous答案不再起作用。
目标
我想请求媒体为特定的标记。
的文档
在 Instagrams文档获取标签的媒体指定您需要有 public_content
范围,并有4个可用参数; ACCESS_TOKEN
, COUNT
, MIN_TAG_ID
和 MAX_TAG_ID
。
我的API请求
<$p$p><$c$c>https://api.instagram.com/v1/tags/cats/media/recent?access_token=TOKEN&max_tag_id=123这给了我这个API响应。
{
数据:[],
元:{
code:200
},
分页:{
德precation_warning:next_max_id和min_id是pcated该端点去$ P $;使用min_tag_id和max_tag_id代替
}
}
的问题
你可以从我不指定任德precated参数的要求看; next_max_id
或 min_id
。
我曾尝试用相同的结果,这些替代要求:
- https://api.instagram.com/v1/标签/猫/媒体/最近?的access_token = TOKEN
- 的https://api.instagram.com/v1/tags/cats/media/recent?access_token=TOKEN&max_tag_id=123
- 的https://api.instagram.com/v1/tags/cats/media/recent?access_token=TOKEN&min_tag_id=123
- 的https://api.instagram.com/v1/tags/cats/media/recent?access_token=TOKEN&min_id=123
- 的https://api.instagram.com/v1/tags/cats/media/recent?access_token=TOKEN&max_id=123
- 的https://api.instagram.com/v1/tags/cats/media/recent?access_token=TOKEN&next_max_id=123
- 的https://api.instagram.com/v1/tags/cats/media/recent?access_token=TOKEN&next_min_id=123
的资料我已经看过
我的应用程序审批:我有一个沙盒应用程序,它我使用的是同一帐户用于验证。如果我理解正确的文件,我应该能够访问所有的API与我的设置。
可用的介质:我使用的是猫的标签测试,应该有很多媒体要求
。我的的access_token
:我不认为这是一个问题,因为我使用的是同一个访问令牌,使认证 public_content
范围请求到 /用户/用户ID /媒体/最近一>端点成功。
官方蟒蛇,Instagram的回购:我不能完全解析他们是如何做的的要求,但它最近一次提交是在七月所以我甚至不能确定它的工作原理与最新的API。
相关Quesions
重读沙箱文档并抓住了这句话
不过,而不是从任何公开的Instagram用户返回的媒体,它将返回只属于您的沙箱用户,仅限于过去的20为每个用户的媒体。
块引用>我需要使用我以前贴的标签。剩下的问题为别人处理这个问题。
This question is going to seem like a duplicate of all the previous ones around this issue, specifically this question PHP Instagram API - How to get MIN_TAG_ID and MAX_TAG_ID. But with the new API changes the previous answers no longer work.
Goal
I want to request media for a specific tag.
The Documentation
Instagrams documentation on getting tagged media specifies you need to have the
public_content
scope and that there are 4 available parameters;ACCESS_TOKEN
,COUNT
,MIN_TAG_ID
, andMAX_TAG_ID
.My API Request
https://api.instagram.com/v1/tags/cats/media/recent?access_token=TOKEN&max_tag_id=123
Which gives me this API response.
{ "data": [], "meta": { "code": 200 }, "pagination": { "deprecation_warning": "next_max_id and min_id are deprecated for this endpoint; use min_tag_id and max_tag_id instead" } }
The Issue
As you can see from the request I am not specifying either of the deprecated parameters;
next_max_id
ormin_id
.I have tried these alternate requests with the same result:
- https://api.instagram.com/v1/tags/cats/media/recent?access_token=TOKEN
- https://api.instagram.com/v1/tags/cats/media/recent?access_token=TOKEN&max_tag_id=123
- https://api.instagram.com/v1/tags/cats/media/recent?access_token=TOKEN&min_tag_id=123
- https://api.instagram.com/v1/tags/cats/media/recent?access_token=TOKEN&min_id=123
- https://api.instagram.com/v1/tags/cats/media/recent?access_token=TOKEN&max_id=123
- https://api.instagram.com/v1/tags/cats/media/recent?access_token=TOKEN&next_max_id=123
- https://api.instagram.com/v1/tags/cats/media/recent?access_token=TOKEN&next_min_id=123
Things I Have Looked At
My app approval: I have a sandboxed app which I'm using the same account for authenticating with. If I understand the documentation properly I should have access to all the APIs with my setup.
Available media: I'm using the "cat" tag to test, which should have plenty of media to request.
My
access_token
: I don't think this is an issue because I'm using the same access token to make authenticatedpublic_content
scope requests to the /users/user-id/media/recent endpoint successfully.The official python-instagram repo: I couldn't quite parse how they were making the requests but it's last commit was in July so I'm not even sure it works with the latest API.
Related Quesions
- Instagram new API, get items by tag
- I want to get latest images based on tag, but only recieve my own - instagram API
解决方案Reread the sandbox documentation and caught this sentence.
But instead of returning media from any public Instagram user, it will return only media that belongs to your sandbox users, restricted to the last 20 for each user.
I needed to use a tag that I had posted before. Leaving the question for anyone else dealing with the issue.
这篇关于新Instagram的API - 你如何要求标记的媒体?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!