-1

I implement a function create album and upload a media video use google photo api.

I created share album and upload a video into album.

Data return is:

{
   "id":"AEzcj6Ip7TQ7mNzPD77qeVYgSu5TXrS02-cTbYRQbf-_vchhRiKOz_Ts6UD8U5o73aXmoUY0KMkCIQ6geETp3SN1gGjP4KVFgA",
   "baseUrl":"",
   "productUrl":"https:\/\/photos.google.com\/lr\/album\/AEzcj6JJCXsxEPJVIT4j9AbcSowDYDnve0GqHGYLxAl8uHUTCRjUeUogK8Qb-cHsCt2dcRrUW2sw\/photo\/AEzcj6Ip7TQ7mNzPD77qeVYgSu5TXrS02-cTbYRQbf-_vchhRiKOz_Ts6UD8U5o73aXmoUY0KMkCIQ6geETp3SN1gGjP4KVFgA",
   "mimeType":"video\/mp4",
   "album":{
      "id":"AEzcj6JJCXsxEPJVIT4j9AbcSowDYDnve0GqHGYLxAl8uHUTCRjUeUogK8Qb-cHsCt2dcRrUW2sw",
      "productUrl":"https:\/\/photos.google.com\/lr\/album\/AEzcj6JJCXsxEPJVIT4j9AbcSowDYDnve0GqHGYLxAl8uHUTCRjUeUogK8Qb-cHsCt2dcRrUW2sw",
      "coverPhotoBaseUrl":"",
      "coverPhotoMediaItemId":"",
      "shareableUrl":"https:\/\/photos.app.goo.gl\/nmxkduVUQi7cHnS36",
   }
}

I want to create a link share of video the same under example:

https://photos.google.com/share/[albumId]/photo/[mediaId]?key=cjhUT0xrZjM5NGN2SVRLOVptZU5SMUlKV0lQYWpB

API return url and id of album and video, I don't know how get value of param key. API don't return this value.

Please help me.

Huan Ho
  • 145
  • 2
  • 9

1 Answers1

1

The shareableUrl cannot be constructed by hand by combining different identifiers.

You need to call albums.share with the identifier of the album you have just created - this call returns the shareableUrl in the shareInfo response. You can use this URL to share the album with anyone who has this link.