facebook-graph-apifacebook-php-sdk

the comments of posts or video does not return data from page facebook


I'm utilizing Meta Developer Tools to test an API, but I'm encountering an issue where I'm not receiving any comments, posts, videos, or attachments. Interestingly, I successfully used the same endpoint last week and received the expected data. I'm unsure why this isn't working anymore. Here's the endpoint I'm using:

me?fields=posts{message,created_time,id,comments{message,id,from,created_time},attachments{media_type,subattachments},status_type},videos{description,title,source,id,created_time}

response on meta developper too


Solution

  • I can get the data with the same endpoint:-

    me?fields=posts{message,created_time,id,comments{message,id,from,created_time},attachments{media_type,subattachments},status_type},videos{description,title,source,id,created_time}
    

    Make sure you select the page in Page Access Tokens in the "User or Page" dropdown.

    Permission scope used: pages_show_list, business_management, pages_read_engagement, pages_manage_metadata, pages_read_user_content, pages_manage_ads, pages_manage_posts, pages_manage_engagement

    I hope this helps.

    EDIT: I added the access_token explicitly in the query parameter but it also works without adding it to the query parameter(as the tool does it for you when you make request, you check this in the cURL command by clicking on "</> Get Code").

    enter image description here