Vous consultez actuellement l'ancienne documentation de l'API Library de Google Photos.
Method: albums.share
Restez organisé à l'aide des collections
Enregistrez et classez les contenus selon vos préférences.
Marque un album comme partagé et accessible aux autres utilisateurs. Cette action ne peut être effectuée que sur des albums créés par le développeur via l'API.
Requête HTTP
POST https://photoslibrary.googleapis.com/v1/albums/{albumId}:share
L'URL utilise la syntaxe de transcodage gRPC.
Paramètres de chemin d'accès
Paramètres |
albumId |
string
Obligatoire. Identifiant de l'album à partager. Cet élément (albumId ) doit appartenir à un album créé par le développeur.
|
Corps de la requête
Le corps de la requête contient des données présentant la structure suivante :
Champs |
sharedAlbumOptions |
object (SharedAlbumOptions )
Options à définir lors de la conversion de l'album en album partagé.
|
Corps de la réponse
Réponse au partage réussi d'un album.
Si la requête aboutit, le corps de la réponse contient des données qui ont la structure suivante :
Représentation JSON |
{
"shareInfo": {
object (ShareInfo )
}
} |
Champs |
shareInfo |
object (ShareInfo )
Uniquement en sortie. Informations sur l'album partagé
|
Champs d'application des autorisations
Requiert le niveau d'accès OAuth suivant :
https://www.googleapis.com/auth/photoslibrary.sharing
Sauf indication contraire, le contenu de cette page est régi par une licence Creative Commons Attribution 4.0, et les échantillons de code sont régis par une licence Apache 2.0. Pour en savoir plus, consultez les Règles du site Google Developers. Java est une marque déposée d'Oracle et/ou de ses sociétés affiliées.
Dernière mise à jour le 2025/07/25 (UTC).
[null,null,["Dernière mise à jour le 2025/07/25 (UTC)."],[[["\u003cp\u003eMarks an album as shared, making it accessible to other users, but only for albums created via the API.\u003c/p\u003e\n"],["\u003cp\u003eRequires an HTTP POST request to a specific URL with the album ID as a path parameter.\u003c/p\u003e\n"],["\u003cp\u003eThe request body includes shared album options, and the response provides shared album information.\u003c/p\u003e\n"],["\u003cp\u003eAuthorization is necessary using the \u003ccode\u003ehttps://www.googleapis.com/auth/photoslibrary.sharing\u003c/code\u003e scope.\u003c/p\u003e\n"]]],[],null,["# Method: albums.share\n\n- [HTTP request](#body.HTTP_TEMPLATE)\n- [Path parameters](#body.PATH_PARAMETERS)\n- [Request body](#body.request_body)\n - [JSON representation](#body.request_body.SCHEMA_REPRESENTATION)\n- [Response body](#body.response_body)\n - [JSON representation](#body.ShareAlbumResponse.SCHEMA_REPRESENTATION)\n- [Authorization scopes](#body.aspect)\n- [Try it!](#try-it)\n\nMarks an album as shared and accessible to other users. This action can only be performed on albums which were created by the developer via the API.\n\n### HTTP request\n\n`POST https://photoslibrary.googleapis.com/v1/albums/{albumId}:share`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Path parameters\n\n| Parameters ||\n|-----------|---------------------------------------------------------------------------------------------------------------------------|\n| `albumId` | `string` Required. Identifier of the album to be shared. This `albumId` must belong to an album created by the developer. |\n\n### Request body\n\nThe request body contains data with the following structure:\n\n| JSON representation |\n|-------------------------------------------------------------------------------------------------------------------------|\n| ``` { \"sharedAlbumOptions\": { object (/photos/library/legacy/reference/rest/v1/albums#Album.SharedAlbumOptions) } } ``` |\n\n| Fields ||\n|----------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `sharedAlbumOptions` | `object (`[SharedAlbumOptions](/photos/library/legacy/reference/rest/v1/albums#Album.SharedAlbumOptions)`)` Options to be set when converting the album to a shared album. |\n\n### Response body\n\nResponse to successfully sharing an album.\n\nIf successful, the response body contains data with the following structure:\n\n| JSON representation |\n|-------------------------------------------------------------------------------------------------------|\n| ``` { \"shareInfo\": { object (/photos/library/legacy/reference/rest/v1/albums#Album.ShareInfo) } } ``` |\n\n| Fields ||\n|-------------|--------------------------------------------------------------------------------------------------------------------------------------------|\n| `shareInfo` | `object (`[ShareInfo](/photos/library/legacy/reference/rest/v1/albums#Album.ShareInfo)`)` Output only. Information about the shared album. |\n\n### Authorization scopes\n\nRequires the following OAuth scope:\n\n- `https://www.googleapis.com/auth/photoslibrary.sharing`"]]