janvda / node-red-contrib-google-photos

Node-RED node for Google APIs using OAuth2.
MIT License
0 stars 0 forks source link

when uploading file getting error `No permission to add media items to this album.` #6

Closed janvda closed 4 years ago

janvda commented 4 years ago
3 Dec 22:46:14 - [warn] [google:google photos] node.on('input'):[object Object]
3 Dec 22:46:14 - [warn] [google:google photos] upload_photo ...
3 Dec 22:46:14 - [warn] [google:google photos] ... end node.on()
3 Dec 22:46:15 - [error] [google:google photos] StatusCodeError: 400 - {"error":{"code":400,"message":"No permission to add media items to this album.","status":"INVALID_ARGUMENT"}}

FYI this is the input for that node:

{
    "operation": "upload_photo",
    "albumId": "AFJWXTBGEtNaC95FiDXh...........BfEbgOh",
    "fileName": "imageX.png",
    "filePath": "/data/photos/image.png",
    "description": "This a test description"
}
janvda commented 4 years ago

It looks like that you can not just upload a photo to an album that is not created by the app:

https://developers.google.com/photos/library/guides/upload-media#creating-media-item it says:

Media items can be created only within the albums created by your app. For more information, see Authentication and authorization scopes.
janvda commented 4 years ago

As solution (I guess), we need also support the creation of a new album and only these albums can then be used to upload new media files.

janvda commented 4 years ago

implemented "create album" functionality. So it is possible to upload photos for albums created by the "create album" functionality.