PRESENTATION_ID: 프레젠테이션 ID를 제공하는 위치를 나타냅니다. 프레젠테이션 URL에서 이 ID의 값을 확인할 수 있습니다.
PAGE_ID: 페이지 객체 ID를 제공하는 위치를 나타냅니다. URL에서 또는 API 읽기 요청을 사용하여 이 값을 가져올 수 있습니다.
이러한 예는 언어에 구애받지 않는 HTTP 요청으로 표시됩니다. 이 예시에서는 1EAYk18WDjIG-zp_0vLm3CsfQh_i8eXc67Jo2O9C6Vuc가 PRESENTATION_ID인 예시 프레젠테이션에서 읽습니다. 이 프레젠테이션의 첫 번째 슬라이드PAGE_ID은 ge63a4b4_1_0입니다.
여기 예에서는 필드 마스크를 사용하여 프레젠테이션, 슬라이드, 페이지 요소에 관한 요청된 특정 정보만 반환합니다. 필드 마스크를 사용하면 성능도 향상됩니다.
슬라이드 객체 ID 읽기
다음 presentations.get 코드 샘플은 프레젠테이션에서 모든 슬라이드 객체 ID 목록을 가져오는 방법을 보여줍니다. ID는 슬라이드 프레젠테이션 순서로 반환되며 후속 API 요청에서 특정 슬라이드를 나타내는 데 사용할 수 있습니다. fields=masters.objectId 및 fields=layout.objectId를 사용하여 마스터 페이지와 레이아웃 페이지의 객체 ID를 동일한 방식으로 가져올 수 있습니다.
슬라이드 객체 ID를 읽는 요청 프로토콜은 다음과 같습니다.
GET https://slides.googleapis.com/v1/presentations/PRESENTATION_ID?fields=slides.objectId
다음 presentations.pages.get 코드 샘플은 페이지에서 모든 Shapes 목록을 가져오는 방법을 보여줍니다. fields 매개변수를 사용하여 다른 PageElement 종류를 지정하여 검색할 수 있습니다. 예를 들어 fields=pageElements(line,table)는 페이지에 있는 경우 line 및 table 페이지 요소에 관한 정보만 반환합니다.
다음은 페이지에서 도형 요소를 읽기 위한 요청 프로토콜입니다.
GET https://slides.googleapis.com/v1/presentations/PRESENTATION_ID/pages/PAGE_ID?fields=pageElements.shape
응답은 요청된 모양 요소를 포함하는 Page 객체로 구성됩니다. 빈 중괄호는 도형 유형이 아닌 페이지 요소를 나타냅니다. 이 경우 이미지 페이지 요소입니다.
[[["이해하기 쉬움","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-08-04(UTC)"],[],[],null,["The Google Slides API lets you read presentation, page, and page element data. The\nexamples on this page show how to perform common read operations using both the\n[`presentations.get`](/workspace/slides/api/reference/rest/v1/presentations/get) and\n[`presentations.pages.get`](/workspace/slides/api/reference/rest/v1/presentations.pages/get)\nmethods.\n\nThese examples use the following placeholders:\n\n- \u003cvar translate=\"no\"\u003ePRESENTATION_ID\u003c/var\u003e---Indicates where you provide the [presentation\n ID](/workspace/slides/api/guides/overview#the_structure_of_a_presentation). You can discover the value for this ID from the presentation URL.\n- \u003cvar translate=\"no\"\u003ePAGE_ID\u003c/var\u003e---Indicates where you provide the [page object\n ID](/workspace/slides/api/guides/overview#working_with_object_ids). You can retrieve the value for this from the URL or by using an API read request.\n\nThese examples are presented as HTTP requests to be language neutral. The\nexamples read from this [example\npresentation](https://docs.google.com/presentation/d/1EAYk18WDjIG-zp_0vLm3CsfQh_i8eXc67Jo2O9C6Vuc/edit),\nthat has `1EAYk18WDjIG-zp_0vLm3CsfQh_i8eXc67Jo2O9C6Vuc` as its\n\u003cvar translate=\"no\"\u003ePRESENTATION_ID\u003c/var\u003e. The \u003cvar translate=\"no\"\u003ePAGE_ID\u003c/var\u003e of the\n[first\nslide](https://docs.google.com/presentation/d/1EAYk18WDjIG-zp_0vLm3CsfQh_i8eXc67Jo2O9C6Vuc/edit#slide=id.ge63a4b4_1_0)\nin this presentation is `ge63a4b4_1_0`.\n\nThe examples here use [field masks](/workspace/slides/api/guides/field-masks) to only\nreturn specific requested information about the presentation, slide, and page\nelement. Using field masks also improves performance.\n\nRead slide object IDs\n\nThe following\n[`presentations.get`](/workspace/slides/api/reference/rest/v1/presentations/get) code\nsample shows how to retrieve a list of all the slide object IDs from the\npresentation. The IDs are returned in the slide presentation order, and can be\nused to indicate specific slides in subsequent API requests. You can get the\nobject IDs of master and layout pages the same way, using\n`fields=masters.objectId` and `fields=layout.objectId`.\n\nThe following is the request protocol to read slide object IDs:\n\n\u003cbr /\u003e\n\n```\nGET https://slides.googleapis.com/v1/presentations/PRESENTATION_ID?fields=slides.objectId\n```\n\nThe response consists of a\n[`Presentation`](/workspace/slides/api/reference/rest/v1/presentations#resource:-presentation)\nobject containing the object IDs requested: \n\n```scdoc\n{\n \"slides\": [\n {\n \"objectId\": \"ge63a4b4_1_0\"\n },\n {\n \"objectId\": \"ge63a4b4_1_9\"\n },\n {\n \"objectId\": \"ge63a4b4_1_23\"\n },\n {\n \"objectId\": \"ge63a4b4_1_35\"\n },\n {\n \"objectId\": \"ge63a4b4_1_43\"\n }\n ]\n}\n```\n\nRead element object IDs from a page\n\nThe following\n[`presentations.pages.get`](/workspace/slides/api/reference/rest/v1/presentations.pages/get)\ncode sample shows how to retrieve a list of object IDs for all the page elements\non a page.\n\nThe following is the request protocol to read element object IDs from a page:\n\n\u003cbr /\u003e\n\n```\nGET https://slides.googleapis.com/v1/presentations/PRESENTATION_ID/pages/PAGE_ID?fields=pageElements.objectId\n```\n\nThe response consists of a\n[`Page`](/workspace/slides/api/reference/rest/v1/presentations.pages#resource-page) object\ncontaining the object IDs requested: \n\n```scdoc\n{\n \"pageElements\": [\n {\n \"objectId\": \"ge63a4b4_1_5\"\n },\n {\n \"objectId\": \"ge63a4b4_1_6\"\n },\n {\n \"objectId\": \"ge63a4b4_1_7\"\n },\n {\n \"objectId\": \"ge63a4b4_1_8\"\n }\n ]\n}\n```\n\nRead shape elements from a page\n\nThe following\n[`presentations.pages.get`](/workspace/slides/api/reference/rest/v1/presentations.pages/get)\ncode sample shows how to retrieve a list of all\n[`Shapes`](/workspace/slides/api/reference/rest/v1/presentations.pages/shapes#Page.Shape/)\non a page. You can retrieve other\n[`PageElement`](/workspace/slides/api/reference/rest/v1/presentations.pages#Page.PageElement)\nkinds by specifying them using the `fields` parameter. For example,\n`fields=pageElements(line,table)` only returns information about\n[`line`](/workspace/slides/api/reference/rest/v1/presentations.pages/lines#Page.Line) and\n[`table`](/workspace/slides/api/reference/rest/v1/presentations.pages/tables#Page.Table)\npage elements, if any are present on the page.\n| The Slides API [`presentations.pages.get`](/workspace/slides/api/reference/rest/v1/presentations.pages/get) request can return every property a shape has, including ones the API can't edit.\n\nThe following is the request protocol to read shape elements from a page:\n\n\u003cbr /\u003e\n\n```\nGET https://slides.googleapis.com/v1/presentations/PRESENTATION_ID/pages/PAGE_ID?fields=pageElements.shape\n```\n\nThe response consists of a\n[`Page`](/workspace/slides/api/reference/rest/v1/presentations.pages#resource-page) object\ncontaining the shape elements requested. The empty braces indicate page elements\nthat are not of the shape type; in this case, they're image page elements. \n\n```carbon\n{\n \"/workspace/slides/api/reference/rest/v1/presentations.pages#Page.PageElement\": [\n {},\n {},\n {\n \"/workspace/slides/api/reference/rest/v1/presentations.pages/shapes#Page.Shape/\": {\n \"/workspace/slides/api/reference/rest/v1/presentations.pages/shapes#Page.ShapeProperties\" {\n \"/workspace/slides/api/reference/rest/v1/presentations.pages/other#Page.Outline\" {\n \"/workspace/slides/api/reference/rest/v1/presentations.pages/other#Page.DashStyle\": \"SOLID\",\n \"/workspace/slides/api/reference/rest/v1/presentations.pages/other#Page.OutlineFill\": {\n \"/workspace/slides/api/reference/rest/v1/presentations.pages/other#Page.SolidFill\": {\n \"alpha\": 1,\n \"/workspace/slides/api/reference/rest/v1/presentations.pages/other#Page.OpaqueColor\": {\n \"/workspace/slides/api/reference/rest/v1/presentations.pages/other#Page.RgbColor\": {}\n }\n },\n },\n \"/workspace/slides/api/reference/rest/v1/presentations.pages/other#Page.PropertyState\": \"NOT_RENDERED\",\n \"/workspace/slides/api/reference/rest/v1/Dimension\": {\n \"magnitude\": 9525,\n \"/workspace/slides/api/reference/rest/v1/Unit\": \"EMU\"\n }\n },\n \"/workspace/slides/api/reference/rest/v1/presentations.pages/other#Page.Shadow\": {\n \"/workspace/slides/api/reference/rest/v1/presentations.pages/other#Page.RectanglePosition\": \"BOTTOM_LEFT\",\n \"alpha\": 1,\n \"/workspace/slides/api/reference/rest/v1/Dimension\": {\n \"/workspace/slides/api/reference/rest/v1/Unit\": \"EMU\"\n },\n \"/workspace/slides/api/reference/rest/v1/presentations.pages/other#Page.OpaqueColor\": {\n \"/workspace/slides/api/reference/rest/v1/presentations.pages/other#Page.RgbColor\": {}\n },\n \"/workspace/slides/api/reference/rest/v1/presentations.pages/other#Page.PropertyState\": \"NOT_RENDERED\",\n \"rotateWithShape\": false,\n \"/workspace/slides/api/reference/rest/v1/presentations.pages/other#Page.AffineTransform\": {\n \"scaleX\": 1,\n \"scaleY\": 1,\n \"/workspace/slides/api/reference/rest/v1/Unit\": \"EMU\"\n },\n \"/workspace/slides/api/reference/rest/v1/presentations.pages/shapes#Page.Type_2\": \"OUTER\"\n },\n \"/workspace/slides/api/reference/rest/v1/presentations.pages/shapes#Page.ShapeBackgroundFill\" : {\n \"/workspace/slides/api/reference/rest/v1/presentations.pages/other#Page.PropertyState\": \"NOT_RENDERED\",\n \"/workspace/slides/api/reference/rest/v1/presentations.pages/other#Page.SolidFill\": {\n \"alpha\": 1,\n \"/workspace/slides/api/reference/rest/v1/presentations.pages/other#Page.OpaqueColor\": {\n \"/workspace/slides/api/reference/rest/v1/presentations.pages/other#Page.RgbColor: {\n \"blue\": 1,\n \"green\": 1,\n \"red\": 1\n }\n }\n }\n }\n },\n \"shapeType\": \"TEXT_BOX\",\n \"text\": {\n \"textElements\": [\n {\n \"endIndex\": 11,\n \"paragraphMarker\": {\n \"style\": {\n \"alignment\": \"START\",\n \"direction\": \"LEFT_TO_RIGHT\",\n \"indentEnd\": {\n \"unit\": \"PT\"\n },\n \"indentFirstLine\": {\n \"unit\": \"PT\"\n },\n \"indentStart\": {\n \"unit\": \"PT\"\n },\n \"lineSpacing\": 100,\n \"spaceAbove\": {\n \"unit\": \"PT\"\n },\n \"spaceBelow\": {\n \"unit\": \"PT\"\n },\n \"spacingMode\": \"COLLAPSE_LISTS\"\n }\n }\n },\n {\n \"endIndex\": 11,\n \"textRun\": {\n \"content\": \"Baby Album\\n\",\n \"style\": {\n \"backgroundColor\": {},\n \"baselineOffset\": \"NONE\",\n \"bold\": false,\n \"fontFamily\": \"Arial\",\n \"fontSize\": {\n \"magnitude\": 14,\n \"unit\": \"PT\"\n },\n \"foregroundColor\": {\n \"opaqueColor\": {\n \"rgbColor\": {}\n }\n },\n \"italic\": false,\n \"smallCaps\": false,\n \"strikethrough\": false,\n \"underline\": false\n }\n }\n }\n ]\n }\n }\n },\n ...\n ]\n}\n```"]]