谷歌照片API添加照片到现有相册已损坏 [英] Google photos api adding photos to existing album is broken

查看:118
本文介绍了谷歌照片API添加照片到现有相册已损坏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用Google自己的尝试此api"功能和google photos api. REST请求存在一个错误,该错误将照片添加到现有相册.附上截图作为证明.我在这里提出这个问题是因为这就是他们的支持部门所说的,请不要拒绝投票.我可以直接通过Google照片应用添加照片,就是这样.

Using Googles own "try this api" feature with google photos api. There is a bug with the REST request to add photos to existing albums. Attached a screenshot as proof. I raised this issue here because thats what their support section says to do so please dont downvote. I can add photos directly through the google photos app and thats it.

推荐答案

所以我弄清楚了为什么会这样.

So i figured out why this is happening.

请参阅只能在您的应用创建的相册中创建媒体项目.有关更多信息,请参见身份验证和授权范围."通过此链接: https://developers.google.com/photos/library/指南/上传媒体

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

Google的api不允许您修改通过其他方式创建的相册.在这种情况下,我尝试修改了几个月前通过用户界面创建的专辑.然后,我尝试使用代码,邮递员和最终Google自己的api资源管理器通过OAuth2令牌将其添加到这些集合中.

Google's api wont let you modify an album that was created through another means. In this case i tried modifying albums which i'd created months ago via the UI. Then i was trying to add to those collections via an OAuth2 token using code, postman and eventually googles own api explorer.

我的解决方案是用代码创建一个新专辑,获取其ID并将图像附加到该专辑中.那是获得可写" Google相册的唯一方法.

My solution was to, in code, create a new album, get its ID and append images to that instead. That was the only way to get a "writable" google album.

这篇关于谷歌照片API添加照片到现有相册已损坏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆