14

I'm new on working with Facebook and honestly I found it very confusing, terminology and documentation seems to be very ambiguous in many cases. Can somebody please help me out with a plain english explanation on how I can achive the following?

  • Post and image to Facebook (on the user page) and then check the stats (insights) of that post.

Till now I have managed to:

1) Create an app

2) Post the image on the user page with the desired message

I'm not able to understand how I can retrieve information about the particular image which was uploaded through my app. I want to know how many people have viewed that image, how many likes did it get, how many times it was re-shared.

Is it possible at all?

I'm posting to /photo not too /feed and I will like to keep it this way if it is possible.

Sorry if this was answered already but I spent a few hours trying to find an appropriate answer but wasn't able to get the right documentation.

UPDATE 1

After having a couple of days off from this topic and receiving the first 2 answers, I took another dive into this. Now I have tried the Graph API Explorer as suggested, and using the ID of a POST I can get some details about the POST, but the insights aren't showing anything, just next and previous.

My goal is to be able to gatther some stats about the pictures uploaded through the app. If this is not possible directly what should be the approach I need to take?

Emil Borconi
  • 3,326
  • 2
  • 24
  • 40

2 Answers2

5

I don't believe a personal /photo has /insights attached to it - the Insights Object documentation page suggests that they do not - but you should be able to get likes, shares, and comments via the API.

It would appear FB has launched a redesign/reorganization of its documentation in the last couple of weeks, but the documentation for the /photo graph object is here -- you will need the user's Access Token, and the API endpoints you're looking for each have links to their own documentation pages there, including example code for each type of request.

Edit (summarizing discussion in comments):

There is no method via the Facebook API to gather insights for all photos posted to individual user timelines via an app. The app can gather likes, shares, and comments for each of those objects individually via API requests, and can make API requests for insights for photos posted to its own timeline. Neither of those options solves the intended use case here.

I'd recommend a solution that uses Sharing rather than an app integration, as this allows for better access to insights on the photos being shared. This is also a much simpler integration, and less brittle wrt future Platform changes. The main tradeoff is that the original photos being shared are expected to expire after a couple of months -- if this is unavoidable, I'd suggest implementing a redirect for requests for expired objects on the site.

nthall
  • 2,847
  • 1
  • 28
  • 36
  • So if I understand correctly, I need user access right to get the stats of each image particularly. Isn't there any way to get the stats of all the images which have been posted using the APP? – Emil Borconi Feb 10 '16 at 20:09
  • If the images were posted to individual user timelines as a result of user interaction with the app, it's complicated. You can see photos for each user with a valid access token for each user; or you can see photos that the app has posted on its own timeline. But I don't believe there's any single way to access details on all photos users have posted using your app in one go (via the API). – nthall Feb 10 '16 at 20:47
  • Uh... that's nasty... :( The concept is I'm build a website to a client who want's to enable user to share photos (10's of thousands of photos are added monthly) from his page, but he needs to get some statistics of the shares, re-shares, likes, etc... dumping all that through the app page can get messy, hence I wanted to upload directly to users page, plus audience is usually better for uploaded images, then to shared content (from another page), but what you are saying it means my approach is a no go... :( – Emil Borconi Feb 10 '16 at 20:53
  • Are you certain that you can't accomplish what this project needs through the standard Facebook sharing integration? much simpler than a custom app. [See here](https://developers.facebook.com/products/sharing/) for basics on sharing and [see here](https://developers.facebook.com/docs/platforminsights/domains) for details on Insights – nthall Feb 10 '16 at 21:04
  • I don't really want to share links to the photos. Since the site is posting about 2 million images a year the old content will get removed from the server in a few month after it was added. When that happens the links will be dead... – Emil Borconi Feb 10 '16 at 21:22
  • Well, if I were in your shoes I'd look at using Sharing and some kind of redirection for expired photos, and see if that would be good enough -- in my experience photos from a few months ago don't get a lot of views anyway. Otherwise you will be working upstream against the Platform to try and build something that will probably replicate a good chunk of what they already do, and risking that Platform changes could break your integration at any time down the road. Unfortunately I'm out of other suggestions. – nthall Feb 11 '16 at 00:50
  • While your answer isn't exactly what I was hoping for (not your fault more like Facebook limitation) if you can please update the answer with the comments (just to make it look pretty), I will happily award you the bounty. – Emil Borconi Feb 17 '16 at 14:45
  • Thank you -- sorry that there isn't a better answer (I definitely feel your pain on the limitations of the platform :p) but hopefully this discussion has been useful and informative. – nthall Feb 17 '16 at 14:54
2

We are able to get different kind of photos or picture Using Graph API like as below:

1.Page Photos

Photos for a Facebook Page.A Page Access Token is required for all methods.Find here

2.Page Picture

Picture belonging to a Facebook Page. Find here

3.Photo

Represents an individual photo on Facebook. Find here

4.User Photos

Photos for a person.Find here

I hope it's helps you.

Community
  • 1
  • 1
pRaNaY
  • 24,642
  • 24
  • 96
  • 146