How to access Google Drive shared link of a folder to get list of all the media items in that link? To be used in an API

193 views Asked by At

If i have a shared link of a google photos album, can I access its contents via an API? Need it to automate word reporting using VBA. Cannot find any document that allows the use of shared link to get contents

1

There are 1 answers

0
CMB On

You can send a POST request from VBA with the album ID as parameter to return the media items inside.

A sample request could look like this, replace oauth2-token with your token and album-id with the ID from your shared link: https://photos.google.com/album/-album-id-

POST https://photoslibrary.googleapis.com/v1/mediaItems:search
Content-type: application/json
Authorization: Bearer oauth2-token
{
  "pageSize": "100",
  "albumId": "album-id"
}

This should return the list of media items in the album:

{
  "mediaItems": [
    ... // media ID's here
  ],
  "nextPageToken": "token-for-pagination"
}

For more information, you can check the link here: https://developers.google.com/photos/library/guides/list#listing-album-contents