Google Photos API - Can I access existing enrichments? - google-photos

I'm using the Google Photos Java API to create a small program to access the contents of a pre-existing album. I have been able to get code up and running that can report the album's name, and the media items it contains and so on, but not the text added between photos. I understand that the API considers these texts a form of enrichment and I can see there are functions for adding such enrichments to an album, but is there any way to list the enrichments already in an album? Or otherwise access the text a user has previous added between photos via the platform's desktop browser interface?

Unfortunately the Google Photos Library API does not provide a way to access existing album enrichments when accessing the contents of an album.
This has been filed as a feature request on the issue tracker for the API. You can 'star' it to draw attention to it and be notified of any updates: https://issuetracker.google.com/129050144

Related

Using facebook graph api to read photo tags

I am building a website using React and Redux to search facebook photos through tags like my Friends name or by location. User needs to login with facebook so that the application can read its pictures. A user simply puts in the search filters like Tagged users or the location of the picture and my app will show results based on the filters. This will help to find old photos with friends which sometimes get lost on social media due to a large number of photos present(Uploaded or Tagged)
I am trying to fetch mutual photos of me and my friends using my access token and trying to read the tags present in the photos through API but the Response contains only my name in the tags and not other people who are tagged in that photo.
Is there any way to fetch the users who are tagged on a photo uploaded? Any help is appreciated.
Graph api link
Access to any data involving your friends is only possible if those friends specifically authorized your App too. You cannot even get an ID of a friend if he did not authorize your App.
Yes, in order to access involving your friend to authorize your app. But from the details i can see that,
"A user access token may read a photo that the current user is tagged in if they have granted the user_photos or user_posts permission. However, in some cases the photo's owner's privacy settings may not allow your application to access it."
Note: Just need to verify users privacy setting once again.

Can a posting from a facebook app to a users timeline contain images?

I am using facebook-cordova -> "Simple Facebook" -> Facebook SDK -> Graph API from an android app and an IOS app.
The functions I use in facebook-cordova to do the actual postings are named .feed() and .share(). They seems to be interchangeable on android i.e. result in the same graph api call in the other end.
What I need is to add images to a posting, preferrably by url.
(I have already managed to do postings without images, using app key and access token etc),
When glancing the facebook SDK for android, it seems there is no obvious way to add images to a status message.
On the other hand, it is possible, right?
The usual way to do this is to post a photo:
https://developers.facebook.com/docs/graph-api/reference/v2.1/user/photos
Of course the same rules apply to the message parameter, no prefilling is allowed, the value must be 100% user generated.
How to do this with Cordova should be explained here: Phonegap/Cordova Upload photo to graph.facebook - requires upload file
Remember that every photo in your profile is in an album: https://www.facebook.com//photos_albums
Afaik you can upload photos to every album except for the profile pictures.

Share large photo from FB album

I'm creating a web app where I'd like to 1) upload a photo to an app-specific album on Facebook and then 2) share that photo as a LARGE item/image (not a thumbnail) on the users' Timeline. I know this is doable via User Generated Photo optional parameter but is there any other way to accomplish this for a web app?
There is nothing stopping web apps from publishing Open Graph actions with User Generated Photos. It's a simple process:
Setup Facebook auth on your site, your simplest option being to use the Javascript SDK with getLoginStatus. Make sure to request publish_actions permission from users.
Create an Open Graph action and your OG object types
When the user takes the appropriate action, make an API call of the following form (signed with the user access token and POST'd):
https://graph.facebook.com/me/YOUR_APP_NAMESPACE:YOUR_APP_ACTION?
YOUR_OBJECT_TYPE=YOUR_OBJECT_URL&
image[0][url]=YOUR_PHOTO_URL&
image[0][user_generated]=true
Step 1 is the hardest part and you'd have to do that anyway if you weren't going down the Open Graph actions route.
As an example, Instagram use took as their action and a photo as their object. Their objects URLs are simply the individual photo pages on the Instagram website. So their API POST call would look like this:
https://graph.facebook.com/me/instagram:took?
photo=http://instagram.com/p/ABCD1234/&
image[0][url]=http://distilleryimage.instagram.com/somerandomstring.jpg&
image[0][user_generated]=true
As mentioned in the User Generated Photos documentation this will show up as a large, full-width photo on the users Timeline and feed.
The simplest way to perform all these API calls from a web app is to use the Javascript SDK and the FB.api function. You won't need to use any server-side code at all in that case!
Just fill this code on your photo caption
"took a ##[0:[124024574287414:1:photo]] with #[124024574287414:0]"
(without double quote symbol)
It clickable to instagram website, It's my own custom code, I made it for a week :(

Move a photo from one album to another

I checked through the api's but I may have missed it, if it exists... I can't find a write/modify api call to change move a photo from one user album to another (such as can be done via FB's web interface by editing the album and use the pull down for each image to move them one by one.
Essentially I just want to modify for an image the enclosing album id. I don't want to download from one album and upload to another as I want all the tags and comments to remain intact (as well as the photo's id)....
My goal is to create a simple app to be able to move all (or a selection) of photos from one album to another, ie. "merge albums" since FB's web interface does not have that functionality. I have a ton of albums I created in 2009 when the limit was 60 photos per album so now that the limit is 200 I want to reduce my album count by over 67%...
There is no API to remove photos, so effectively all you can do via the API is copy, you'd then have to remove the extraneous albums manually using Facebook's web interface

Application permissions

I have enabled a user of my application to enable permissions to view photo albums.
However, what I really want is to not only enable the application to access the photo albums but to enable the user to select one image from the album that other users of the application can then see thereafter.
This is a competition application so the user selects an image and that image is included in the competition but users of the application must be able to view so as they can vote on it.
Must I take the image from the photo album and upload to a hosting server or is there away I can do this?
What you need to do is an application in your server which saves the photo the user has selected. Then you save the reference of this photo into a database and when other users comes to your application you request all of these in the database and show them back to the user.
This is a pretty basic programming structure, so Facebook serves you with a lot of shared data through many profiles. On the other hand, you are in charge of what you do with these data, how you use it and in which applications you implement it. Remember when you do this, you have to provide a privacy policy and a terms of use document to avoid any legal consequence to your end.