2

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.

The request The error

I used OAuth 2.0 and checked every scope that can be checked.

Jon
  • 3,573
  • 2
  • 17
  • 24

1 Answers1

5

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.

Matt Pengelly
  • 1,480
  • 2
  • 20
  • 34