Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Media instagram endpoint not working - Invalid media id

I'm trying to use https://www.instagram.com/developer/endpoints/media/, but for every media id that I use I get always the same result :

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

I'm getting the media id from another api service, for example:

https://api.instagram.com/oembed?url=http://instagr.am/p/fA9uwTtkSN/.

So in the response we can see ``"media_id":"558717847597368461_9538472"`, then I use that id in media endpoint and i get "invalid media id".

I was wondering if the api is having some problems or maybe I missing something.

like image 897
Sivecode_Santiago Avatar asked Dec 09 '22 00:12

Sivecode_Santiago


2 Answers

I guess you are using a valid access token!

The app you are using, is it in Sandbox mode or live? Instagram has recently changed the API endpoints. If your app is in Sandbox mode, only Sandbox user's media can be accessed.

If none of the above applies, contact Instagram! They can only help you.

Hope it helps!

like image 148
coderz Avatar answered Dec 10 '22 12:12

coderz


You are maybe getting that error because the user that posted the media is a private user. That was my case.

like image 45
Adrian Avatar answered Dec 10 '22 14:12

Adrian