Media Share Download

Experts in information & data storage products, computer & imaging consumables. IMediaShare is a cloud-based mobile media discovery and control technology designed for the Connected Home. IMediaShare is dedicated to enabling people to 'place shift', taking their.

Albums created by your app can be shared between users, with options to allowthose users to comment on, or contribute their own media items to the album.

To share an album through the Google Photos Library API, your app needs to do the following:

  1. Create an album on behalf of a user.
  2. Set that album to shared.
Note: Before sharing an album, obtain explicit consent from the user, and makesure to follow theUX guidelines.

Required authentication scope

In order to share content, your app must request the photoslibrary.sharingauthorization scope.

Sharing an album

Share

Before sharing an album, take the following considerations into account:

  • Your app can only share albums it has created. Albums created by other apps,including Google Photos, can't be shared by your app.
  • When your app shares an album via the Library API, ashareable URLis generated that anyone can use to access the album.
  • For albums shared via the API, the album's owner canturn off link sharingor unshare the album in the Google Photos app, potentially preventing yourapp from joining new users to it.

To share an album:

  1. Follow theUX guidelines andobtain explicit consent from the user to create a shared album.
  2. Create the album,and record its albumId. If you've already created the album, you canretrieve its albumId bylisting the user's albums.
  3. Call albums.share usingthe relevant albumId, along with theshare options you want toset.
  4. Record theshareTokenvalue in the response. The share token is an identifier for a shared albumthat can be used across different user accounts.
  5. Another user can now authenticate with your app, thenjoin,leave, orretrieve the detailsof the shared album using its shareToken.

Share options

The following options can be set when sharing an album using thesharedAlbumOptionsparameter. If the options aren't explicitly set, the default values are used.

PropertyDefault valueDescription
isCollaborativefalseSets whether other Google Photos users can add content to the shared album.
isCommentablefalseSets whether other Google Photos users can comment on the shared album.
Media Share Download

Example request

The following request shares an album by calling albums.share with options. AshareInfo propertyis returned in the response that describes the album'ssharing properties.

REST

Here is a POST request header to share an album:

In the request body, specify the share options.

This request returns the following response:

Java

PHP

Shared album properties

For albums that have been created and shared by your app, all responses thatreturn an albuminclude an additional property,shareInfo. Thisproperty is returned when sharing,listing orretrieving albums.

The following table lists theshareInfoproperties:

Properties
sharedAlbumOptionsOptions that describe whether someone can add media items to or comment on a shared album.
shareableUrl

A link to the shared Google Photos album. Anyone with the link can view the contents of the album, so it should be treated with care.

The shareableUrl field is only returned if the album has link sharing turned on. If a user is already joined to an album that isn't link-shared, they can use the album's productUrl to access it instead.

A shareableUrl is invalidated if the owner turns off link sharing in the Google Photos app, or if the album is unshared.

shareToken

A token that is used to join, leave, or retrieve the details of a shared album on behalf of a user who isn't the owner.

A shareToken is invalidated if the owner turns off link sharing in the Google Photos app, or if the album is unshared.

isJoinableTrue if the album can be joined by users.
isJoinedTrue if the user is joined to the album. This is always true for the owner of the album.
isOwnedTrue if the user owns the album.
Caution: Anyone with an album's shareableUrl can view the album's contents.

Unsharing an album

To unshare an album your app has previously shared, callalbums.unshare using thealbum's albumId.

In addition to the album no longer being shared, the following things willhappen:

  • All non-owners will lose access to the album. This includes people who havehad the albumspecifically sharedwith them through the Google Photos app.
  • All content added by non-owners will be removed from the album.
  • If a user has previously added the contents of the album to their library, thecontents will be retained in their library.
  • The album's share token and shareable URL will be invalidated.

Example request

REST

Directv Media Share Download

Here is a POST request header to unshare an album:

Download

The request body must be empty.

If the request was successful, it returns an empty response with an HTTP success status code. If the request was not successful, it returns an HTTP error status code with an error message.

Java

PHP

Retrieving shared albums and share tokens

A shared album's details,including its share token, are returned when your app shares an album. You canalso retrieve those details afterwards in the following ways.

If the user currently connected to your app is the owner, or is joined to thealbum:

  • With albums.get using therelevant albumId.
  • With albums.list, if thereare media items in the album.
  • WithsharedAlbums.list,which returns all shared albums the user is joined to or owns. To retrieveonly the albums your app has created, use theexcludeNonAppCreatedDataparameter.
  • With sharedAlbums.getusing a share token.

If the user currently connected to your app is not joined to the album, you canretrieve a shared album's details withsharedAlbums.get using avalid share token.

Example request

REST

Here is a request to get an album by its shareToken:

If the request is successful, it returns the shared album details.

Java

PHP

Joining a shared album

Your app can join a shared album on behalf of a user with the album's sharetoken. To do so, the following conditions must be true:

  • Your app hascreated and shared thealbum.
  • The user you want to join to the album isn't its owner. That is, theisOwned field in the album'sshareInfois false.
  • The share token is valid.
  • The isJoinable field in the album's shareInfo is true.
Caution: After your app has shared an album, its owner can turn off link sharingor unshare the album in the Google Photos app. If this happens, the album'sshare token will be invalidated, its isJoinable field will be false, andyour app won't be able to join users to it.

REST

Here is a POST request header to join a shared album:

Media Share Download

In the request body, specify the shareToken.

The POST request returns the shared album your app joined on behalf of the user.

Free Media Share Downloads

Java

PHP

Leaving a shared album

Your app can leave a shared album on behalf of a user, using the album's sharetoken. To do so, the following conditions must be true:

  • Your app has created and shared the album.
  • The user is currently joined to the album. That is, the isJoined fieldin the album's shareInfo is true.
  • The user connected to your app is not the owner of the album. That is, theisOwned field in the album's shareInfo is false.

Media Share Application Download

REST

Here is a POST request header to leave a shared album:

In the request body, specify the shareToken.

If the request was successful, it returns an empty response with an HTTP success status code. If the request was not successful, it returns an HTTP error status code with an error message.

Java

PHP

Shared media item properties

Media items that belong toalbums shared by your app contain an additional property,contributorInfo.This property can be retrieved by any request that returns a media item, such asmediaItems.get ormediaItems.search.

Share It Free Download

The contributorInfo property includes the name of the user who added the mediaitem to the album, and abase URL to their profileimage.

Here's an example:

Windows Media Share Downloads

Note: The contributorInfo property is only returned if the user has grantedaccess to the photoslibrary.sharing scope.