개발자 가이드 개요
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
경고: 이 페이지는 Google의 이전 API인 Google Data API에 관한 것으로, Google Data API 디렉터리에 표시된 API 중 상당수가 최신 API로 대체된 API입니다. 특정 새 API에 대한 자세한 내용은 새 API 문서를 참조하세요. 최신 API를 사용하여 요청을 승인하는 방법은 Google 계정 인증 및 승인을 참고하세요.
Google의 목표는 전 세계 정보를 체계화하여 모두가 편리하게 이용할 수 있도록 하는 것입니다. 여기에는 웹브라우저가 아닌 다른 컨텍스트에서 정보에 액세스할 수 있도록 하고 Google 외부의 서비스에서도 액세스할 수 있도록 하는 것이 포함됩니다.
Google 데이터 프로토콜은 외부 개발자가 새로운 Google 애플리케이션을 개발하여 최종 사용자가 많은 Google 제품에 저장된 데이터에 액세스하고 이를 업데이트할 수 있는 안전한 수단을 제공합니다. 외부 개발자는 Google 데이터 프로토콜을 직접 사용하거나 클라이언트 라이브러리에서 제공되는 지원되는 프로그래밍 언어를 사용할 수 있습니다.
대상
이 문서 모음은 Google 데이터 프로토콜을 이해하려는 사용자를 대상으로 합니다. 언어별 클라이언트 라이브러리를 사용하는 코드를 작성하려는 경우에도 클라이언트 라이브러리 추상화 계층의 내용을 이해하려면 이 문서 세트가 도움이 될 수 있습니다.
특정 API에 관한 개발자 가이드를 찾고 있다면 Google 데이터 프로토콜 API 디렉터리를 방문하세요.
원하는 프로그래밍 언어로 API에 액세스하려면 클라이언트 라이브러리 다운로드 페이지를 방문하세요.
배경
Calendar 및 스프레드시트와 같은 다양한 Google 제품에서 Google 데이터 프로토콜을 기반으로 하는 API를 제공합니다. 개발자는 이러한 API를 사용하여 최종 사용자에게 Google 제품에 저장된 데이터에 액세스하고 이를 조작할 수 있는 새로운 방법을 제공하는 클라이언트 애플리케이션을 작성할 수 있습니다.
참고: 이 문서 및 다른 관련 문서에서는 API를 제공하는 Google 제품을 서비스라고도 합니다.
Google 데이터 프로토콜을 직접 사용하는 코드를 작성하면 GET
또는 POST
와 같은 HTTP 요청을 사용하여 API에 액세스합니다. 이러한 요청을 통해 Google 제품에 저장된 데이터는 데이터 피드 형태로 유선을 통해 송수신됩니다. 데이터 피드는 단순히 데이터가 포함된 구조화된 목록입니다. 기존에는 기본 피드 형식이 AtomPub XML이었지만, 이제는 JSON(자바스크립트 객체 표기법)이 대체 형식으로도 제공됩니다.
HTTP 요청을 직접 보내는 코드를 작성하지 않으려면 제공된 클라이언트 라이브러리 세트에서 제공되는 프로그래밍 언어 중 하나를 사용하여 클라이언트 애플리케이션을 프로그래밍하면 됩니다. 이렇게 하면 HTTP 요청의 세부정보가 클라이언트 라이브러리에서 처리됩니다. 클라이언트 라이브러리에서 제공하는 언어별 메서드와 클래스를 사용하여 보다 개념적인 수준에서 코드를 작성합니다.
사용 중인 API 또는 API 버전에 사용 가능한 특정 언어에 대한 자세한 내용은 제품별 문서를 참조하세요.
프로토콜 버전
프로토콜 버전 2.0과 프로토콜 버전 1.0 비교
Google 데이터 프로토콜의 첫 번째 버전은 Atom 게시 프로토콜이 완료되기 전에 개발되었습니다. Google 데이터 프로토콜의 두 번째 버전은 AtomPub RFC 5023 표준을 완벽하게 준수합니다.
Google 데이터 프로토콜 버전 2.0에는 다음 항목에 대한 지원도 포함됩니다.
- HTTP ETag 클라이언트 애플리케이션에서 HTTP 캐싱을 더 효과적으로 사용할 수 있도록 지원하는 웹 표준입니다. 프로토콜 v2.0을 지원하는 클라이언트 라이브러리에 포함된 서비스는 자동으로 ETag를 처리합니다.
- 부분 응답 및 부분 업데이트(실험용) 데이터를 적게 전송하는 요청을 할 수 있는 기능 실제로 필요한 정보만 요청하거나 실제로 변경하려는 데이터만 포함된 업데이트를 전송하는 방식으로 클라이언트 애플리케이션의 네트워크, CPU, 메모리 리소스 사용 효율을 훨씬 높일 수 있습니다. 현재 부분 응답 및 부분 업데이트는 일부 제품에만 사용할 수 있습니다. API가 이를 지원하는지 알아보려면 제품별 문서를 참조하세요.
애플리케이션 업데이트
사용 중인 API가 프로토콜의 최신 버전을 기반으로 하는 경우 프로토콜 v2.0 기능이 문서에 포함되어 있습니다. 일반적으로 클라이언트 애플리케이션을 API에 사용할 수 있는 최신 버전으로 업그레이드하는 것이 좋습니다.
클라이언트 라이브러리 기반 클라이언트 업데이트
클라이언트 애플리케이션이 자바 클라이언트 라이브러리 또는 .NET 클라이언트 라이브러리와 같은 클라이언트 라이브러리를 사용하는 경우 프로토콜 v2.0 기능을 지원하는 API 버전이 포함될 수 있습니다. 자세한 내용은 다음 두 가지 모두에 해당하는지 확인하기 위해 사용 중인 Google 제품의 API 문서를 참고하세요.
- Google 데이터 프로토콜 v2.0 기능을 지원하는 API 버전이 있습니다.
- 사용 중인 클라이언트 라이브러리도 해당 API 버전을 지원합니다.
클라이언트 라이브러리가 이를 지원하고 기존 애플리케이션을 업데이트하려면 최신 버전의 클라이언트 라이브러리를 다운로드하여 사용하면 됩니다. 모든 코드는 계속 작동하며 클라이언트 라이브러리는 프로토콜 v2.0 변경사항을 처리합니다.
원시 HTTP 클라이언트 업데이트
Google 데이터 프로토콜을 사용하여 클라이언트 애플리케이션을 직접 작성한 경우 다음과 같이 변경해야 합니다.
- 기본이 아닌 버전 요청. 전송하는 모든 HTTP 요청에 HTTP 버전 헤더 (
GData-Version: X.0
)를 추가하세요. 여기서 X
는 Google 데이터 프로토콜 v2.0 기능을 지원하는 API 버전입니다. 또는 모든 요청의 URL에 쿼리 매개변수 (v=X.0
)를 추가합니다. 여기서 X
는 다시 올바른 버전의 API입니다. 이후 버전을 지정하지 않으면 기본적으로 지원되는 가장 이른 버전의 API로 요청이 전송됩니다.
- 낙관적 동시 실행. 낙관적 동시 실행을 지원하는 API 버전을 사용 중이었다면 ETag를 사용하기 위해 업데이트를 변경하고 코드를 삭제해야 할 수 있습니다. 자세한 내용은 Google 데이터 프로토콜 참조 문서의 E태그 섹션 및 클라이언트 애플리케이션에서 사용하는 서비스에 대한 프로토콜 개발자 가이드의 업데이트 및 삭제 섹션을 참조하세요.
- URI 자체 수정 또는 수정. 클라이언트가 자신을 추적하거나 피드 또는 항목의 URI를 수정하는 경우 해당 URI는 변경되었을 수 있습니다. 새 URI를 가져오려면 이전 URI를 사용하여 항목을 다시 요청하되, 요청을 버전 X.0 요청으로 표시합니다. 여기서 X는 Google 데이터 프로토콜 v2.0 기능을 지원하는 API 버전입니다. 서버는 새 URI를 비롯하여 항목의 새 표현을 반환하고, 이전 URI 대신 이 URI를 저장할 수 있습니다.
- 네임스페이스 URI: 클라이언트에서 Google Data Protocol API 네임스페이스 URI를 로컬로 저장하거나 하드 코딩한 경우 업데이트해야 합니다.
- AtomPub 네임스페이스 (프리픽스
app
)가 http://purl.org/atom/app
에서 http://www.w3.org/2007/app
로 변경되었습니다.
- OpenSearch 네임스페이스 (프리픽스
openSearch
)가 http://a9.com/-/spec/opensearchrss/1.0/
에서 http://a9.com/-/spec/opensearch/1.1/
로 변경되었습니다.
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책을 참조하세요. 자바는 Oracle 및/또는 Oracle 계열사의 등록 상표입니다.
최종 업데이트: 2023-03-01(UTC)
[null,null,["최종 업데이트: 2023-03-01(UTC)"],[[["\u003cp\u003eThe Google Data Protocol enables external developers to build applications that access and update data stored in various Google products.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers can use the protocol directly via HTTP requests or leverage client libraries for supported programming languages.\u003c/p\u003e\n"],["\u003cp\u003eGoogle Data Protocol v2.0, aligned with AtomPub RFC 5023, introduces features like HTTP ETags, Partial Response, and Partial Update for enhanced efficiency.\u003c/p\u003e\n"],["\u003cp\u003eUpgrading to Protocol v2.0 may require updating client applications to handle changes related to version requests, optimistic concurrency, URIs, and namespaces.\u003c/p\u003e\n"],["\u003cp\u003eRefer to specific product documentation and the Google Data APIs directory for API details and compatibility.\u003c/p\u003e\n"]]],[],null,["# Developer's Guide Overview\n\n**Warning** : This page is about Google's older APIs, the Google Data APIs; it's relevant only to the APIs that are listed in the [Google Data APIs directory](/gdata/docs/directory), many of which have been replaced with newer APIs. For information about a specific new API, see the new API's documentation. For information about authorizing requests with a newer API, see [Google Accounts Authentication and Authorization](/accounts).\n\nGoogle's mission is to organize the world's information and make it universally accessible and useful. This includes making information accessible in contexts other than a web browser and accessible to services outside of Google.\n\nThe Google Data Protocol provides a secure means for external developers to write new applications that let end users access and update the data stored by many Google products. External developers can use the Google Data Protocol directly, or they can use any of the supported programming languages provided by the client libraries. \n\nAudience\n========\n\nThis set of documents is intended for anyone who wants to understand Google Data Protocol. Even if you just want to write code that uses the language-specific [client libraries](/gdata/docs/client-libraries), this document set can be helpful if you want to understand what's going on beneath the client-library abstraction layer.\n\nIf you're looking for the Developer's Guide for a specific API, visit the Google Data Protocol [API Directory](/gdata/docs/directory).\n\nIf you want to access an API in your favorite programming language, visit the [Client Libraries](/gdata/docs/client-libraries) download page.\n\nBackground\n==========\n\nA number of Google products, such as Calendar and Spreadsheets, provide APIs that are based on the Google Data Protocol. You, the developer, can use these APIs to write client applications that give end users new ways to access and manipulate the data they store in those Google products.\n\n**Note:** Google products that provide APIs are sometimes referred to as *services* in these and other related documents.\n\nIf you write code that uses the Google Data Protocol directly, it accesses the API using HTTP requests like `GET` or `POST`. With these requests, data stored by the Google product is transferred back and forth over the wire in the form of data feeds. The data feeds are simply structured lists that contain the data. Historically, the primary feed format has been AtomPub XML, but now JSON, or JavaScript Object Notation, is also available as an [alternate format](/gdata/docs/json).\n\nIf you prefer not to write code that makes HTTP requests directly, you can instead program your client application using one of the programming languages available in the set of client libraries provided. When you do this, the details of the HTTP requests are handled by the client library; you write your code at a more conceptual level using the language-specific methods and classes provided by the client library.\n\nRefer to the product-specific documentation for more information about the particular languages available for the API, or API version, you are using.\n\nVersions of the protocol\n========================\n\n### Protocol Version 2.0 vs. Protocol Version 1.0\n\nThe first version of the Google Data Protocol was developed before the Atom Publishing Protocol was finalized. The second version of the Google Data Protocol is fully compliant with the AtomPub [RFC 5023](http://www.rfc-editor.org/rfc/rfc5023.txt) standard.\n\nThe Google Data Protocol Version 2.0 also includes support for:\n\n- [HTTP ETags](/gdata/docs/2.0/reference#ResourceVersioning). A web standard that helps your client applications make better use of HTTP caching. The services included in the client libraries that support Protocol v2.0 handle ETags automatically.\n- [Partial Response](/gdata/docs/2.0/reference#PartialResponse) and [Partial Update](/gdata/docs/2.0/reference#PartialUpdate) (Experimental). Features that let you make requests that transfer less data. By requesting only the information that you actually need, or by sending updates that include only the data that you actually want to change, your client application can be much more efficient in its use of network, CPU, and memory resources. Currently, partial response and partial update are available only for some products; see the product-specific documentation to find out if your API supports it.\n\n### Updating your application\n\nIf the API you are using was built upon the latest version of the protocol, then the Protocol v2.0 functionality is included in its documentation. In general, we recommend that you upgrade your client application to the latest version available for your API.\n\n#### Updating a client-library-based client\n\nIf your client application uses a client library, such as the Java client library or the .NET client library, it may contain a version of the API that supports Protocol v2.0 features. To find out, refer to the API documentation for the Google product you are using to find out if both of the following are true:\n\n- There is an API version that supports Google Data Protocol v2.0 features.\n- The client library you are using also supports that API version.\n\nIf the client library supports it and you want to update your existing application, just download and use the latest version of the client library. All of your code still works, and the client library takes care of the Protocol v2.0 changes under the hood.\n\n#### Updating a raw HTTP client\n\nIf you wrote your client application using the Google Data Protocol directly, you need to make these changes:\n\n- **Non-default version requests.** Add an HTTP version header (`GData-Version: `*X*`.0`) to every HTTP request you send, where *`X`* is the version of the API that supports Google Data Protocol v2.0 features. Alternatively, add a query parameter (`v=`*X*`.0`) to the URL of every request, where *`X`* is, again, the correct version of the API. If you do not specify a later version, your requests are sent to the earliest supported version of the API by default.\n- **Optimistic concurrency.** If you were using a version of an API that supported optimistic concurrency, you may need to change your update and delete code to use ETags. For more information, read the [ETags section](/gdata/docs/2.0/reference#ResourceVersioning) of the Google Data Protocol reference documentation, and read the Update and Delete sections of the Protocol developer's guide for the service your client application is using.\n- **Self or edit URIs.** If your client keeps track of self or edit URIs for feeds or entries, note that those URIs may have changed. To get the new URI, re-request the item using the old URI, but mark the request as a version *X* .0 request, where *X* is the version of the API that supports Google Data Protocol v2.0 features. The server returns the new representation of the entry, including the new URIs, which you can store in place of the old ones.\n- **Namespace URIs.** If your client stores Google Data Protocol API namespace URIs locally, or has them hard-coded, you'll need to update them:\n - The AtomPub namespace (prefix `app`) has been changed from `http://purl.org/atom/app` to `http://www.w3.org/2007/app`.\n - The OpenSearch namespace (prefix `openSearch`) has been changed from `http://a9.com/-/spec/opensearchrss/1.0/` to `http://a9.com/-/spec/opensearch/1.1/`."]]