google-photosgoogle-photos-api

Google Photo API Method: albums.patch "isWriteable": true not working


I am trying https://developers.google.com/photos/library/reference/rest/v1/albums/patch? to make my album writeable so I can add "Enrichment" later for an existing album.

When I create an album from the API explorer it is writable by default and I am able to add enrichment. https://photos.app.goo.gl/toPju52DwhCNw2Xg7 ( working one)

But I can not recreate all my albums from this API explorer once again, there must be a way to add enrichment to existing album which failing due to permission error. And I suspect as I donot see the "writeable" set to true by default it is set to false.

curl --request PATCH \
  'https://photoslibrary.googleapis.com/v1/albums/ALzS9-hH7b67lbSv2iiuQQrJ7vjvbcNmLPDFZd77mjoRmJY7ixHtY9V5jy4z9QAUDYggFX3d1LJD?key=[YOUR_API_KEY]' \
  --header 'Authorization: Bearer [YOUR_ACCESS_TOKEN]' \
  --header 'Accept: application/json' \
  --header 'Content-Type: application/json' \
  --data '{"isWriteable":true,"id":"ALzS9-hH7b67lbSv2iiuQQrJ7vjvbcNmLPDFZd77mjoRmJY7ixHtY9V5jy4z9QAUDYggFX3d1LJD"}' \
  --compressed

Solution

  • isWriteable field is described as [Output only]. So you can't change it.

    https://developers.google.com/photos/library/reference/rest/v1/albums#Album