我不知道我们是否在谈论相同的功能,但我刚刚能够使用 api explorer 检索我“加星标”(最喜欢的)的照片。
请使用此链接到 api。
如果它没有填满请求的正文,这里是:
{
"filters": {
"mediaTypeFilter": {
"mediaTypes": [
"PHOTO"
]
},
"featureFilter": {
"includedFeatures": [
"FAVORITES"
]
}
}
}
因此,您将尝试将此正文发布到https://photoslibrary.googleapis.com/v1/mediaItems:search
或对其进行调整以适应gapi.client
响应结构:
{
"mediaItems": [
{
"id": "XXX",
"productUrl": "https://photos.google.com/lr/photo/YYY",
"baseUrl": "https://lh3.googleusercontent.com/lr/ZZZ",
"mimeType": "image/jpeg",
"mediaMetadata": {
"creationTime": "2021-09-05T11:25:23Z",
"width": "4608",
"height": "3072",
"photo": {
"cameraMake": "NIKON CORPORATION",
"cameraModel": "NIKON D3100",
"focalLength": 18,
"apertureFNumber": 6.3,
"isoEquivalent": 100,
"exposureTime": "0.004999999s"
}
},
"filename": "DSC_0083.JPG"
}
]
}
请让我知道这个答案是否相关,我希望如此;)
(好吧,这不是 javascript,但凭据是另一个噩梦:D)