Why can't I add a existing MediaItem to an existing Album using the online Api Explorer? - google-apis-explorer

I'm using the albumId that I got from the albums.list method. It is, in my eyes, a valid ID, because I can use the albums.get method to get the album.
I'm using the mediaItemId that I got from the mediaItems.list method. It is, again in my eyes, a valid ID, because i can use the mediaItems.get method to get the mediaItem.
Both work without problems!
When I'm trying to add the mediaItem to the album, using the albums.batchAddMediaItems method, I get an
error: No permission to add media items to this album.
I used OAuth 2.0 and checked every scope that can be checked.

I asked the same question. I posted an answer there:
Google photos api adding photos to existing album is broken
See "Media items can be created only within the albums created by your app. For more information, see Authentication and authorization scopes." from this link: https://developers.google.com/photos/library/guides/upload-media
The jist of it is that google api wont let you programatically modify an album that wasnt also created programatically. If you create the album via the api, get the response with the ID and then append to the album afterward. You shouldn't see that error response.

Related

Get drive files stats (views/openings) | Google Drive API

I've been searching the docs but I can't find anything.
The goal is to retrieve different stats from our files. Actually, we can retrieve almost everything we need, except for the document openings and document openings per user.
So here is the question: How can I retrieve document views of a drive document (a G Sheet to be more precise) ? Can I segment it by user ?
Thank you
I understand that your goals are the following one:
You want to retrieve document views
Of a particular document (and you know it's id)
Associated to a specific user
Please correct me if I get it wrong. If those are your goals, then you can use the Admin SDK as pointed out by Rubén in the comments. Now I am going to detail how you can make such a request easily.
You could use the method activities.list() to get a list with what you want. You only have to populate these four parameters:
Parameter
Value
Description
userKey
The user's email
Determine the user
applicationName
drive
Identifies the Google service
eventName
view
Designate the type of activity
filters
doc_id=={MY DOCUMENT ID HERE}
Filters by the document
That configuration will provide you with your desired data. Leave a comment below if you need help creating that request in your own environment.

Instagram: Is it possible to get user's name, follower numbers, and search photos with #tag?

I once asked this question.
Is it possible to use Instagram API in order to make a user list according to the number of followers?
And I am not a programmer, just a salesman.
And it seems like we cannot make this influencer finding tool by using "official" Instagram API. So I have looked for other solutions and found a way to get data from Instagram by using other API and JSON.
Please refer to these links.
https://github.com/whizzzkid/instagram-reverse-proxy
How can I get a user's media from Instagram without authenticating as a user?
Obtaining Instagram Access Token
My goal is creating an influencer finding tool, so I need to find photos with #tag and make user list accordingly to the number of followers of the user.
My question is;
1 Is it possible to get data such as user name, follower numbers, photos with certain #tag? by using non-official API and JSON?
2 And suppose we made it, then Instagram will find out our products and ban our accounts or service? It seems they do not allow us to use non-official API.
I would appreciate it if you could teach me whether we can make it or not, in a way that you talk to the person who does not know much about JSON or so.
Thank you!
Using unofficial API is always risky, its against their terms and policy.
You can use official APIs to make get this info.
You first have to make hashtag API , which gives you posts with username (no follower count), then for each user, you have make another API call to get user info, this will give you follower counts, bio and other details.
The 2 APIs needed are below, you need public_content scope permission and have to get your app approved by instagram and go to live mode.
https://api.instagram.com/v1/tags/{tag-name}/media/recent?access_token=ACCESS-TOKEN
https://api.instagram.com/v1/users/{user-id}/?access_token=ACCESS-TOKEN

Created By and last Modified By for Get pages

Do we have a way to identify who created the page (Created by in Get pages request) using API call? We see the properties Created By and last Modified By for Get sections. Can we get the same properties for Get pages?
Currently the OneNote GET ~/pages API does not support the properties "CreatedBy" and "LastModifiedBy. I would recommend creating an item in UserVoice (I will upvote it ;) )
https://onenote.uservoice.com/forums/245490-onenote-developer-apis

How to populate a jQuery Mobile list view of cities from Open Weather Map API?

I am trying to write a very basic jQuery Mobile app that will allow someone to select a city and view the current temperature using the OpenWeatherMap API. The data I want to use will be returned as json.
As per the landing page I can see that doing the query explicitly with the city is fine...
http://api.openweathermap.org/data/2.5/weather?q=London,uk
But what I am unable to find is how do I query the API to simply return all the cities, which will then subsequently allow me to populate my list view, then allowing the user to see the temperature.
I have read some people talking about using a 'callback', but I am unable to see how this would help.
I have written a basic app previously, but again, that was using a fixed location, where the user didnt have to select it, so I never ran into this problem before.
I am having problems posting my code, but will attempt to post it later this eve.
Any pointers/tutorial links would be great.
You have to contact them via email to get the latest list of countries.

getting google map searched location review and information

i am wondering if there is any way we can pull the reviews and information of a location/store/shop/building from google map info, check following url please.
http://maps.google.com/maps?cid=16753855001018446220
http://maps.google.com/places/us/california/san-francisco/24th-st/2884/-la-palma-mexicatessen
I think you want to use Google Maps Local Search APIs.
Or to use Something like ax said in this post
if you are a business owner, you can
interact with this information.
maps.google.com/support/bin/… :
However, the basic information that
you submit through the Local Business
Center is the information that we
trust the most. This means that it
will appear instead of any basic
information that we get from anywhere
else. and you can upload photos and
videos: maps.google.com/support/bin/…
note that you can not Add Review check this for more info
You can get the URL of the info page pretty easily. Like TreeUK initially suggested, use the local search API, and upon its completion, you'll have access to yourSearcher.results. For each one, just grab result.url (or yourSearcher.results[i].url to be more precise) to get the info page.
If you want the direct link to the reviews page, modify the result.url a bit...
var baseUrl = 'http://www.google.com/maps/place?';
var cid = result.url.match(/cid=\d*/gi)[0];
var reviewsUrl = baseUrl + cid + '&view=feature&mcsrc=detailed_reviews';
...then do what you want with reviewsUrl.
If you want more reviews, add the num (and optionally the start) parameter to the query string:
var reviewsUrl = baseUrl + cid + '&view=feature&mcsrc=detailed_reviews&num=100&start=0';
So, really all you need is the cid. Once you have that, you can get at any of the other info.
You'll probably want to hit up the Google Maps Local Search APIs.
Upon completion of a google.search.LocalSearch() search it delivers a collection of GlocalResult objects. This contains Local business results, but you don't have any further control over them. There doesn't seem to be an explicit Local Business API.
I couldn't find any mention of reviews or Business reviews, have you considered emailing / otherwise contacting some google contacts asking about this?