Instagram “You Cannot Like this Media” 400 status code

蓝咒 提交于 2019-12-19 04:51:17

问题


I am aware that the Instagram API was down a few hours ago, but it seems to be back up now. The problem is, when we post data to Instagram saying to like a specific photo, we get this error:

{"meta":{"error_type":"APINotAllowedError","code":400,"error_message":"you cannot like this media"}} We have gotten this error before, but we don't understand why we are getting it. Keep in mind, we logged into an alternate account which means that account hasn't even liked the media yet.

If it helps at all to know, we are running the like command by requesting the url https://api.instagram.com/v1/media/{media-id}/likes with {media-id} being replaced by the image id, and we are including the user's access token in the body of the http request. This is obviously a post request

There is no Instagram documentation on why we would get this message. Does anyone have a solution?


回答1:


I've run into the same thing and I found that there were three cases where I received this error:

  1. The photo has been deleted. If you are caching media data and trying to like it later this could come up.
  2. The user is private. You can't like a photo if the user is private and they haven't given you permission to follow them.
  3. You've done too much liking with the public API. If you try to like a photo and find that it's neither deleted nor is the user private, then Instagram has put a temporary ban on your account from liking via the api. I'm not sure what triggers this other than excessive liking. You'll need to wait up to a week without making any high-volume likes via that access token for the timeout to expire (although you can to a test every once in a while to see if this timeout has expired).


来源:https://stackoverflow.com/questions/28477010/instagram-you-cannot-like-this-media-400-status-code

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!