query IG Media api return Unsupported get request

Viewed 732

I have created different API queries on searching hashtags and searching recent media with that. This all works fine. but when I grab the ID from media objects from the recent_media query and try to query them separately since then I'm able to query more data. It won't work.

https://graph.facebook.com/v7.0/ig_hashtag_search?access_token={token}&user_id={user_id}&q=stackoverflow

This returns

    "data": [
        {
            "id": "17843780662045901"
        }
    ]

Then I query

https://graph.facebook.com/v7.0/17843780662045901/recent_media?access_token={token}&user_id={user_id}&fields=id,media_url

with result

    "data": [
        {
            "id": "17939405797365335"
        },
        {
            "id": "17868693508835640"
        },

and then I try to access media

https://graph.facebook.com/v7.0/17939405797365335?access_token={access_token}&user_id={user_id}&fields=username

I get

    "error": {
        "message": "Unsupported get request. Object with ID '17939405797365335' does not exist, cannot be loaded due to missing permissions, or does not support this operation. Please read the Graph API documentation at https://developers.facebook.com/docs/graph-api",
        "type": "GraphMethodException",
        "code": 100,
        "error_subcode": 33,
        "fbtrace_id": "AkgnyCLvXaH430A6Rji4Ju0"
    }

User has the following permissions:

        'instagram_basic',
        'pages_show_list',
        'pages_read_engagement'

I also tried other fields instead of the username. but nothing works. seems everything should be right . rechecked the docs 100 times.

0 Answers
Related