google-photos

How to read Drive Photos using Drive Rest API

我怕爱的太早我们不能终老 提交于 2021-02-18 15:35:23
问题 I'm trying to read Google Photos using Drive REST API inside Google Apps Script. The code looks like this: function myFunction() { var files = Drive.Files.list({ maxResults: 10, spaces: 'photos' }); for (var i = 0; i < files.items.length; i++) { var f = files.items[i]; Logger.log(f.title); } } But if I run this function Google shows error "The granted scopes do not give access to all of the requested spaces. (line 2, file "Code")" Page with error Project properties contain scope "https://www

How to read Drive Photos using Drive Rest API

ⅰ亾dé卋堺 提交于 2021-02-18 15:35:04
问题 I'm trying to read Google Photos using Drive REST API inside Google Apps Script. The code looks like this: function myFunction() { var files = Drive.Files.list({ maxResults: 10, spaces: 'photos' }); for (var i = 0; i < files.items.length; i++) { var f = files.items[i]; Logger.log(f.title); } } But if I run this function Google shows error "The granted scopes do not give access to all of the requested spaces. (line 2, file "Code")" Page with error Project properties contain scope "https://www

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":

Pick from Google Photos provider with ACTION_GET_CONTENT or OPEN_DOCUMENT

跟風遠走 提交于 2020-11-29 04:21:55
问题 I have no clue at why this happens, but I am not able to pick images from the Google Photos provider. Testing on API 27. With ACTION_GET_CONTENT If I use: val intent = Intent(Intent.ACTION_GET_CONTENT) intent.addCategory(Intent.CATEGORY_OPENABLE) intent.type = "image/*" I can see Google Photos among the provider I can browse to some picture and select it Then I am directed back to the providers list (not to my app), as if the provider had crashed in a try-catch When I open the Photos provider

Download image blob from Google Photos using JavaScript and REST API

淺唱寂寞╮ 提交于 2020-08-10 19:16:34
问题 I cannot download an image blob in my JavaScript client using the Google Photos REST API. My XMLHttpRequest is getting a 404. I have a valid OAuth token and can list the mediaItems. The token was generated using an offline access code. The same XMLHttpRequest download method works with both GDrive and Dropbox, allowing me to show download progress. I've tried using the "=d" and "=w123h345-c" baseUrl suffixes (where 123 and 345 are the respective width and height of the image). I've tried