google-photos-api

Google photos api adding photos not working, upload seems to work

余生长醉 提交于 2021-02-08 07:35:27
问题 Trying to use Google Apps Script and Google Photos API to add photos to Google Photos. Upload seems to work / returns a token, but then adding the photo to the library fails. The process consists of two steps: 1. Upload the photo data as described here, then 2. Add the photo to photo library as described here. Step 1. works for me, as I get an upload token, but step 2 with source code below, throws an error, but my call has the one media item it needs. { "error": { "code": 400, "message":

Downloading a file from Google Drive in Javascript client

雨燕双飞 提交于 2021-01-28 05:28:33
问题 I'm trying to integrate the Google Drive in my angular application So that our users can copy the content from docs and download their images to my application. As per the file:get API Documentation, I'm using the below code to get the file var request = gapi.client.drive.files.get({ 'fileId': fileId }); var temp = this; request.execute(function (resp) { }); But in the response I'm getting only File name and ID.There is no download URL which is required for downloadFile function. Response:

How to use Google Photos API Method: mediaItems.search in Google apps script for a spreadsheet

雨燕双飞 提交于 2020-11-29 09:04:27
问题 I really tried to figure this out on my own... I am trying to load photo metadata from google photos into a sheet using the Google Photos API and google apps script. I was able to make some progress after a lot of help on a previous question Is it possible to load google photos metadata into google sheets? I now have two functions. function photoAPI_ListPhotos() - Uses Method: mediaItems.list and gives me all my photos that are not archived function photoAPI_ListAlbums() - Uses Method: albums

How to use Google Photos API Method: mediaItems.search in Google apps script for a spreadsheet

丶灬走出姿态 提交于 2020-11-29 09:02:13
问题 I really tried to figure this out on my own... I am trying to load photo metadata from google photos into a sheet using the Google Photos API and google apps script. I was able to make some progress after a lot of help on a previous question Is it possible to load google photos metadata into google sheets? I now have two functions. function photoAPI_ListPhotos() - Uses Method: mediaItems.list and gives me all my photos that are not archived function photoAPI_ListAlbums() - Uses Method: albums

Google Apps Scripts: import (upload) media from Google Drive to Google Photos?

核能气质少年 提交于 2020-05-15 21:45:47
问题 I see that we can import (upload) media (photos, videos,...) from Google Drive to Google Photos. My goal is: do this task with code. I have successfully got a list of photos from Google Drive, and I store their IDs in an Array. I have this code: var arrId = [ //Some image id... ]; var length = arrId.length; var driveApplication = DriveApp; for(var i=0;i<length;++i) { var file = driveApplication.getFileById(arrId[i]); //Now I got the file, how can I programmatically import this file to Google

Google Apps Scripts: import (upload) media from Google Drive to Google Photos?

早过忘川 提交于 2020-05-15 21:45:46
问题 I see that we can import (upload) media (photos, videos,...) from Google Drive to Google Photos. My goal is: do this task with code. I have successfully got a list of photos from Google Drive, and I store their IDs in an Array. I have this code: var arrId = [ //Some image id... ]; var length = arrId.length; var driveApplication = DriveApp; for(var i=0;i<length;++i) { var file = driveApplication.getFileById(arrId[i]); //Now I got the file, how can I programmatically import this file to Google

Selecting video from Google Photos provider doesn't give mimetype information

百般思念 提交于 2020-02-23 10:09:14
问题 I've created a sample here to reproduce this issue. I'm running this project on an emulator with API level 29 and selecting a video from google photos provider. But I cannot figure out how to get the mimeType of the selected file. I've used ContentResolver's getType method which returns null and also ContentResolver query method which somehow throws an IllegalArgumentException to me. I've attached a screenshot for the same. Note: Everything works fine if I select the same file by navigating

Getting own data off Google Photos API (Authentication and requests)

北城余情 提交于 2019-12-24 22:33:33
问题 I'm a bit new to using APIs and React and to test it out I'm writing a project that includes getting my own media (or just the URLs of each image) off of a specific album I have on Google Photos. The aim is that the project will post any photos I take (and put in this album) onto a site with react. Since I only want my own data and I don't want any information/authentication from other users I can't just have a sign in as most of the google photos documentation suggests (it would just get