보강 추가
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
보강 기능을 사용하면 애플리케이션에서 Google 포토의 앨범 내 사진의 구조와 프레젠테이션을 제어할 수 있습니다. 이를 통해 텍스트 또는 위치 주석과 함께 스토리를 전달하는 이미지를 정렬/그룹화하여 사용자에게 추가 컨텍스트를 제공할 수 있습니다.
필수 승인 범위
앱에서 만든 앨범에 보강 항목을 추가하려면 photoslibrary.appendonly
범위가 필요합니다. 범위에 관한 자세한 내용은 승인 범위를 참고하세요.
보강 유형
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",
}
}
지원되는 보강
텍스트 보강
텍스트 보강에는 다음 예와 같이 단일 텍스트 문자열(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);
지도 보강
지도 보강은 각각 이름, 위도, 경도로 구성된 두 위치를 표시합니다. 위치 보강과 마찬가지로 출처 및 destination
내의 locationName
는 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);
보강 수정
현재 보강 기능을 수정할 방법은 없습니다. 하지만 보강 항목이 생성되고 앨범에 추가되면 사용자는 Google 포토 앱을 통해 보강 항목을 수정할 수 있습니다.
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 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 allow you to add text, location markers, and maps to Google Photos albums for better storytelling and context.\u003c/p\u003e\n"],["\u003cp\u003eYou need the \u003ccode\u003ephotoslibrary.appendonly\u003c/code\u003e scope to use the Enrichments feature within your application.\u003c/p\u003e\n"],["\u003cp\u003eWhen adding enrichments, specify their position relative to other items or the start/end of the album.\u003c/p\u003e\n"],["\u003cp\u003eEnrichments are added one at a time using the \u003ccode\u003ealbums.addEnrichment\u003c/code\u003e API call and cannot be programmatically modified after creation.\u003c/p\u003e\n"],["\u003cp\u003eUsers can manually modify enrichments within the Google Photos app after they have been added.\u003c/p\u003e\n"]]],["Enrichments enhance Google Photos albums with text, location, or map annotations, requiring the `photoslibrary.appendonly` scope. To add an enrichment, use the `albums.addEnrichment` API call, providing the enrichment type and its position. Positions can be at the start, end, or relative to a media or enrichment item, specified by ID. Supported enrichments include text (max 1000 characters), location (name and coordinates), and maps (origin and destination locations). Enrichments are added one at a time, and the server returns its `id`. Existing enrichments cannot be modified through the API.\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\nAdding enrichments to app-created albums requires the `photoslibrary.appendonly`\nscope. For more information on scopes, see [Authorization\nscopes](/photos/overview/authorization).\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 [creating a media\nitem](/photos/library/guides/upload-media#creating-media-item) or adding\nenrichments. Existing media items in an album can't be reorganized, so it's\nimportant 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/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\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."]]