Google 포토 라이브러리 API의 기존 문서를 보고 계신 것입니다.
보강 추가
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
보강을 사용하면 애플리케이션이 데이터의 구조와 표현을 제어할 수 있습니다.
Google 포토의 앨범 내 사진 이를 통해 사용자는
텍스트 또는 위치 주석 및 순서/그룹을 통한 추가 컨텍스트 포함
여러 이미지가 있습니다.
필수 승인 범위
보강을 추가하려면 다음 범위 중 하나 이상이 필요합니다.
photoslibrary.appendonly
photoslibrary.library
photoslibrary.sharing
각 범위에서 enrichAlbum
호출은 생성된 앨범으로만 제한됩니다.
있습니다.
.sharing
범위를 사용하면 enrichAlbum
가 상황으로 제한됨
개발자가 공유 앨범의 소유자를 대행할 때 사용됩니다.
보강 유형
Google 포토는 앨범에서 텍스트,
위치, 지도가 있습니다.
텍스트 보강
텍스트 보강은 콘텐츠에 주석을 달기 위해 삽입할 수 있는 일반 텍스트 문자열입니다.
앨범
위치 보강
위치 보강은 삽입할 수 있는 장소의 마커 및 이름입니다.
위치에 주석을 달 수 있습니다.
지도 보강
지도 보강은 지정된 출발지와 목적지가 있는 지도로서
앨범에 삽입됩니다.
위치
미디어 항목과 앨범 보강을 삽입하려면 앨범의 위치를 지정합니다.
미디어 항목의 경우 위치는 선택사항이지만 앨범에 대해서는 지정해야 합니다.
강화해야 합니다.
게재순위는 다음 경우에만 지정할 수 있습니다.
미디어 항목 만들기
보강을 추가할 수 있습니다. 앨범의 기존 미디어 항목은 재구성할 수 없으므로
항목을 추가할 때 항목의 위치를 설정하는 것이 중요합니다.
앨범의 시작
미디어/보강을 위해 앨범 시작 부분에 절대적
있습니다.
앨범의 마지막
미디어/보강 항목을 절대적인 방법으로 앨범 끝에 추가할 수 있습니다.
있습니다.
다음 날짜 이후에 시작되는 미디어 항목과 관련하여 미디어/보강 항목을 추가할 수 있습니다.
확인할 수 있습니다.
보강 항목 기준
보강 항목 시작과 관련하여 미디어/보강 항목을 추가할 수 있습니다.
를 추가할 수 있습니다.
앨범에 보강 추가
보강은 한 번에 하나씩 추가되며 앨범의 위치에 추가해야 합니다.
앨범에 보강을 추가하려면 다음을 호출합니다.
albums.addEnrichment
요청이 성공하면 보강 항목의 id
가 반환됩니다.
미디어 항목 또는 기타 보강 항목을 배치하는 데 사용할 수 있습니다.
REST
다음은 POST 요청입니다.
POST https://photoslibrary.googleapis.com/v1/albums/album-id:addEnrichment
Content-type: application/json
Authorization: Bearer oauth2-token
request-body
요청 본문은 보강 항목과 그 위치로 구성됩니다.
{
"newEnrichmentItem": {
enrichment-to-be-added
},
"albumPosition": {
position-of-enrichment
}
다음은 샘플 응답입니다.
{
"enrichmentItem": {
"id": "enrichment-item-id",
}
}
자바
try {
// Create the enrichment using the NewEnrichmentItemFactory helper
NewEnrichmentItem newEnrichmentItem = NewEnrichmentItemFactory.createTextEnrichment("");
// Set the position of the enrichment within the album
AlbumPosition albumPosition = AlbumPositionFactory.createFirstInAlbum();
// To add an enrichment, specify the album, the enrichment item,
// and the position in the album where the enrichment is to be added
AddEnrichmentToAlbumResponse response = photosLibraryClient
.addEnrichmentToAlbum(albumId, newEnrichmentItem, albumPosition);
// The response contains an EnrichmentItem
// whose ID can be used to position media items or other enrichments
EnrichmentItem enrichmentItem = response.getEnrichmentItem();
String itemId = enrichmentItem.getId();
} catch (ApiException e) {
// Handle error
}
PHP
// Create the enrichment item using the PhotosLibraryResourceFactory helper
$newEnrichmentItem = PhotosLibraryResourceFactory::newEnrichmentItemWithText("");
// ...
// Set the position of the enrichment within the album
$position = new AlbumPosition();
// ...
try {
// To add an enrichment, specify the album, the enrichment item,
// and the position in the album where the enrichment is to be added
$response = $photosLibraryClient->addEnrichmentToAlbum($albumId, $newEnrichmentItem, $position);
// The response contains an EnrichmentItem
// whose ID can be used to position media items or other enrichments
$enrichmentItem = $response->getEnrichmentItem();
$itemId = $enrichmentItem->getId();
} catch (\Google\ApiCore\ApiException $e) {
// Handle error
}
지원되는 보강
텍스트 보강
텍스트 보강에는 다음과 같이 단일 텍스트 문자열 (영문 기준 1,000자 이하)이 포함됩니다.
다음 예에 나와 있습니다.
REST
{
"text": "Text to be shown"
}
자바
// Use the NewEnrichmentItemFactory helper to create a text enrichment item
NewEnrichmentItem newEnrichmentItem =
NewEnrichmentItemFactory.createTextEnrichment("text to be shown");
PHP
$newEnrichmentItem = PhotosLibraryResourceFactory::newEnrichmentItemWithText("text to be shown");
위치 보강
위치 보강은 임의의 위치 이름과 위도 및
경도 위치입니다. locationName
는 500자(영문 기준)로 제한됩니다.
REST
{
"location": {
"locationName": "Australia",
"latlng": {
"latitude": "-21.197",
"longitude": "95.821"
}
}
}
자바
// Use the NewEnrichmentItemFactory helper to create a location enrichment
// with the name, latitude, and longitude of the location
NewEnrichmentItem newEnrichmentItem =
NewEnrichmentItemFactory.createLocationEnrichment("Australia", -21.197, 95.821);
PHP
// Create a new location object and set the name, latitude, and longitude of the location
$newLocation = new Location();
$newLocation->setLocationName("Australia");
$newLocation->setLatlng((new LatLng())->setLatitude(-21.197)->setLongitude(95.821));
$newEnrichmentItem = PhotosLibraryResourceFactory::newEnrichmentItemWithLocation($newLocation);
지도 보강
지도 보강에서는 이름과 위도로 구성된 두 위치를 표시합니다.
볼 수 있습니다. 위치 보강과 마찬가지로 locationName
destination
는 500자(영문 기준)로 제한됩니다.
REST
{
"origin": {
"locationName": "Australia",
"latlng": {
"latitude": "-21.197",
"longitude": "95.821"
}
},
"destination": {
"locationName": "San Francisco",
"latlng": {
"latitude": "37.757",
"longitude": "122.507"
}
}
}
자바
// Use the NewEnrichmentItemFactory helper to create a map enrichment item for
// an origin and a destination location
NewEnrichmentItem newEnrichmentItem = NewEnrichmentItemFactory.createMapEnrichment(
"Australia", -21.197, 95.821, // origin
"San Francisco", 37.757, 122.507 // destination
);
PHP
// Create two new location objects to create a map enrichment item
// for an origin and a destination location
$locationAustralia = new Location();
$locationAustralia->setLocationName("Australia");
$locationAustralia->setLatlng((new LatLng())->setLatitude(-21.197)->setLongitude(95.821));
$locationSanFrancisco = new Location();
$locationSanFrancisco->setLocationName("San Francisco");
$locationSanFrancisco->setLatlng((new LatLng())->setLatitude(37.757)->setLongitude(122.507));
$newEnrichmentItem =
PhotosLibraryResourceFactory::newEnrichmentItemWithMap($locationAustralia, $locationSanFrancisco);
지원되는 위치 지정
앨범의 시작
위치 FIRST_IN_ALBUM
는 앨범의 시작을 나타냅니다. 발견된 항목
사용자에게 먼저 표시됩니다.
REST
{
"position": "FIRST_IN_ALBUM",
}
자바
AlbumPosition albumPosition = AlbumPositionFactory.createFirstInAlbum();
PHP
$albumPosition = new AlbumPosition();
$albumPosition->setPosition(PositionType::FIRST_IN_ALBUM);
앨범의 마지막
위치 LAST_IN_ALBUM
는 앨범의 끝부분을 나타냅니다. 여기에 있는 상품
사용자에게 마지막으로 표시됩니다
REST
{
"position": "LAST_IN_ALBUM",
}
자바
AlbumPosition albumPosition = AlbumPositionFactory.createLastInAlbum();
PHP
$albumPosition = new AlbumPosition();
$albumPosition->setPosition(PositionType::LAST_IN_ALBUM);
위치 relativeMediaItem
를 지정하면
미디어 항목입니다. 항목은 지정된 미디어 항목 뒤에 추가됩니다.
REST
{
"position": "after-media-item",
"relativeMediaItemId": "media-item-id"
}
자바
AlbumPosition albumPosition = AlbumPositionFactory.createAfterMediaItem(mediaItemId);
PHP
$albumPosition = PhotosLibraryResourceFactory::albumPositionAfterMediaItem($mediaItemId);
보강 항목 기준
relativeEnrichmentItemId
를 지정하면
보강 항목을 선택합니다 항목은 지정된 보강 항목 뒤에 추가됩니다.
REST
{
"position": "after-enrichment-item",
"relativeEnrichmentItemId": "enrichment-item-id"
}
자바
AlbumPosition albumPosition = AlbumPositionFactory.createAfterEnrichmentItem(enrichmentItemId);
PHP
$albumPosition = PhotosLibraryResourceFactory::albumPositionAfterEnrichmentItem($enrichmentItemId);
보강 수정
현재 보강을 수정할 수 있는 방법은 없습니다. 그러나 한 번 강화하여
만들어져 앨범에 추가된 경우 사용자는 보강 작업을 수정할 수 있습니다.
사진을 공유할 수 있습니다.
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책을 참조하세요. 자바는 Oracle 및/또는 Oracle 계열사의 등록 상표입니다.
최종 업데이트: 2025-09-04(UTC)
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["필요한 정보가 없음","missingTheInformationINeed","thumb-down"],["너무 복잡함/단계 수가 너무 많음","tooComplicatedTooManySteps","thumb-down"],["오래됨","outOfDate","thumb-down"],["번역 문제","translationIssue","thumb-down"],["샘플/코드 문제","samplesCodeIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-09-04(UTC)"],[[["\u003cp\u003eEnrichments give your application control over the structure and presentation of photos within Google Photos albums by adding context through annotations and ordering.\u003c/p\u003e\n"],["\u003cp\u003eGoogle Photos supports three types of enrichments: text, locations (markers with place names), and maps (showing an origin and destination).\u003c/p\u003e\n"],["\u003cp\u003eWhen adding enrichments, you must specify their position in the album, which can be at the start, end, or relative to an existing media or enrichment item.\u003c/p\u003e\n"],["\u003cp\u003eEnrichments are added individually using the \u003ccode\u003ealbums.addEnrichment\u003c/code\u003e call, requiring specific authorization scopes.\u003c/p\u003e\n"],["\u003cp\u003eAlthough enrichments can't be modified programmatically, users can edit them directly through the Google Photos app.\u003c/p\u003e\n"]]],["Enrichments allow control over photo presentation in Google Photos albums by adding context and organizing images. Three enrichment types are supported: text, location, and map. Adding enrichments requires specific authorization scopes and is restricted to albums the app created. Enrichments are added one at a time via `albums.addEnrichment`, specifying the enrichment item and its position within the album. Positions can be at the start or end of the album, or relative to media or other enrichment items. The enrichment item ID returned can be used to position items.\n"],null,["Enrichments let your application control the structure and presentation of\nphotos within an album in Google Photos. They allow you to present the user\nwith additional context through text or location annotations and order/group\nimages that tell a story together.\n\nRequired authorization scope\n\nTo add enrichments, at least one of the following scopes is required:\n\n- `photoslibrary.appendonly`\n- `photoslibrary.library`\n- `photoslibrary.sharing`\n\nFor each scope, the `enrichAlbum` call is restricted to only the albums created\nby the app.\n\nWhen using the `.sharing` scope, `enrichAlbum` is restricted to circumstances\nwhere the developer is acting on behalf of the owner of the shared album.\n\nEnrichment types\n\nGoogle Photos supports three types of enrichments in albums: text,\nlocations, and maps.\n\nText enrichments\n\nA text enrichment is a plain text string that can be inserted to annotate the\nalbum.\n\nLocation enrichments\n\nA location enrichment is a marker and the name of the place that can be inserted\nto annotate a location.\n\nMap enrichments\n\nA map enrichment is a map with a specified origin and destination that can be\ninserted in the album.\n\nPositions\n\nTo insert media items and album enrichments, specify the position of the album.\nA position is optional for media items, but must be specified for album\nenrichment.\n\nA position can only be specified when\n[creating a media item](/photos/library/guides/upload-media#creating-media-item)\nor adding enrichments. Existing media items in an album can't be reorganized, so\nit's important to set the position of an item when it's being added.\n\nStart of album\n\nA media/enrichment item can be added to the start of the album as absolute\npositioning.\n\nEnd of album\n\nA media/enrichment item can be added to the end of the album as absolute\npositioning.\n\nRelative to media item\n\nA media/enrichment item can be added relative to a media item beginning after\nits position in the album.\n\nRelative to enrichment item\n\nA media/enrichment item can be added relative to an enrichment item beginning\nafter its position in the album.\n\nAdding enrichments to album\n\nEnrichments are added one at a time and must be added to a position in an album.\nTo add enrichments to an album, call\n[`albums.addEnrichment`](/photos/library/legacy/reference/rest/v1/albums/addEnrichment).\n\nIf the request is successful, it returns the `id` of the enrichment item, which\ncan be used to position media items or other enrichments. \n\nREST\n\nHere is a POST request: \n\n```\nPOST https://photoslibrary.googleapis.com/v1/albums/album-id:addEnrichment\nContent-type: application/json\nAuthorization: Bearer oauth2-token\n\u003cvar translate=\"no\"\u003erequest-body\u003c/var\u003e\n```\n\nThe request body consists of the enrichment item and its position: \n\n```restructuredtext\n{\n \"newEnrichmentItem\": {\n enrichment-to-be-added\n },\n \"albumPosition\": {\n position-of-enrichment\n}\n```\n\nHere is a sample response: \n\n```restructuredtext\n{\n \"enrichmentItem\": {\n \"id\": \"enrichment-item-id\",\n }\n}\n```\n\nJava \n\n```java\ntry {\n // Create the enrichment using the NewEnrichmentItemFactory helper\n NewEnrichmentItem newEnrichmentItem = NewEnrichmentItemFactory.createTextEnrichment(\"\");\n\n // Set the position of the enrichment within the album\n AlbumPosition albumPosition = AlbumPositionFactory.createFirstInAlbum();\n\n // To add an enrichment, specify the album, the enrichment item,\n // and the position in the album where the enrichment is to be added\n AddEnrichmentToAlbumResponse response = photosLibraryClient\n .addEnrichmentToAlbum(albumId, newEnrichmentItem, albumPosition);\n // The response contains an EnrichmentItem\n // whose ID can be used to position media items or other enrichments\n EnrichmentItem enrichmentItem = response.getEnrichmentItem();\n String itemId = enrichmentItem.getId();\n} catch (ApiException e) {\n // Handle error\n}\n```\n\nPHP \n\n```php\n// Create the enrichment item using the PhotosLibraryResourceFactory helper\n$newEnrichmentItem = PhotosLibraryResourceFactory::newEnrichmentItemWithText(\"\");\n// ...\n// Set the position of the enrichment within the album\n$position = new AlbumPosition();\n// ...\ntry {\n // To add an enrichment, specify the album, the enrichment item,\n // and the position in the album where the enrichment is to be added\n $response = $photosLibraryClient-\u003eaddEnrichmentToAlbum($albumId, $newEnrichmentItem, $position);\n // The response contains an EnrichmentItem\n // whose ID can be used to position media items or other enrichments\n $enrichmentItem = $response-\u003egetEnrichmentItem();\n $itemId = $enrichmentItem-\u003egetId();\n\n} catch (\\Google\\ApiCore\\ApiException $e) {\n // Handle error\n}\n```\n\nSupported enrichments\n\nText enrichments\n\nText enrichments contain a single text string (no more than 1000 characters), as\nshown in the following example: \n\nREST \n\n```restructuredtext\n{\n \"text\": \"Text to be shown\"\n}\n```\n\nJava \n\n```java\n// Use the NewEnrichmentItemFactory helper to create a text enrichment item\nNewEnrichmentItem newEnrichmentItem =\n NewEnrichmentItemFactory.createTextEnrichment(\"text to be shown\");\n```\n\nPHP \n\n```php\n$newEnrichmentItem = PhotosLibraryResourceFactory::newEnrichmentItemWithText(\"text to be shown\");\n```\n\nLocation enrichments\n\nLocation enrichments consist of an arbitrary location name and the latitude and\nlongitude position. The `locationName` is limited to 500 characters. \n\nREST \n\n```restructuredtext\n{\n \"location\": {\n \"locationName\": \"Australia\",\n \"latlng\": {\n \"latitude\": \"-21.197\",\n \"longitude\": \"95.821\"\n }\n }\n}\n```\n\nJava \n\n```java\n// Use the NewEnrichmentItemFactory helper to create a location enrichment\n// with the name, latitude, and longitude of the location\nNewEnrichmentItem newEnrichmentItem =\n NewEnrichmentItemFactory.createLocationEnrichment(\"Australia\", -21.197, 95.821);\n```\n\nPHP \n\n```php\n// Create a new location object and set the name, latitude, and longitude of the location\n$newLocation = new Location();\n$newLocation-\u003esetLocationName(\"Australia\");\n$newLocation-\u003esetLatlng((new LatLng())-\u003esetLatitude(-21.197)-\u003esetLongitude(95.821));\n\n$newEnrichmentItem = PhotosLibraryResourceFactory::newEnrichmentItemWithLocation($newLocation);\n```\n\nMap enrichments\n\nMap enrichments show two locations, each consisting of a name and the latitude\nand longitude. Similar to the location enrichment, the `locationName` within the\norigin and `destination` is limited to 500 characters. \n\nREST \n\n```restructuredtext\n{\n \"origin\": {\n \"locationName\": \"Australia\",\n \"latlng\": {\n \"latitude\": \"-21.197\",\n \"longitude\": \"95.821\"\n }\n },\n \"destination\": {\n \"locationName\": \"San Francisco\",\n \"latlng\": {\n \"latitude\": \"37.757\",\n \"longitude\": \"122.507\"\n }\n }\n}\n```\n\nJava \n\n```java\n// Use the NewEnrichmentItemFactory helper to create a map enrichment item for\n// an origin and a destination location\nNewEnrichmentItem newEnrichmentItem = NewEnrichmentItemFactory.createMapEnrichment(\n \"Australia\", -21.197, 95.821, // origin\n \"San Francisco\", 37.757, 122.507 // destination\n);\n```\n\nPHP \n\n```php\n// Create two new location objects to create a map enrichment item\n// for an origin and a destination location\n$locationAustralia = new Location();\n$locationAustralia-\u003esetLocationName(\"Australia\");\n$locationAustralia-\u003esetLatlng((new LatLng())-\u003esetLatitude(-21.197)-\u003esetLongitude(95.821));\n\n$locationSanFrancisco = new Location();\n$locationSanFrancisco-\u003esetLocationName(\"San Francisco\");\n$locationSanFrancisco-\u003esetLatlng((new LatLng())-\u003esetLatitude(37.757)-\u003esetLongitude(122.507));\n\n$newEnrichmentItem =\n PhotosLibraryResourceFactory::newEnrichmentItemWithMap($locationAustralia, $locationSanFrancisco);\n```\n\nSupported positioning\n\nStart of album\n\nThe position `FIRST_IN_ALBUM` refers to the start of the album. Items located\nhere are shown to the user first: \n\nREST \n\n```restructuredtext\n{\n \"position\": \"FIRST_IN_ALBUM\",\n}\n```\n\nJava \n\n```java\nAlbumPosition albumPosition = AlbumPositionFactory.createFirstInAlbum();\n```\n\nPHP \n\n```php\n$albumPosition = new AlbumPosition();\n$albumPosition-\u003esetPosition(PositionType::FIRST_IN_ALBUM);\n```\n\nEnd of album\n\nThe position `LAST_IN_ALBUM` refers to the end of the album. Items located here\nare shown to the user last. \n\nREST \n\n```restructuredtext\n{\n \"position\": \"LAST_IN_ALBUM\",\n}\n```\n\nJava \n\n```java\nAlbumPosition albumPosition = AlbumPositionFactory.createLastInAlbum();\n```\n\nPHP \n\n```php\n$albumPosition = new AlbumPosition();\n$albumPosition-\u003esetPosition(PositionType::LAST_IN_ALBUM);\n```\n\nRelative to media item\n\nSpecifying the position `relativeMediaItem` refers to a position relative to a\nmedia item. The items are added after the specified media item. \n\nREST \n\n```restructuredtext\n{\n \"position\": \"after-media-item\",\n \"relativeMediaItemId\": \"media-item-id\"\n}\n```\n\nJava \n\n```java\nAlbumPosition albumPosition = AlbumPositionFactory.createAfterMediaItem(mediaItemId);\n```\n\nPHP \n\n```php\n$albumPosition = PhotosLibraryResourceFactory::albumPositionAfterMediaItem($mediaItemId);\n```\n\nRelative to enrichment item\n\nSpecifying a `relativeEnrichmentItemId` refers to a position relative to an\nenrichment item. The items are added after the specified enrichment item. \n\nREST \n\n```restructuredtext\n{\n \"position\": \"after-enrichment-item\",\n \"relativeEnrichmentItemId\": \"enrichment-item-id\"\n}\n```\n\nJava \n\n```java\nAlbumPosition albumPosition = AlbumPositionFactory.createAfterEnrichmentItem(enrichmentItemId);\n```\n\nPHP \n\n```php\n$albumPosition = PhotosLibraryResourceFactory::albumPositionAfterEnrichmentItem($enrichmentItemId);\n```\n\nModifying enrichments\n\nCurrently, there is no way to modify enrichments. However, once an enrichment\nhas been created and added to an album, the user can modify the enrichments\nthrough the Google Photos app."]]