简体   繁体   中英

Facebook Graph API - Pulling photos from tagged posts

I'm using the Facebook Graph API in PHP to pull tagged and uploaded photos from a user. We are currently using the /me/photos... endpoint to grab both kinds of photos. On our side, the code roughly looks like...

$api_call = $this->facebook->api("me/photos?date_format=U&since=$since_time&until=$current_time&limit=".$photo_limit);

// Valid response was received
if(isset($api_call['data'])){

    // Get the photos the user is tagged in
    $user_tagged_photos = $api_call['data'];
}

Variables in the URL string are just vars we set. We then just do the same thing for uploaded photos.

However, what my team has realized is that users also sometimes are tagged in posts that have associated pictures with them. So, maybe they are tagged in a post with a picture of them, but they aren't physically tagged in the photo.

Is there a method available for grabbing photos from posts a user is tagged in? The graph api reference for /post/ lists "picture" as a field but describes it as:

The picture scraped from any link included with the post.

Which is not what I want. I want the attached picture, just can't seem to find a way to access...

Thanks in advance for any help.

In that case, object_id in the Post object that gets returned when making a request to /{user-id}/tagged should be the ID of any photo/video that is attached to the post the user is tagged in.

Check the docs for the /post endpoint.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM