Id of photos in Google photos API - google-photos

I am using the Google photos API
We use this to add and reference photos to google photos.
Save the ID that is issued when adding a photo, link it with other information by using it, and reference the photo again.
After photos were added, it was possible in the above method during August, but in September the ID was changed, and I could not refer to it properly.
It means that the ID when added and the ID when referring have been changed.
Does this mean that the ID is automatically updated every certain period?
By the way, the photos in google photos have not been deleted.

The IDs changed as part of the 5 September 2018 release of the Google Photos Library API.
This was a once-off change during the developer preview. Now that the API has entered general availability, you should not expect breaking changes like this.
There's some more background in this question: Google Photos Library API IDs are invalid

Related

"Recent interactions" pull via People API

I am trying to use Google's People API to pull the date of my last interaction (either email or calendar invite) with all my contacts. Basically whatever is in the red box in the screenshot below.
Google Contacts screenshot
I doesn't seem to be something that can be access via the People API, but I'd appreciate a confirmation. If anyone has found an alternative to get a similar data point (when was a person last contacted), it would be great !
I've tried pulling all the fields available through the API, or exporting contacts as a CSV, neither returned the date of last interaction.

Google Photos API - Can I access existing enrichments?

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

Where is the search media by tag on new Instagram Graph API?

On the current Instagram API we have an endpoint to search recent media by tag, but this platform will be deprecated beginning in July 2018.
The problem is that Instagram Graph API reference doesn't include any endpoint to search media by tag.
Does anyone know how to search media by tag using the new Instagram Graph API?
Just announced a few days ago, the new Instagram Graph API: Hashtag Search API is now available. Here is a link to the documentation for the full API: https://developers.facebook.com/docs/instagram-api/hashtag-search.
The edge you wan to hit is {hashtag_id}/recent_media (https://developers.facebook.com/docs/instagram-api/reference/hashtag/recent-media)
There are some limitations to what it used to be, but it is the new replacement.
Limitations
This edge only returns public photos and videos.
This edge only returns media objects published within 24 hours of query execution.
This edge returns a maximum of 50 media objects.
You can query a maximum of 30 unique hashtags within a 7 day period.
You cannot request the username field on returned media objects.
Responses will not include any personally identifiable information.
For limited tag search you can use public web api:
https://www.instagram.com/explore/tags/{tagName}/?__a=1
for example: https://www.instagram.com/explore/tags/apple/?__a=1
This is just for recent media - I guess, this API does not guarantee all media.
However, this is not official api call. Doesn't need token or auth, so Instagram can change this API without any prior notice.
As of today, photo tags and #mentions with business accounts are the only way using the new API.
At F8 this year (2018), they mentioned "Hashtag Read" endpoint being available towards the end of this year and it will be largely modeled to the "following of hashtags" as a user can currently do on the platform. 10:50 point in this video here: https://developers.facebook.com/videos/f8-2018/the-instagram-graph-api---whats-in-it-for-you/?hc_location=ufi
Unfortunately, this is the answer I received from Facebook Developer Community:
Public media hashtag search is currently not supported by the Graph API

Facebook opengraph insights api on specific post id from my app

I want to build a dashboard that returns more customized insights from the insights generated by app.
The app is a facebook connect website that users visit and view a list of products. They can post to facebook about that particular product by sharing a custom story that incorporates that product on their timeline.
When I go to the insights for my app, it does a great job of showing me all social impressions for all custom stories that were generated on my site.
I'd like to narrow that down even more for specific products.
My plan is to record the object ids that are generated by these actions and link them to a partucular product in my database.
I'd then like to create a new dashboard page that will allow me to login, request read_insights permission from me and then use that object_id:product mapping from my database to show how many social impressions where recorded for a given product's object_ids.
Is this possible? I've read alot about it but still haven't found the most elegant way to get a segmented report of social impressions per type of content that was posted.
Thanks for your time.
The implementation all depends on which platform you want your app to run on.
The first major component is you must have a Facebook developers account which is easy to signup for. Just go to developers.facebook.com and register. Takes like 2 mins. After that you will need to create your first app and add the correct domain name where your app will be hosted and what platform it will run on. (iOS, Android, Web, ect.) Once that is finished you can make your app public so you can use the Facebook API in your code.
For the app creation itself. The first thing you need to do is import the correct API for your platform. Which you can find a walk through at https://developers.facebook.com/docs/. Once the API is imported you must build a Facebook object which contains your app id and possibly app secret. If you're using JavaScript you don't want to use the app secret because it will be visible to the public.
Now that you have your Facebook object you must require the app users to log in and grant permission to your app. You can add extended permissions to your log in process by adding a scope value to the log in button generated by Facebook. Here is an example.
<fb:login-button id="loginBtn" max_rows="1" scope="basic_info,read_insights,manage_pages" size="medium" show_faces="false" auto_logout_link="true"></fb:login-button>
After the user is logged in you can now query information from the users account using Facebook Api calls to Social Graph. Facebook also provides a tool to help you figure out what information you can query. https://developers.facebook.com/tools/explorer
Everything else you want to do with the app can be done by Facebook API calls. You just need to insure you grant the user the correct permissions before making the API calls.
API calls are a little different depending on which language syntax you are using but they all follow the same data model and return some array of responses which can be parsed using JSON or the standard array format. The Graph Explorer tool listed above will show you the output for your queries so you can handle them accordingly.
I hope this helps gets you started.
EDITED
Here's the implementation in JavaScript
function getMetric(){
// make the API call
FB.api(
"/{app-id}/insights/application_opengraph_story_impressions",
function (response) {
if (response && !response.error) {
/* handle the result */
}
}
);
}
Here's the reference now that Facebook docs are back up https://developers.facebook.com/docs/graph-api/reference/insights
application_opengraph_story_impressions will probably give you the total impression of all stories made by your app. I ran it against my Facebook app and it came back empty but I don't have any stories so it might work with your's. Also to note in the documentation there is an * by this metric and I could't find what that means.
I'm pretty sure that right now Facebook don't give developers ability to get insights about app custom stories.
Currently Facebook documentation has the following Graph APIs for Insights data:
/{page-id}/insights
/{app-id}/insights
/{domain-id}/insights
/{post-id}/insights (where this is a Page post)
So /{post-id}/insights won't work because custom story is actually user's post and others endpoints don't apply to your case.
As far as I know the only other option to access Insights is FQL. For that you'd use insights table in a manner similar to this:
SELECT ... FROM insights WHERE object_id = ... AND metric = ... AND end_time = ... AND period = ...
Now most likely this also won't work with your custom story posts (I don't have posts which I could try it on right now, so I can't tell) but at least it is not explicitly stated so in the documentation, so you should probably try it out.
UPDATE:
I wasn't able to get any insights data via FQL, although as far as I understand the following code should have gave me at least something (object id is for my page):
SELECT breakdown, end_time, event, metric, object_id, period, value FROM insights WHERE object_id = 224981264214413 and metric = 'page_fans' and period = period('lifetime') and end_time = 1395597892
But it results just in
{
"data": []
}
Facebook also has some pretty old bug report about similar topic: https://developers.facebook.com/x/bugs/508088155954330/ where they confirmed the issue, assigned it, and... did nothing to fix it for 6 months.
In case FQL doesn't work, my suggestion to you is - use your own analytics code to track the creation of custom stories and get the friend count of the users. It won't show you the real exposure of the posts but at least you will see some data on which types of custom stories where posted more often and what was the maximum potential friend count that could have seen them. By the way - to make charting easier, you could use Google Analytics events for that.

How to assign a past date while uploading a photo via Facebook Graph API, so that it gets placed at the right point in Timeline?

Using the Facebook Graph API, I have been able to upload a photo. It is an old scanned photo. I would now like to modify the timestamp, so that it is shown at the appropriate point in the timeline. Does the API provide a way to do this?
Here is an article that says we can assign past dates to Facebook Timeline Posts - http://www.allfacebook.com/facebook-timeline-timestamp-2011-10 . I want to assign a past date to a photo I uploaded, and I would like to do it via the Graph API. Any leads would be helpful.