프로토콜 가이드

기존 Google Sites API를 사용하면 애플리케이션에서 Google Sites로 만든 사이트 내의 콘텐츠에 액세스하고 콘텐츠를 게시, 수정할 수 있습니다. 또한 애플리케이션에서 최근 활동 목록을 요청하고, 업데이트 기록을 가져오고, 첨부파일과 파일을 업로드/다운로드할 수 있습니다.

대상

이 문서에서는 사용자가 Google 데이터 API 프로토콜의 기본 개념을 이해하고 있다고 가정합니다.

이 문서는 Google 사이트 도구와 상호작용할 수 있는 클라이언트 애플리케이션을 작성하려는 프로그래머를 위해 작성되었습니다. 원시 XML/HTTP를 사용하는 기본적인 데이터 API 상호작용 예제를 일련의 설명과 함께 제공합니다. 이 문서를 읽은 후에는 왼쪽 탐색 메뉴의 다른 가이드에 있는 언어별 예를 읽어 클라이언트 라이브러리를 사용한 API와의 상호작용에 대해 자세히 알아볼 수 있습니다.

이 가이드에 있는 자료의 참조는 참조 가이드를 확인하세요.

요청 승인

애플리케이션에서 비공개 사용자 데이터를 요청할 때 승인 토큰을 포함해야 합니다. Google은 이 토큰을 사용하여 애플리케이션을 식별합니다.

승인 프로토콜 정보

요청을 승인하려면 애플리케이션에서 OAuth 2.0을 사용해야 합니다. 다른 승인 프로토콜은 지원되지 않습니다. 애플리케이션에서 Google 계정으로 로그인을 사용하는 경우, 승인의 일부 절차는 자동으로 처리됩니다.

OAuth 2.0을 사용하여 요청 승인하기

Google Sites Data API에 대한 비공개 사용자 데이터 요청은 인증된 사용자의 승인을 받아야 합니다.

OAuth 2.0의 세부적인 승인 절차('흐름')는 제작 중인 애플리케이션 종류에 따라 약간씩 다릅니다. 다음의 일반적인 과정은 모든 애플리케이션 유형에 적용됩니다.

  1. 애플리케이션을 만들 때 Google API 콘솔을 사용하여 애플리케이션을 등록합니다. 이렇게 하면 Google에서 클라이언트 ID 및 클라이언트 보안 비밀과 같이 나중에 필요한 정보를 제공합니다.
  2. Google API 콘솔에서 Google Sites Data API를 활성화합니다. API 콘솔의 목록에 이 API가 없다면 이 단계를 건너뜁니다.
  3. 애플리케이션에서 사용자 데이터에 액세스해야 하는 경우 Google에 특정 액세스 범위를 요청합니다.
  4. Google에서 사용자에게 애플리케이션이 일부 데이터를 요청하도록 승인할 것인지 물어보는 동의 화면을 표시합니다.
  5. 사용자가 승인하면 Google에서 애플리케이션에 제한 시간이 있는 액세스 토큰을 제공합니다.
  6. 애플리케이션에서 액세스 토큰을 첨부하여 사용자 데이터를 요청합니다.
  7. Google에서 요청과 토큰이 유효하다고 판단하면 요청된 데이터를 반환합니다.

일부 흐름에는 새로운 액세스 토큰을 얻기 위해 갱신 토큰을 사용하는 등의 추가 단계가 포함됩니다. 다양한 유형의 애플리케이션에 적용되는 흐름을 자세히 알아보려면 Google의 OAuth 2.0 문서를 참조하세요.

다음은 Google Sites Data API의 OAuth 2.0 범위 정보입니다.

https://sites.google.com/feeds/

OAuth 2.0을 사용하여 액세스를 요청하려면 애플리케이션에 범위 정보와 함께 애플리케이션 등록 시 Google에서 제공하는 정보(예: 클라이언트 ID, 클라이언트 보안 비밀)가 필요합니다.

맨 위로

버전 지정

Google Sites Data API에 대한 모든 요청은 1.4 버전을 지정해야 합니다. 버전 번호를 지정하려면 GData-Version HTTP 헤더를 사용합니다.

GData-Version: 1.4

또는 HTTP 헤더를 설정할 수 없는 경우 URL에서 v=1.4을 쿼리 매개변수로 지정할 수 있습니다. 하지만 가능하면 HTTP 헤더를 사용하는 것이 좋습니다.

참고: 클라이언트 라이브러리는 적절한 버전 헤더를 자동으로 제공하므로 클라이언트 라이브러리를 사용할 때는 v=1.4 쿼리 매개변수를 사용하지 마세요.

맨 위로

사이트 피드

사이트 피드를 사용하여 사용자가 소유하거나 보기 권한이 있는 Google Sites를 나열하고 기존 사이트의 제목을 수정할 수도 있습니다. G Suite 도메인의 경우 전체 사이트를 만들거나 복사하는 데 사용할 수도 있습니다.

사이트 나열

사용자가 액세스할 수 있는 사이트를 나열하려면 인증된 GET 요청을 다음 URL로 보냅니다.

https://sites.google.com/feeds/site/domainName
피드 매개변수설명
domainName'site' 또는 G Suite 호스팅 도메인의 도메인 (예: example.com)입니다.

응답에는 사이트 목록이 있는 피드가 포함됩니다.

GET /feeds/site/domainName HTTP/1.1
Host: sites.google.com
GData-Version: 1.4
Authorization: <your authorization header here>

HTTP/1.1 200 OK

<feed xmlns="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/"
    xmlns:gAcl="http://schemas.google.com/acl/2007" xmlns:sites="http://schemas.google.com/sites/2008"
    xmlns:gs="http://schemas.google.com/spreadsheets/2006" xmlns:dc="http://purl.org/dc/terms"
    xmlns:batch="http://schemas.google.com/gdata/batch" xmlns:gd="http://schemas.google.com/g/2005"
    xmlns:thr="http://purl.org/syndication/thread/1.0">
<id>https://sites.google.com/feeds/site/site</id>
<updated>2009-12-02T17:47:34.406Z</updated>
<title>Site</title>
<link rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml"
    href="https://sites.google.com/feeds/site/site"/>
<link rel="http://schemas.google.com/g/2005#post" type="application/atom+xml"
    href="https://sites.google.com/feeds/feeds/site/domainName"/>
<link rel="self" type="application/atom+xml" href="https://sites.google.com/feeds/site/domainName"/>
<link rel="next" type="application/atom+xml" href="https://sites.google.com/feeds/site/domainName/?start-index=2"/>
<generator version="1" uri="http://sites.google.com/">Google Sites</generator>
<openSearch:startIndex>1</openSearch:startIndex>
<entry gd:etag="W/&quot;CkUAQH4_eil7I2A9WxNaFk4.&quot;">
  <id>https://sites.google.com/feeds/site/site/myTestSite</id>
  <updated>2009-12-01T01:17:21.042Z</updated>
  <app:edited xmlns:app="http://www.w3.org/2007/app">2009-12-01T01:17:21.042Z</app:edited>
  <title>myTestSite</title>
  <summary/>
  <link rel="alternate" type="text/html" href="http://sites.google.com/site/myTestSite/"/>
  <link rel="http://schemas.google.com/acl/2007#accessControlList" type="application/atom+xml"
      href="https://sites.google.com/feeds/acl/site/domainName/myTestSite"/>
  <link rel="self" type="application/atom+xml" href="https://sites.google.com/feeds/site/domainName/myTestSite"/>
  <link rel="edit" type="application/atom+xml" href="https://sites.google.com/feeds/site/domainName/myTestSite"/>
  <sites:siteName>myTestSite</sites:siteName>
  <sites:theme>default</sites:theme>
</entry>
<entry gd:etag="W/&quot;DkQGQHczfA9WxNaFk4.&quot;">
  <id>https://sites.google.com/feeds/site/domainName/myOtherTestSite</id>
  <updated>2009-12-01T02:25:21.987Z</updated>
  <app:edited xmlns:app="http://www.w3.org/2007/app">2009-12-01T02:25:21.987Z</app:edited>
  <title>myOtherTestSite</title>
  <summary>A new site to hold memories</summary>
  <category scheme="http://schemas.google.com/sites/2008#tag" term="Memories Site"/>
  <link rel="alternate" type="text/html" href="http://sites.google.com/site/myOtherTestSite"/>
  <link rel="http://schemas.google.com/acl/2007#accessControlList" type="application/atom+xml"
      href="https://sites.google.com/feeds/acl/site/domainName/myOtherTestSite"/>
  <link rel="self" type="application/atom+xml" href="https://sites.google.com/feeds/site/domainName/myOtherTestSite"/>
  <link rel="edit" type="application/atom+xml" href="https://sites.google.com/feeds/site/domainName/myOtherTestSite"/>
  <sites:siteName>myOtherTestSite</sites:siteName>
  <sites:theme>iceberg</sites:theme>
</entry>
...
</feed>

사이트는 알파벳순으로 표시됩니다.

새 사이트 만들기

참고: 이 기능은 G Suite 도메인에서만 사용할 수 있습니다.

사이트 피드에 HTTP POST를 설정하여 새 사이트를 프로비저닝할 수 있습니다. 예를 들면 다음과 같습니다.

POST /feeds/site/example.com HTTP/1.1
Host: sites.google.com
GData-Version: 1.4
Authorization: <your authorization header here>

<entry xmlns="http://www.w3.org/2005/Atom" xmlns:sites="http://schemas.google.com/sites/2008">
  <title>Source Site</title>
  <summary>A new site to hold memories</summary>
  <sites:theme>slate</sites:theme>
</entry>

위 요청은 G Suite 도메인 example.com에 '슬레이트' 테마로 새 Google 사이트를 만듭니다. 사이트 URL은 http://sites.google.com/a/example.com/source-site/입니다.

사이트가 성공적으로 만들어지면 서버는 201 Created로 응답합니다. 응답 항목에는 사이트 링크, 사이트의 ACL 피드 링크, 사이트 이름, 제목, 요약과 같이 서버에서 추가한 요소가 포함됩니다.

<entry xmlns="http://www.w3.org/2005/Atom" xmlns:gAcl="http://schemas.google.com/acl/2007"
    xmlns:sites="http://schemas.google.com/sites/2008" xmlns:gs="http://schemas.google.com/spreadsheets/2006"
    xmlns:dc="http://purl.org/dc/terms" xmlns:batch="http://schemas.google.com/gdata/batch"
    xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0"
    gd:etag="W/&quot;DEECR38l7I2A9WxNaF0Q.&quot;">
  <id>https://sites.google.com/feeds/site/example.com/source-site</id>
  <updated>2009-12-02T23:31:06.184Z</updated>
  <app:edited xmlns:app="http://www.w3.org/2007/app">2009-12-02T23:31:06.184Z</app:edited>
  <title>New Test Site</title>
  <summary>A new site to hold memories</summary>
  <link rel="alternate" type="text/html" href="http://sites.google.com/a/example.com/source-site/"/>
  <link rel="http://schemas.google.com/acl/2007#accessControlList" type="application/atom+xml"
      href="https://sites.google.com/feeds/acl/site/example.com/source-site"/>
  <link rel="self" type="application/atom+xml" href="https://sites.google.com/feeds/site/example.com/source-site"/>
  <link rel="edit" type="application/atom+xml" href="https://sites.google.com/feeds/site/example.com/source-site"/>
  <sites:siteName>source-site</sites:siteName>
  <sites:theme>slate</sites:theme>
</entry>

사이트 복사

참고: 이 기능은 G Suite 도메인에서만 사용할 수 있습니다.

새 사이트를 만드는 것과 동일한 방식으로 기존 사이트를 복제할 수 있습니다. 그러나 POST 요청의 Atom 항목에는 복사할 사이트의 사이트 피드를 가리키는 rel='source'와 함께 <link>를 포함합니다. 복사된 모든 사이트에 이 링크가 있습니다. 다음은 사이트를 복제하는 예입니다.

POST /feeds/site/example.com HTTP/1.1
Host: sites.google.com
GData-Version: 1.4
Authorization: <your authorization header here>

<entry xmlns="http://www.w3.org/2005/Atom">
  <link rel="http://schemas.google.com/sites/2008#source" type="application/atom+xml"
      href="https://sites.google.com/feeds/site/example.com/source-site"/>
  <title>Copy of New Test Site</title>
  <summary>A newer site to hold memories</summary>
</entry>

위 요청은 http://sites.google.com/a/example.com/source-site/에 사이트를 복사합니다.

중요사항:

  • 인증된 사용자가 소유한 사이트 및 사이트 템플릿만 복사할 수 있습니다.
  • 사이트 템플릿도 복사할 수 있습니다. Google Sites 설정 페이지에서 '이 사이트를 템플릿으로 게시' 설정이 선택된 경우 사이트는 템플릿입니다.
  • 내가 원본 사이트에 소유자로 표시될 때까지 다른 도메인에서 사이트를 복사할 수 있습니다.

사이트의 메타데이터 업데이트

사이트의 제목이나 요약을 업데이트하려면 사이트 항목의 edit 링크에 HTTP PUT를 전송합니다. 예를 들어 다음 예는 이전 사이트의 제목을 New Test Site2로, 설명을 Newer description로 업데이트합니다.

PUT /feeds/site/example.com/source-site HTTP/1.1
Host: sites.google.com
GData-Version: 1.4
Authorization: <your authorization header here>

<entry xmlns="http://www.w3.org/2005/Atom" xmlns:gAcl="http://schemas.google.com/acl/2007"
    xmlns:sites="http://schemas.google.com/sites/2008" xmlns:gs="http://schemas.google.com/spreadsheets/2006"
    xmlns:dc="http://purl.org/dc/terms" xmlns:batch="http://schemas.google.com/gdata/batch"
    xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0"
    gd:etag="W/&quot;DEECR38l7I2A9WxNaF0Q.&quot;">
  <id>https://sites.google.com/feeds/site/example.com/source-site</id>
  <updated>2009-12-02T23:31:06.184Z</updated>
  <app:edited xmlns:app="http://www.w3.org/2007/app">2009-12-02T23:31:06.184Z</app:edited>
  <title>New Test Site2</title>
  <summary>Newer description</summary>
  <category scheme="http://schemas.google.com/sites/2008#tag" term="Category"/>
  <link rel="alternate" type="text/html" href="http://sites.google.com/a/example.com/source-site/"/>
  <link rel="http://schemas.google.com/acl/2007#accessControlList" type="application/atom+xml"
      href="https://sites.google.com/feeds/acl/site/example.com/source-site"/>
  <link rel="self" type="application/atom+xml" href="https://sites.google.com/feeds/site/example.com/source-site"/>
  <link rel="edit" type="application/atom+xml" href="https://sites.google.com/feeds/site/example.com/source-site"/>
  <sites:siteName>source-site</sites:siteName>
</entry>

카테고리 추가

참고: 이 기능은 G Suite 도메인에서만 사용할 수 있습니다.

도메인용 G Suite 사이트에는 도메인 내의 사이트를 분류하는 데 유용한 카테고리 메타데이터가 포함되어 있습니다. 카테고리 메타데이터를 추가하거나 업데이트하려면 category 태그가 포함된 HTTP PUT를 사이트 항목의 edit 링크로 전송합니다. 다음 예에서 굵게 표시된 선을 참고하세요.

PUT /feeds/site/example.com/source-site HTTP/1.1
Host: sites.google.com
GData-Version: 1.4
Authorization: <your authorization header here>

<entry xmlns="http://www.w3.org/2005/Atom" xmlns:gAcl="http://schemas.google.com/acl/2007"
    xmlns:sites="http://schemas.google.com/sites/2008" xmlns:gs="http://schemas.google.com/spreadsheets/2006"
    xmlns:dc="http://purl.org/dc/terms" xmlns:batch="http://schemas.google.com/gdata/batch"
    xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0"
    gd:etag="W/&quot;DEECR38l7I2A9WxNaF0Q.&quot;">
  <id>https://sites.google.com/feeds/site/example.com/source-site</id>
  <updated>2009-12-02T23:31:06.184Z</updated>
  <app:edited xmlns:app="http://www.w3.org/2007/app">2009-12-02T23:31:06.184Z</app:edited>
  <title>My Team website</title>
  <summary>This site contains contact information and a summary of major efforts our team owns</summary>
  <category scheme="http://schemas.google.com/sites/2008#tag" term="Team Site"/>
  <link rel="alternate" type="text/html" href="http://sites.google.com/a/example.com/my-team-site/"/>
  <link rel="http://schemas.google.com/acl/2007#accessControlList" type="application/atom+xml"
      href="https://sites.google.com/feeds/acl/site/example.com/my-team-site"/>
  <link rel="self" type="application/atom+xml" href="https://sites.google.com/feeds/site/example.com/my-team-site"/>
  <link rel="edit" type="application/atom+xml" href="https://sites.google.com/feeds/site/example.com/my-team-site"/>
  <sites:siteName>my-team-site</sites:siteName>
</entry>

이 예에서는 기존 사이트를 편집하고 '팀 사이트' 카테고리를 추가합니다.

<category> 태그를 추가하여 여러 개의 카테고리를 추가할 수도 있습니다. 다음 예에서 굵게 표시된 부분을 참고하세요.

PUT /feeds/site/example.com/my-team-site HTTP/1.1
Host: sites.google.com
GData-Version: 1.4
Authorization: <your authorization header here>

<entry xmlns="http://www.w3.org/2005/Atom" xmlns:gAcl="http://schemas.google.com/acl/2007"
    xmlns:sites="http://schemas.google.com/sites/2008" xmlns:gs="http://schemas.google.com/spreadsheets/2006"
    xmlns:dc="http://purl.org/dc/terms" xmlns:batch="http://schemas.google.com/gdata/batch"
    xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0"
    gd:etag="W/&quot;DEECR38l7I2A9WxNaF0Q.&quot;">
  <id>https://sites.google.com/feeds/site/example.com/my-team-site</id>
  <updated>2009-12-02T23:31:06.184Z</updated>
  <app:edited xmlns:app="http://www.w3.org/2007/app">2009-12-02T23:31:06.184Z</app:edited>
  <title>My Team website</title>
  <summary>This site contains contact information and a summary of major efforts our team owns</summary>
  <category scheme="http://schemas.google.com/sites/2008#tag" term="Team Site/">
  <category scheme="http://schemas.google.com/sites/2008#tag" term="Legal Department/">
  <link rel="alternate" type="text/html" href="http://sites.google.com/a/example.com/my-team-site/"/>
  <link rel="http://schemas.google.com/acl/2007#accessControlList" type="application/atom+xml"
      href="https://sites.google.com/feeds/acl/site/example.com/my-team-site"/>
  <link rel="self" type="application/atom+xml" href="https://sites.google.com/feeds/site/example.com/my-team-site"/>
  <link rel="edit" type="application/atom+xml" href="https://sites.google.com/feeds/site/example.com/my-team-site"/>
  <sites:siteName>my-team-site</sites:siteName>
</entry>

이 예에서는 '팀 사이트'와 '법무 부서'라는 두 개의 카테고리를 추가합니다.

웹 주소 매핑

Sites 사용자는 웹 주소 매핑을 통해 자신의 도메인을 Google Sites로 만든 사이트에 매핑할 수 있습니다. 예를 들어 http://sites.google.com/a/domain.com/mysite 대신 http://www.mydomainsite.com를 사용할 수 있습니다. 사이트가 호스팅되는 위치에 따라 사이트의 웹 주소 매핑을 수동으로 수정할 수 있습니다. 자세한 내용은 고객센터 도움말을 참고하세요.

사이트의 웹 주소 매핑 가져오기

사이트의 웹 주소 매핑을 반환하려면 with-mappings=true 매개변수를 사용하여 사이트 항목/피드를 가져오세요.

GET /feeds/site/domainName?with-mappings=true HTTP/1.1
Host: sites.google.com
GData-Version: 1.4
Authorization: <your authorization header here>

HTTP/1.1 200 OK

<feed xmlns="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/"
    xmlns:gAcl="http://schemas.google.com/acl/2007" xmlns:sites="http://schemas.google.com/sites/2008"
    xmlns:gs="http://schemas.google.com/spreadsheets/2006" xmlns:dc="http://purl.org/dc/terms"
    xmlns:batch="http://schemas.google.com/gdata/batch" xmlns:gd="http://schemas.google.com/g/2005"
    xmlns:thr="http://purl.org/syndication/thread/1.0">
...
<entry gd:etag="W/&quot;DkQGQHczfA9WxNaFk4.&quot;">
  <id>https://sites.google.com/feeds/site/domainName/myOtherTestSite</id>
  <updated>2009-12-01T02:25:21.987Z</updated>
  <app:edited xmlns:app="http://www.w3.org/2007/app">2009-12-01T02:25:21.987Z</app:edited>
  <title>myOtherTestSite</title>
  <summary>A new site to hold memories</summary>
  <link rel="alternate" type="text/html" href="http://sites.google.com/site/myOtherTestSite"/>
  <link rel="http://schemas.google.com/acl/2007#accessControlList" type="application/atom+xml"
      href="https://sites.google.com/feeds/acl/site/domainName/myOtherTestSite"/>
  <link rel="self" type="application/atom+xml" href="https://sites.google.com/feeds/site/domainName/myOtherTestSite"/>
  <link rel="edit" type="application/atom+xml" href="https://sites.google.com/feeds/site/domainName/myOtherTestSite"/>
  <link rel='webAddressMapping' href='http://www.mysitemapping.com'>
  <link rel='webAddressMapping' href='http://www.mysitemapping2.com'>
  <link rel='webAddressMapping' href='http://www.myothermapping.org'>
</entry>
...
</feed>

기존 매핑은 rel='webAddressMapping'을 포함하는 link로 표시됩니다. 예를 들어 위 예에는 http://sites.google.com/site/myOtherTestSite 사이트를 가리키는 webAddressMapping가 3개 있습니다.

웹 주소 매핑 수정

참고: 모든 GET/POST/PUT 작업은 웹 주소 매핑 작업 시 with-mappings=true 매개변수를 지정해야 합니다. 매개변수가 없으면 webAddressMapping이 사이트 항목 (GET)에 반환되지 않거나 항목에서 매핑을 업데이트/삭제 (PUT)할 때 고려되지 않습니다.

매핑을 추가, 업데이트 또는 삭제하려면 새 사이트를 만들거나 사이트의 메타데이터를 업데이트할 때 이러한 링크를 지정, 변경 또는 삭제하면 됩니다. with-mappings=true 매개변수가 사이트 피드 URI에 포함되어야 합니다. 참고: 주소 매핑을 업데이트하려면 사이트 관리자여야 하며, G Suite에서 호스팅되는 사이트의 경우 도메인 관리자여야 합니다.

예를 들어 아래 요청은 http://www.mysitemapping.com 매핑을 http://www.my-new-sitemapping.com로 업데이트하고 항목에서 링크를 삭제하여 http://www.mysitemapping2.com를 삭제합니다.

PUT /feeds/site/domainName?with-mappings=true HTTP/1.1
Host: sites.google.com
GData-Version: 1.4
Authorization: <your authorization header here>

<entry gd:etag="W/&quot;DkQGQHczfA9WxNaFk4.&quot;">
  <id>https://sites.google.com/feeds/site/domainName/myOtherTestSite</id>
  <updated>2009-12-01T02:25:21.987Z</updated>
  <app:edited xmlns:app="http://www.w3.org/2007/app">2009-12-01T02:25:21.987Z</app:edited>
  <title>myOtherTestSite</title>
  <summary>A new site to hold memories</summary>
  <link rel="alternate" type="text/html" href="http://sites.google.com/site/myOtherTestSite"/>
  <link rel="http://schemas.google.com/acl/2007#accessControlList" type="application/atom+xml"
      href="https://sites.google.com/feeds/acl/site/domainName/myOtherTestSite"/>
  <link rel="self" type="application/atom+xml" href="https://sites.google.com/feeds/site/domainName/myOtherTestSite"/>
  <link rel="edit" type="application/atom+xml" href="https://sites.google.com/feeds/site/domainName/myOtherTestSite"/>
  <link rel='webAddressMapping' href='www.my-new-sitemapping.com'>
  <!-- missing mapping2 will be deleted -->
  <link rel='webAddressMapping' href='http://www.myothermapping.org'>
</entry>

사이트를 만들거나 복사할 때 웹 주소 매핑을 지정할 수도 있습니다.

맨 위로

활동 피드

활동 피드를 가져와 사이트의 최근 활동 (변경사항)을 가져올 수 있습니다. 활동 피드의 각 항목에는 사이트의 변경사항에 관한 정보가 포함됩니다.

활동 피드를 쿼리하려면 활동 피드 URL에 HTTP GET를 전송합니다.

https://sites.google.com/feeds/activity/domainName/siteName
피드 매개변수설명
domainName'site' 또는 G Suite 호스팅 도메인의 도메인 (예: example.com)입니다.
siteName사이트의 웹 공간 이름으로 사이트의 URL에서 찾을 수 있습니다 (예: myCoolSite).

요청 및 응답의 예:

GET /feeds/activity/site/siteName HTTP/1.1
Host: sites.google.com
GData-Version: 1.4
Authorization: <your authorization header here>

HTTP/1.1 200 OK

<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/">
<id>https://sites.google.com/feeds/activity/site/siteName</id>
<updated>2009-09-10T05:24:23.120Z</updated>
<title>Activity</title>
<link rel="alternate" type="text/html" href="http://sites.google.com/site/siteName/system/app/pages/recentChanges"/>
<link rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml"
  href="https://sites.google.com/feeds/activity/site/siteName"/>
<link rel="self" type="application/atom+xml"
  href="https://sites.google.com/feeds/activity/site/siteName"/>
<generator version="1" uri="http://sites.google.com">Google Sites</generator>
<openSearch:startIndex>1</openSearch:startIndex>
<entry xmlns:gd="http://schemas.google.com/g/2005" gd:etag="W/&quot;CU4GQ3szfSl7ImA9WxNRFUg.&quot;">
<id>https://sites.google.com/feeds/activity/site/siteName/940375996952876062</id>
<updated>2009-09-10T03:38:42.585Z</updated>
<category scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/sites/2008#deletion" label="deletion"/>
<title>home</title>
<summary type="xhtml">
  <div xmlns="http://www.w3.org/1999/xhtml">User deleted <a href="http://sites.google.com/site/siteName/home">home</a>
</div>
</summary>
<link rel="http://schemas.google.com/sites/2008#revision" type="application/atom+xml"
  href="https://sites.google.com/feeds/revision/site/siteName/5409745539831916487"/>
<link rel="http://schemas.google.com/sites/2008#current" type="application/atom+xml"
  href="https://sites.google.com/feeds/content/site/siteName/5409745539831916487"/>
<link rel="self" type="application/atom+xml"
  href="https://sites.google.com/feeds/activity/site/siteName/940375996952876062"/>
<author>
  <name>User</name>
  <email>user@gmail.com</email>
</author>
</entry>
<entry xmlns:gd="http://schemas.google.com/g/2005" gd:etag="W/&quot;CU8DQn45fyl7ImA9WxNRFUg.&quot;">
  <id>https://sites.google.com/feeds/activity/site/siteName/7165439066235480082</id>
  <updated>2009-09-10T03:37:53.027Z</updated>
  <category scheme="http://schemas.google.com/g/2005#kind"
    term="http://schemas.google.com/sites/2008#edit" label="edit"/>
  <title>home</title>
  <summary type="xhtml">
    <div xmlns="http://www.w3.org/1999/xhtml">User2 edited <a href="http://sites.google.com/site/siteName/home">home</a>
  </div>
  </summary>
  <link rel="http://schemas.google.com/sites/2008#revision" type="application/atom+xml"
    href="https://sites.google.com/feeds/revision/site/siteName/5409745539831916487"/>
  <link rel="http://schemas.google.com/sites/2008#current" type="application/atom+xml"
    href="https://sites.google.com/feeds/content/site/siteName/5409745539831916487"/>
  <link rel="self" type="application/atom+xml"
    href="https://sites.google.com/feeds/activity/site/siteName/7165439066235480082"/>
  <author>
    <name>User</name>
    <email>user@gmail.com</email>
  </author>
</entry>
<entry xmlns:gd="http://schemas.google.com/g/2005" gd:etag="W/&quot;CU8AR3s4cSl7ImA9WxNRFUg.&quot;">
  <id>https://sites.google.com/feeds/activity/site/siteName/127448462987345884</id>
  <updated>2009-09-10T03:37:26.539Z</updated>
  <category scheme="http://schemas.google.com/g/2005#kind"
    term="http://schemas.google.com/sites/2008#creation" label="creation"/>
  <title>home</title>
  <summary type="xhtml">
    <div xmlns="http://www.w3.org/1999/xhtml">User3 created <a href="http://sites.google.com/site/siteName/home">home</a>
  </div>
  </summary>
  <link rel="http://schemas.google.com/sites/2008#revision" type="application/atom+xml"
    href="https://sites.google.com/feeds/revision/site/siteName/5409745539831916487"/>
  <link rel="http://schemas.google.com/sites/2008#current" type="application/atom+xml"
    href="https://sites.google.com/feeds/content/site/siteName/5409745539831916487"/>
  <link rel="self" type="application/atom+xml"
    href="https://sites.google.com/feeds/activity/site/siteName/127448462987345884"/>
  <author>
    <name>User3</name>
    <email>user3@gmail.com</email>
  </author>
</entry>
</feed>

참고: 이 피드에 액세스하려면 사이트의 공동작업자 또는 소유자여야 합니다. 클라이언트는 올바른 Authorization 헤더를 전송하고 요청 승인에서 얻은 토큰을 참조해야 합니다.

맨 위로

버전 피드

콘텐츠 항목의 업데이트 기록을 가져오려면 항목의 버전 링크에 HTTP GET를 전송합니다.

https://sites.google.com/feeds/revision/domainName/siteName/CONTENT_ENTRY_ID
피드 매개변수설명
domainName'site' 또는 G Suite 호스팅 도메인의 도메인 (예: example.com)입니다.
siteName사이트의 웹 공간 이름으로 사이트의 URL에서 찾을 수 있습니다 (예: myCoolSite).

특정 페이지/댓글/첨부파일/목록 항목의 버전 링크를 찾으려면 먼저 CONTENT_ENTRY_ID를 사용하여 콘텐츠 피드에서 항목을 검색합니다. 가져온 항목에는 버전 피드에 대한 <atom:link>가 포함됩니다. 예를 들면 다음과 같습니다.

<link rel="http://schemas.google.com/sites/2008#revision" type="application/atom+xml"
    href="https://sites.google.com/feeds/revision/domainName/siteName/CONTENT_ENTRY_ID"/>

요청 및 응답의 예:

GET /feeds/revision/domainName/siteName/CONTENT_ENTRY_ID HTTP/1.1
Host: sites.google.com
GData-Version: 1.4
Authorization: <your authorization header here>

HTTP/1.1 200 OK

<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/"
    xmlns:sites="http://schemas.google.com/sites/2008" xmlns:gs="http://schemas.google.com/spreadsheets/2006"
    xmlns:dc="http://purl.org/dc/terms" xmlns:batch="http://schemas.google.com/gdata/batch"
    xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0">
<id>https://sites.google.com/feeds/revision/domainName/siteName/CONTENT_ENTRY_ID</id>
<updated>2009-09-10T04:33:35.337Z</updated>
<title>Revisions</title>
<link rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml"
    href="https://sites.google.com/feeds/revision/domainName/siteName/CONTENT_ENTRY_ID"/>
<link rel="self" type="application/atom+xml"
    href="https://sites.google.com/feeds/revision/domainName/siteName/CONTENT_ENTRY_ID"/>
<generator version="1" uri="http://sites.google.com">Google Sites</generator>
<openSearch:startIndex>1</openSearch:startIndex>
<entry gd:etag="W/&quot;CU4GQmA9WxNRFUg.&quot;">
  <id>https://sites.google.com/feeds/revision/domainName/siteName/CONTENT_ENTRY_ID/2</id>
  <updated>2009-09-10T03:38:42.045Z</updated>
  <category scheme="http://schemas.google.com/g/2005#kind"
      term="http://schemas.google.com/sites/2008#webpage" label="webpage"/>
  <title>Home</title>
  <content type="xhtml">
    <div xmlns="http://www.w3.org/1999/xhtml">Latest content here</div>
  </content>
  <link rel="alternate" type="text/html"
    href="http://sites.google.com/domainName/siteName/CONTENT_ENTRY_ID/system/app/pages/admin/compare?wuid=wuid%3Agx%3A4f67c7&amp;rev1=2"/>
  <link rel="self" type="application/atom+xml" href="https://sites.google.com/feeds/revision/domainName/siteName/CONTENT_ENTRY_ID/2"/>
  <author>
    <name>User</name>
    <email>user@gmail.com</email>
  </author>
  <sites:pageName>home</sites:pageName>
  <sites:revision>2</sites:revision>
</entry>
<entry gd:etag="W/&quot;CU8DQ388eSl7ImA9WxNRFUg.&quot;">
  <id>https://sites.google.com/feeds/revision/domainName/siteName/CONTENT_ENTRY_ID/1</id>
  <updated>2009-09-10T03:37:52.171Z</updated>
  <category scheme="http://schemas.google.com/g/2005#kind"
      term="http://schemas.google.com/sites/2008#webpage" label="webpage"/>
  <title>Home</title>
  <content type="xhtml">
    <div xmlns="http://www.w3.org/1999/xhtml">Older content here</div>
  </content>
  <link rel="alternate" type="text/html"
    href="http://sites.google.com/domainName/siteName/CONTENT_ENTRY_ID/system/app/pages/admin/compare?wuid=wuid%3Agx%3A4bc7&amp;rev1=1"/>
  <link rel="self" type="application/atom+xml"
    href="https://sites.google.com/feeds/revision/domainName/siteName/CONTENT_ENTRY_ID/1"/>
  <author>
    <name>User</name>
    <email>user@gmail.com</email>
  </author>
  <sites:pageName>home</sites:pageName>
  <sites:revision>1</sites:revision>
</entry>
</feed>

참고: 이 피드에 액세스하려면 사이트의 공동작업자 또는 소유자여야 합니다. 클라이언트는 올바른 Authorization 헤더를 전송하고 요청 승인에서 얻은 토큰을 참조해야 합니다.

맨 위로

콘텐츠 피드

콘텐츠 가져오기

콘텐츠 피드에는 사이트의 현재 콘텐츠가 표시됩니다. 인증된 GET 요청을 다음 URL로 전송합니다.

https://sites.google.com/feeds/content/domainName/siteName
피드 매개변수설명
domainName'site' 또는 G Suite 호스팅 도메인의 도메인 (예: example.com)입니다.
siteName사이트의 웹 공간 이름으로 사이트의 URL에서 찾을 수 있습니다 (예: myCoolSite).

그 결과 사이트에 있는 콘텐츠 항목의 첫 페이지를 나열하는 피드가 생성됩니다. 피드의 각 항목은 webpage, filecabinet, attachment, comment 등 서로 다른 유형의 콘텐츠 항목을 나타냅니다. <category scheme="http://schemas.google.com/g/2005#kind"> 요소가 항목 유형을 결정합니다. 지원 kind 값 목록은 참조 가이드를 참고하세요.

참고: 이 피드는 사이트의 공유 권한에 따라 인증이 필요할 수도 있고 필요하지 않을 수도 있습니다. 비공개 사이트인 경우 클라이언트는 올바른 Authorization 헤더 (위 예 참조)를 전송하고 요청 승인에서 획득한 토큰을 참조해야 합니다.

GET /feeds/content/domainName/siteName HTTP/1.1
Host: sites.google.com
GData-Version: 1.4
Authorization: <your authorization header here>

HTTP/1.1 200 OK

<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/"
  xmlns:sites="http://schemas.google.com/sites/2008" xmlns:gs="http://schemas.google.com/spreadsheets/2006"
  xmlns:dc="http://purl.org/dc/terms" xmlns:batch="http://schemas.google.com/gdata/batch"
  xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0">
<id>https://sites.google.com/feeds/content/domainName/siteName</id>
<updated>2009-08-31T01:39:20.286Z</updated>
<title>Content</title>
<link rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml"
    href="https://sites.google.com/feeds/content/domainName/siteName"/>
<link rel="http://schemas.google.com/g/2005#post" type="application/atom+xml"
    href="https://sites.google.com/feeds/content/domainName/siteName"/>
<link rel="self" type="application/atom+xml"
    href="https://sites.google.com/feeds/content/domainName/siteName"/>
<link rel="http://schemas.google.com/g/2005#batch" type="application/atom+xml"
    href="https://sites.google.com/feeds/content/domainName/siteName/batch""/>
<link rel="next" type="application/atom+xml" href="https://sites.google.com/feeds/content/domainName/siteName/?start-index=2"/>
<generator version="1" uri="http://sites.google.com">Google Sites</generator>
<openSearch:startIndex>1</openSearch:startIndex>
<entry gd:etag="W/&quot;Ck8GQXk7fil7ImA9WxNSFk0.&quot;">
  <id>https://sites.google.com/feeds/content/domainName/siteName/7322156894</id>
  <updated>2009-08-30T02:53:40.706Z</updated>
  <app:edited xmlns:app="http://www.w3.org/2007/app">2009-08-30T02:53:40.706Z</app:edited>
  <category scheme="http://schemas.google.com/g/2005#kind"
      term="http://schemas.google.com/sites/2008#webpage" label="webpage"/>
  <title>Subpage</title>
  <content type="xhtml">
    <div xmlns="http://www.w3.org/1999/xhtml">Page html content here</div>
  </content>
  <link rel="http://schemas.google.com/sites/2008#parent" type="application/atom+xml"
      href="https://sites.google.com/feeds/content/domainName/siteName/6492205817"/>
  <link rel="alternate" type="text"
      href="http://sites.google.com/site/siteName/subpage"/>
  <link rel="http://schemas.google.com/sites/2008#revision" type="application/atom+xml"
      href="https://sites.google.com/feeds/revision/domainName/siteName/7322156894"/>
  <link rel="self" type="application/atom+xml"
      href="https://sites.google.com/feeds/content/domainName/siteName/7322156894"/>
  <link rel="edit" type="application/atom+xml"
      href="https://sites.google.com/feeds/content/domainName/siteName/7322156894"/>
  <author>
    <name>User</name>
    <email>user@gmail.com</email>
  </author>
  <sites:pageName>subpage</sites:pageName>
  <sites:revision>5</sites:revision>
</entry>
<entry gd:etag="W/&quot;CkMBQH08fCl7ImA9WxNSFk0.&quot;">
  <id>https://sites.google.com/feeds/content/domainName/siteName/5930635231</id>
  <updated>2009-08-30T02:47:31.374Z</updated>
  <app:edited xmlns:app="http://www.w3.org/2007/app">2009-08-30T02:47:31.374Z</app:edited>
  <category scheme="http://schemas.google.com/g/2005#kind"
      term="http://schemas.google.com/sites/2008#listitem" label="listpage"/>
  <title/>
  <link rel="http://schemas.google.com/sites/2008#parent" type="application/atom+xml"
      href="https://sites.google.com/feeds/content/domainName/siteName/5930635231"/>
  <link rel="http://schemas.google.com/sites/2008#revision" type="application/atom+xml"
      href="https://sites.google.com/feeds/revision/domainName/siteName/5930635231"/>
  <link rel="self" type="application/atom+xml"
      href="https://sites.google.com/feeds/content/domainName/siteName/5930635231"/>
  <link rel="edit" type="application/atom+xml"
      href="https://sites.google.com/feeds/content/domainName/siteName/5930635231"/>
  <author>
    <name>User</name>
    <email>user@gmail.com</email>
  </author>
  <sites:revision>1</sites:revision>
  <gs:field index="A" name="Issue/Feature">Implement cool feature X</gs:field>
  <gs:field index="B" name="Priority">P2</gs:field>
  <gs:field index="C" name="Owner"/>
  <gs:field index="D" name="Resolved"/>
</entry>
<entry gd:etag="W/&quot;AkYHQ3ozcCl7ImA9WxJaE08.&quot;">
  <id>https://sites.google.com/feeds/content/domainName/siteName/1265948545471894517</id>
  <updated>2009-08-03T19:35:32.488Z</updated>
  <app:edited xmlns:app="http://www.w3.org/2007/app">2009-08-03T19:35:32.488Z</app:edited>
  <category scheme="http://schemas.google.com/g/2005#kind"
      term="http://schemas.google.com/sites/2008#filecabinet" label="filecabinet"/>
  <title>files</title>
  <content type="xhtml">
    <div xmlns="http://www.w3.org/1999/xhtml">Page html content here</div>
  </content>
  <link rel="alternate" type="text"
      href="https://sites.google.com/domainName/siteName/files"/>
  <link rel="http://schemas.google.com/sites/2008#revision" type="application/atom+xml"
      href="https://sites.google.com/feeds/revision/domainName/siteName/12671894517"/>
  <link rel="self" type="application/atom+xml"
      href="https://sites.google.com/feeds/content/domainName/siteName/12671894517"/>
  <link rel="edit" type="application/atom+xml"
      href="https://sites.google.com/feeds/content/domainName/siteName/12671894517"/>
  <author>
    <name>User</name>
    <email>user@gmail.com</email>
  </author>
  <gd:feedLink href="httpn://sites.google.com/feeds/content/domainName/siteName?parent=12671894517"/>
  <sites:pageName>files</sites:pageName>
  <sites:revision>1</sites:revision>
</entry>
...
</feed>

참고: 이것은 처음 몇 개의 결과일 뿐입니다. 전체 콘텐츠 피드에서 페이지를 살펴보려면 피드의 '다음' 링크를 따라가세요.

<link rel="next" type="application/atom+xml" href="https://sites.google.com/feeds/content/domainName/siteName/?start-index=2"/>

Atom의 공통 요소에 대한 설명은 Google 데이터 프로토콜 참조를 확인하세요. 기존 Sites API에 대한 특정 측정을 포함하는 요소는 아래에 설명되어 있습니다. 특정 종류 항목에는 추가 속성 (아래 나열되지 않음)이 있지만 추가 속성이 없는 종류도 있습니다. 예를 들어 listitem 항목에는 <gs:field> 요소가 있을 수 있지만 webpage 항목에는 없습니다.

요소설명
<content ...>내부 텍스트는 페이지의 HTML 본문입니다. 첨부파일과 같은 일부 항목의 경우 이 요소에 파일을 가리키는 src 속성이 포함됩니다.
<link rel="alternate" ...>Google Sites의 페이지 또는 항목으로 연결되는 링크입니다.
<link rel="http://schemas.google.com/sites/2008#revision" ...>href 속성은 항목의 버전 피드를 가리킵니다.
<link rel="http://schemas.google.com/sites/2008#parent" ...>href 속성은 항목의 상위 항목을 가리킵니다.
<link rel="http://schemas.google.com/sites/2008#template" ...>href 속성은 항목의 템플릿 페이지를 가리킵니다.
<category scheme="http://schemas.google.com/g/2005#kind" ...>label은 항목 유형입니다.
<category term="http://schemas.google.com/g/2005#template" ...>label=template는 항목이 템플릿임을 나타냅니다.
<gd:feedLink>href 속성은 항목의 상위 요소를 가리킵니다.
<sites:pageName>페이지의 웹스페이스 이름으로, 페이지 URL의 이름에 해당합니다.
<sites:revision>현재 버전 번호입니다.

콘텐츠 피드 쿼리 예

일부 표준 Google Data API 쿼리 매개변수와 기존 Sites API 전용의 매개변수를 사용하여 콘텐츠 피드를 검색할 수 있습니다. 자세한 내용과 지원되는 매개변수의 전체 목록은 참조 가이드를 확인하세요.

특정 항목 종류 검색

특정 유형의 항목만 가져오려면 kind 매개변수를 사용하세요. 이 예시에서는 webpage 항목만 반환합니다.

GET /feeds/content/domainName/siteName?kind=webpage

항목 유형을 두 개 이상 반환하려면 각 kind을 ','로 구분하세요. 이 예시에서는 filecabinetlistpage 항목을 반환합니다.

GET /feeds/content/domainName/siteName?kind=filecabinet,listpage

또는 kind 매개변수 대신 Google 데이터 /-/category 쿼리에 표준 형식을 사용할 수 있습니다.

GET /feeds/content/domainName/siteName/-/filecabinet|listpage

페이지 템플릿 검색

이 예에서는 template페이지만 반환합니다.

GET /feeds/content/domainName/siteName/-/template

모든 항목 유형을 반환하고 template 페이지를 포함하려면 다음을 사용합니다.

GET /feeds/content/domainName/siteName/-/template|-template

경로로 페이지 가져오기

Google 사이트 내 페이지의 상대 경로를 알고 있는 경우 path 매개변수를 사용하여 특정 페이지를 가져올 수 있습니다. 이 예에서는 http://sites.google.com/site/siteName/path/to/the/page에 있는 페이지를 반환합니다.

GET /feeds/content/domainName/siteName?path=/path/to/the/page

상위 페이지에 있는 모든 항목 검색

페이지의 항목 ID를 알고 있으면 parent 매개변수를 사용하여 모든 하위 항목 (있는 경우)을 가져올 수 있습니다.

GET /feeds/content/domainName/siteName?parent=CONTENT_ENTRY_ID

초안 또는 삭제된 항목 포함

초안 또는 삭제된 항목을 포함하려면 각각 include-drafts 또는 include-deleted 매개변수를 사용합니다. 이 예에는 콘텐츠 피드의 초안 항목이 포함됩니다.

GET /feeds/content/domainName/siteName?include-drafts=true

전체 텍스트 검색

사이트의 전체 콘텐츠를 검색하려면 q 매개변수를 사용하여 전체 텍스트 검색을 실행합니다.

GET /feeds/content/domainName/siteName?q=Text%20I%20am%20looking%20for

맨 위로



콘텐츠 제작

새 콘텐츠 (웹페이지, 목록 페이지, 자료실 페이지, 공지사항 페이지 등)는 콘텐츠 피드에 HTTP POST를 전송하여 만들 수 있습니다.

https://sites.google.com/feeds/content/domainName/siteName

지원되는 항목 유형 목록은 참조 가이드kind 매개변수를 확인하세요.

새 항목 / 페이지 만들기

이 예에서는 사이트의 최상위 수준 아래에 새 webpage를 만들고 페이지 본문을 위한 일부 XHTML을 포함하며 제목 제목을 '새 웹페이지 제목'으로 설정합니다.

POST /feeds/content/domainName/siteName HTTP/1.1
Host: sites.google.com
GData-Version: 1.4
Authorization: <your authorization header here>
Content-Length: 328
Content-Type: application/atom+xml

<entry xmlns="http://www.w3.org/2005/Atom">
  <category scheme="http://schemas.google.com/g/2005#kind"
      term="http://schemas.google.com/sites/2008#webpage" label="webpage"/>
  <title>New Webpage Title</title>
  <content type="xhtml">
    <div xmlns="http://www.w3.org/1999/xhtml">HTML body goes here</div>
  </content>
</entry>

성공하면 서버에서 201 Created 및 항목 사본을 반환합니다.

맞춤 URL 경로에 항목/페이지 만들기

기본적으로 이전 예시는 URL http://sites.google.com/domainName/siteName/new-webpage-title로 생성되고 페이지 제목은 '새 웹페이지 제목'입니다. 즉, URL의 <atom:title>new-webpage-title로 정규화됩니다. 페이지의 URL 경로를 맞춤설정하려면 <sites:pageName> 요소를 설정하면 됩니다.

이 예에서는 페이지 제목이 'File Storage'인 새 filecabinet를 만들되 <sites:pageName> 요소를 지정하여 URL http://sites.google.com/domainName/siteName/files 아래에 페이지를 만듭니다.

POST /feeds/content/domainName/siteName HTTP/1.1
Host: sites.google.com
GData-Version: 1.4
Authorization: <your authorization header here>
Content-Length: 393
Content-Type: application/atom+xml

<entry xmlns="http://www.w3.org/2005/Atom" xmlns:sites="http://schemas.google.com/sites/2008">
  <category scheme="http://schemas.google.com/g/2005#kind"
      term="http://schemas.google.com/sites/2008#filecabinet" label="filecabinet"/>
  <title>File Storage</title>
  <content type="xhtml">
    <div xmlns="http://www.w3.org/1999/xhtml">A list of files is below.</div>
  </content>
  <sites:pageName>files</sites:pageName>
</entry>

서버는 페이지 URL 경로의 이름을 지정하기 위해 다음 우선순위 규칙을 사용합니다.

  1. <sites:pageName>(있는 경우) a-z, A-Z, 0-9, -, _을 충족해야 합니다.
  2. <atom:title>이며 pageName이 없는 경우 null이 아니어야 합니다. 정규화는 공백을 잘라내고 '-'로 접고 a-z, A-Z, 0-9, -, _와 일치하지 않는 문자를 삭제하는 것입니다.

예를 들어 'Custom_Page2'는 서버에서 허용됩니다.

하위 페이지 만들기

상위 페이지 아래에 하위 페이지 (하위 페이지)를 만들려면 새 Atom 항목에 <link rel="http://schemas.google.com/sites/2008#parent">를 포함합니다. 링크의 href 속성을 상위 항목의 자체 링크로 설정합니다.

이 예에서는 항목 ID가 PARENT_ENTRY_ID인 상위 공지사항 페이지 아래에 제목이 'announcement'인 새 announcement를 만듭니다. 페이지 본문의 XHTML 콘텐츠도 포함됩니다.

POST /feeds/content/domainName/siteName HTTP/1.1
Host: sites.google.com
GData-Version: 1.4
Authorization: <your authorization header here>
Content-Length: 470
Content-Type: application/atom+xml

<entry xmlns="http://www.w3.org/2005/Atom">
  <category scheme="http://schemas.google.com/g/2005#kind"
      term="http://schemas.google.com/sites/2008#announcement" label="announcement"/>
  <link rel="http://schemas.google.com/sites/2008#parent" type="application/atom+xml"
      href="https://sites.google.com/feeds/content/domainName/siteName/PARENT_ENTRY_ID"/>
  <title>announcement</title>
  <content type="xhtml">
    <div xmlns="http://www.w3.org/1999/xhtml">This weekend. My place.</div>
  </content>
</entry>

페이지 템플릿

페이지 템플릿 만들기

페이지 템플릿을 만드는 과정은 새 항목/페이지 만들기하위 페이지 만들기와 동일합니다.차이점은 용어와 라벨이 각각 'http://schemas.google.com/g/2005#template' 및 '템플릿'으로 설정된 category가 추가된다는 점입니다.

이 예에서는 새 webpage 템플릿을 만듭니다.

POST /feeds/content/domainName/siteName HTTP/1.1
Host: sites.google.com
GData-Version: 1.4
Authorization: <your authorization header here>
Content-Length: 464
Content-Type: application/atom+xml

<entry xmlns="http://www.w3.org/2005/Atom" xmlns:sites="http://schemas.google.com/sites/2008">
  <category scheme="http://schemas.google.com/g/2005#kind"
      term="http://schemas.google.com/sites/2008#webpage" label="webpage"/>
  <category scheme="http://schemas.google.com/g/2005#labels" term="http://schemas.google.com/g/2005#template" label="template"/>
  <title>Webpage Template</title>
  <content type="xhtml">
    <div xmlns="http://www.w3.org/1999/xhtml">This weekend. My place.</div>
  </content>
</entry>

템플릿으로 페이지 만들기

페이지 템플릿을 만드는 것과 마찬가지로, 페이지 템플릿의 자체 링크를 가리키는 rel='http://schemas.google.com/sites/2008#template'과 함께 <link>를 포함하여 템플릿에서 새 페이지를 인스턴스화할 수 있습니다.

이 예에서는 자료실을 정의하는 기존 페이지 템플릿으로 새 filecabinet 페이지를 만듭니다.

POST /feeds/content/domainName/siteName HTTP/1.1
Host: sites.google.com
GData-Version: 1.4
Authorization: <your authorization header here>
Content-Length: 464
Content-Type: application/atom+xml

<entry xmlns="http://www.w3.org/2005/Atom" xmlns:sites="http://schemas.google.com/sites/2008">
  <category scheme="http://schemas.google.com/g/2005#kind"
      term="http://schemas.google.com/sites/2008#filecabinet" label="filecabinet"/>
  <title>File Cabinet Page From Template</title>
  <link rel='http://schemas.google.com/sites/2008#template' type='application/atom+xml'
    href='https://sites.google.com/feeds/content/domainName/siteName/ENTRY_ID'/>
</entry>

참고: 템플릿에서 <category>를 정의하고 항목에도 계속 지정해야 합니다. 또한 <content> 요소를 포함하면 서버에서 이를 거부합니다.

파일 업로드

Google 사이트 도구에서와 마찬가지로 API를 사용하여 첨부파일을 파일 캐비닛 페이지 및 상위 페이지에 업로드할 수 있습니다.

상위 파일에 첨부파일을 업로드하려면 HTTP POST 요청을 콘텐츠 피드 URL로 전송합니다.

https://sites.google.com/feeds/content/domainName/siteName

파일 콘텐츠를 첨부파일의 메타데이터를 포함하는 <atom:entry>과 결합하려면 POST 본문이 MIME 멀티파트 요청이어야 합니다. <atom:entry>는 연결이 생성될 위치를 지정하기 위해 상위 항목의 자체 링크를 참조해야 합니다. 자세한 내용은 하위 페이지 만들기를 참고하세요.

첨부파일 업로드 중

다음은 ID가 PARENT_ENTRY_ID인 자료실에 PDF 파일을 업로드하는 예입니다. 제목이 'PDF 파일'이고 설명 (선택사항)인 'HR 패킷'이 포함된 첨부파일이 생성됩니다.

POST /feeds/content/domainName/siteName HTTP/1.1
Host: sites.google.com
GData-Version: 1.4
Authorization: <your authorization header here>
Content-Length: 7221984
Content-Type: multipart/related; boundary=END_OF_PART
--END_OF_PART
Content-Type: application/atom+xml

<entry xmlns="http://www.w3.org/2005/Atom">
  <category scheme="http://schemas.google.com/g/2005#kind"
          term="http://schemas.google.com/sites/2008#attachment" label="attachment"/>
  <link rel="http://schemas.google.com/sites/2008#parent" type="application/atom+xml"
        href="https://sites.google.com/feeds/content/domainName/siteName/PARENT_ENTRY_ID"/>
  <title>PDF File</title>
  <summary>HR packet</summary>
</entry>

--END_OF_PART
Content-Type: application/pdf

... pdf contents here ...

--END_OF_PART--

업로드가 성공하면 서버에서 201 Created 및 새로 만든 첨부파일 항목의 사본을 응답합니다.

폴더에 첨부파일 업로드

첨부파일을 filecabinet의 기존 폴더에 업로드하려면 'term' 속성이 폴더 이름으로 설정된 카테고리를 포함하세요.

<category scheme="http://schemas.google.com/sites/2008#folder" term="FolderName">

웹 첨부파일

웹 첨부파일은 특별한 종류의 첨부파일입니다. 기본적으로 이는 웹에 있는 다른 파일에 대한 링크로서 파일 캐비닛 목록에 추가할 수 있습니다. 이 기능은 Google Sites UI의 'URL로 파일 추가' 업로드 방법과 유사합니다.

참고: 웹 첨부파일은 자료실에서만 만들 수 있습니다. 다른 유형의 페이지에는 업로드할 수 없습니다.

이 예시에서는 ID가 FILECABINET_ENTRY_ID인 파일 캐비닛 아래에 webattachment을 만듭니다. 제목과 설명 (선택사항)은 각각 'GoogleLogo'와 'nice colors'로 설정되어 있습니다.

POST /feeds/content/domainName/siteName HTTP/1.1
Host: sites.google.com
GData-Version: 1.4
Authorization: <your authorization header here>
Content-Type: application/atom+xml
Content-Length: 531

<entry xmlns="http://www.w3.org/2005/Atom">
  <category scheme="http://schemas.google.com/g/2005#kind"
          term="http://schemas.google.com/sites/2008#webattachment" label="webattachment"/>
  <link rel="http://schemas.google.com/sites/2008#parent" type="application/atom+xml"
        href="https://sites.google.com/feeds/content/domainName/siteName/FILECABINET_ENTRY_ID"/>
  <title>GoogleLogo</title>
  <summary>nice colors</summary>
  <content type="image/gif" src="http://www.google.com/images/logo.gif"></content>
</entry>

POST는 사용자의 자료실에 'http://www.google.com/images/logo.gif'의 이미지를 가리키는 링크를 만듭니다.

맨 위로



콘텐츠 업데이트

모든 페이지의 메타데이터 (제목, 페이지 이름 등) 및 페이지 콘텐츠는 edit 링크에 대한 단일 PUT 요청으로 수정할 수 있습니다. 요청 본문에는 업데이트된 페이지를 설명하는 Atom 항목이 포함되어야 합니다. 첨부파일의 메타데이터를 업데이트하는 데만 항목을 사용할 수 있는 첨부파일 항목은 이 규칙에서 예외입니다. 첨부된 파일의 콘텐츠를 변경하려면 첨부파일의 edit-media 링크에 대한 PUT 요청의 본문으로 원시 데이터를 포함하면 됩니다. MIME 멀티파트 요청을 사용하여 메타데이터와 첨부된 파일 콘텐츠를 모두 한 번에 업데이트할 수도 있습니다.

업데이트가 다른 클라이언트의 변경사항을 덮어쓰지 않도록 어설션하려면 원래 항목의 ETag 값을 포함합니다. 이렇게 하려면 HTTP If-Match 헤더에 ETag 값을 제공하거나 업데이트된 항목에 원본 항목의 gd:etag 속성을 포함하면 됩니다. 원래 항목의 ETag 값을 확인하려면 <entry> 요소의 gd:etag 속성을 검사합니다. 미디어 항목의 경우 edit-media 링크의 gd:etag 속성에서 미디어의 ETag를 사용할 수 있습니다.

항목을 검색한 후 다른 사람이 항목을 업데이트했는지 여부에 관계없이 항목을 업데이트하려면 If-Match: *를 사용하고 ETag는 포함하지 마세요. ETag에 관한 자세한 내용은 Google Data API 참조 가이드를 확인하세요.

항목의 메타데이터 또는 HTML 콘텐츠 업데이트

항목의 메타데이터 또는 HTML 콘텐츠를 업데이트하려면 항목의 edit 링크에 HTTP PUT를 전송합니다.

다음은 listpage 항목 (ID ENTRY_ID로 표시됨)을 다음 변경사항으로 업데이트하는 예입니다.

  • 제목이 '업데이트된 콘텐츠'로 수정됨
  • 업데이트된 HTML 콘텐츠
  • 목록의 첫 번째 열 제목이 '소유자'로 업데이트됨
  • 페이지의 URL 경로가 <sites:pageName> 요소에 의해 수정됨
PUT /feeds/content/domainName/siteName/ENTRY_ID
Host: sites.google.com
GData-Version: 1.4
Authorization: <your authorization header here>
Content-Length: 816
Content-Type: application/atom+xml

<entry xmlns="http://www.w3.org/2005/Atom" xmlns:sites="http://schemas.google.com/sites/2008"
    xmlns:gs="http://schemas.google.com/spreadsheets/2006" xmlns:gd="http://schemas.google.com/g/2005"
    gd:etag="W/&quot;CEEBRn0ymA9WxJWEUw.&quot;">
  <category scheme="http://schemas.google.com/g/2005#kind"
      term="http://schemas.google.com/sites/2008#listpage" label="listpage"/>
  <title>Updated Title</title>
  <content type="xhtml">
    <div xmlns="http://www.w3.org/1999/xhtml">Updated Content</div>
  </content>
  <gs:worksheet name="listpage"/>
  <gs:header row="1"/>
  <gs:data startRow="2">
    <gs:column index="A" name="Owner"/>
    <gs:column index="B" name="Decription"/>
    <gs:column index="C" name="Completed"/>
  </gs:data>
  <sites:pageName>newPagePath</sites:pageName>
</entry>

참고: 서버에서 반환한 항목에는 위 예보다 더 많은 요소가 포함됩니다.

첨부파일 콘텐츠 바꾸기

다음은 첨부파일의 콘텐츠를 바꾸고 메타데이터는 변경하지 않는 예입니다. 요청에 새 콘텐츠가 포함되므로 첨부파일 항목의 edit-media 링크가 사용됩니다.

PUT /feeds/media/content/domainName/siteName/ATTACHMENT_ENTRY_ID
Host: sites.google.com
GData-Version: 1.4
Authorization: <your authorization header here>
Content-Length: 70581
Content-Type: application/msword

... doc contents here ...

첨부파일 메타데이터 및 콘텐츠 업데이트

다음은 첨부파일의 메타데이터와 콘텐츠를 동시에 업데이트하는 예입니다. 첨부파일 이름이 '새 제목'으로 업데이트되고 내용은 .zip 파일의 콘텐츠로 대체됩니다. 요청에 새 파일 콘텐츠가 포함되므로 첨부파일 항목의 edit-media 링크가 사용됩니다.

메타데이터에 ETag를 포함하면 미디어 콘텐츠에도 암시적 If-Match가 제공됩니다. 미디어 콘텐츠를 업데이트하면 메타데이터의 ETag가 변경되기 때문입니다.

PUT /feeds/media/content/domainName/siteName/ATTACHMENT_ENTRY_ID
Host: sites.google.com
GData-Version: 1.4
Authorization: <your authorization header here>
Content-Type: multipart/related; boundary="END_OF_PART"
--END_OF_PART
Content-Type: application/atom+xml

<?xml version='1.0' encoding='UTF-8'?>
<entry xmlns="http://www.w3.org/2005/Atom" xmlns:gd="http://schemas.google.com/g/2005" gd:etag="BxAaTxRZAyp7ImBq">
  <link rel="http://schemas.google.com/sites/2008#parent" type="application/atom+xml"
        href="https://sites.google.com/feeds/content/domainName/siteName/ATTACHMENT_ENTRY_ID"/>
  <title>New Title</title>
</entry>

--END_OF_PART
Content-Type: application/zip

... zip contents here ...

--END_OF_PART

맨 위로



콘텐츠 삭제

Google 사이트에서 항목을 삭제하려면 먼저 항목을 검색한 다음 항목의 edit URL로 DELETE 요청을 전송합니다. 항목의 메타데이터 또는 html 콘텐츠를 업데이트할 때 사용되는 URL과 동일합니다.

DELETE /feeds/content/domainName/siteName/ENTRY_ID
Host: sites.google.com
GData-Version: 1.4
Authorization: <your authorization header here>
If-Match: <ETag or * here>

항목이 성공적으로 삭제되면 서버에서 HTTP 200 OK로 응답합니다.

항목을 검색한 이후 다른 클라이언트에서 변경한 항목을 삭제하지 않도록 하려면 원본 항목의 ETag 값이 포함된 HTTP If-Match 헤더를 포함합니다. <entry> 요소의 gd:etag 속성을 검사하여 원래 항목의 ETag 값을 확인할 수 있습니다.

항목을 검색한 후 다른 사람이 항목을 업데이트했는지 여부에 관계없이 항목을 삭제하려면 If-Match: *를 사용하고 ETag는 포함하지 마세요. 이 경우 항목을 삭제하기 전에 검색하지 않아도 됩니다.

ETag에 대한 자세한 내용은 Google Data API 참조 가이드를 확인하세요.

맨 위로



첨부파일 다운로드

첨부파일 항목이 있으면 인증된 HTTP GET를 항목의 <content> src 링크로 전송하여 파일을 다운로드할 수 있습니다. PDF 콘텐츠 링크의 예:

<content type="application/pdf"
  src="http://502377765-a-google-com-s-sites.googlegroups.com/feeds/media/content/domainName/siteName/678942036"/>

맨 위로

ACL 피드

공유 권한 (ACL) 개요

ACL 피드의 각 ACL 항목은 사용자, 사용자 그룹, 도메인 또는 기본 액세스 (공개 사이트)와 같은 특정 항목의 액세스 역할을 나타냅니다. 항목은 명시적 액세스 권한이 있는 항목에만 표시됩니다. Google Sites UI 공유 화면의 '액세스 권한이 있는 사용자' 패널에 각 이메일 주소별로 항목이 하나씩 표시됩니다. 따라서 사이트에 대한 암시적 액세스 권한이 있더라도 도메인 관리자가 표시되지 않습니다.

역할

역할 요소는 항목이 가질 수 있는 액세스 수준을 나타냅니다. gAcl:role 요소에 가능한 값은 4가지입니다.

  • Reader — 뷰어입니다 (읽기 전용 액세스와 동일).
  • writer — 공동작업자 (읽기/쓰기 액세스 권한과 동일)
  • owner — 일반적으로 사이트 관리자입니다 (읽기/쓰기 액세스 권한과 동일).

범위

범위 요소는 이 액세스 수준을 가진 항목을 나타냅니다. gAcl:scope 요소에는 가능한 5가지 유형이 있습니다.

  • user — 이메일 주소 값(예: 'user@gmail.com')
  • group — Google 그룹 이메일 주소(예: 'group@domain.com')
  • domain — G Suite 도메인 이름(예: 'domain.com')
  • invite — 사이트에 초대되었지만 아직 사이트의 ACL에 추가되지 않은 사용자입니다. (gdata 1.3 이하를 지정한 경우에는 사용할 수 없음)
  • default - 값이 없는 '기본' 유형의 가능한 범위는 하나만 있습니다(예: <gAcl:scope type="default">). 이 특정 범위는 공개 사이트에서 모든 사용자가 기본적으로 갖는 액세스 권한을 제어합니다.

참고: 도메인에서 gAcl:role 값을 '소유자' 액세스로 설정할 수 없으며 리더 또는 작성자만 지정할 수 있습니다.

'초대' 범위에 관한 정보

아직 Google 계정이 없는 사용자를 한 명 이상 ACL에 추가하면 API가 초대 범위를 반환합니다. API는 초대된 사용자가 초대를 수락할 수 있도록 하기 위해 제공해야 하는 삽입된 토큰이 포함된 URL을 반환합니다.

이 초대 방법을 사용하면 사용자가 사용하려는 이메일 주소를 미리 알지 못하는 사이에 Google 사용자가 아닌 사용자를 초대할 수 있습니다. 사용자는 토큰이 포함된 초대 URL을 클릭하기만 하면 원하는 이메일 주소를 사용하여 액세스를 신청할 수 있습니다. 또한 여러 사용자가 이 URL을 사용하여 초대를 수락할 수 있으므로 한 명 또는 여러 명의 사용자를 초대하는 경우 유용할 수 있습니다.

참고: '초대' 범위는 gdata 버전 1.4 이상에서만 사용할 수 있습니다. 1.3 이하를 명시적으로 지정하는 경우에는 이 방법이 작동하지 않습니다.

ACL 피드 가져오기

ACL 피드는 사이트의 공유 권한을 제어하는 데 사용할 수 있으며 다음 URI를 통해 액세스할 수 있습니다.

https://sites.google.com/feeds/acl/site/domainName/siteName
피드 매개변수설명
domainName'site' 또는 G Suite 호스팅 도메인의 도메인 (예: example.com)입니다.
siteName사이트의 웹 공간 이름으로 사이트의 URL에서 찾을 수 있습니다 (예: myCoolSite).

사이트 피드의 각 항목에는 다음 피드 링크가 포함되어 있습니다.

 <link rel="http://schemas.google.com/acl/2007#accessControlList" type="application/atom+xml"
      href="https://sites.google.com/feeds/acl/site/domainName/siteName"/>

사이트의 공유 권한을 가져오려면 다음과 같이 HTTP GET를 ACL 피드 URI에 전송합니다.

GET /feeds/acl/site/domainName/siteName HTTP/1.1
Host: sites.google.com
GData-Version: 1.4
Authorization: <your authorization header here>

서버는 200 OK 및 ACL 항목 피드를 반환합니다.

<feed xmlns="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/"
    xmlns:gAcl="http://schemas.google.com/acl/2007" xmlns:sites="http://schemas.google.com/sites/2008"
    xmlns:gs="http://schemas.google.com/spreadsheets/2006" xmlns:dc="http://purl.org/dc/terms"
    xmlns:batch="http://schemas.google.com/gdata/batch" xmlns:gd="http://schemas.google.com/g/2005"
    xmlns:thr="http://purl.org/syndication/thread/1.0">
<id>https://sites.google.com/feeds/acl/site/domainName/siteName</id>
<updated>2009-12-03T22:01:05.963Z</updated>
<category scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/acl/2007#accessRule"/>
<title>Acl</title>
<link rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml"
    href="https://sites.google.com/feeds/acl/site/domainName/siteName"/>
<link rel="http://schemas.google.com/g/2005#post" type="application/atom+xml"
    href="https://sites.google.com/feeds/acl/site/domainName/siteName"/>
<link rel="self" type="application/atom+xml"
    href="https://sites.google.com/feeds/acl/site/domainName/siteName"/>
<generator version="1" uri="http://sites.google.com">Google Sites</generator>
<openSearch:startIndex>1</openSearch:startIndex>
<entry>
  <id>https://sites.google.com/feeds/acl/site/domainName/siteName/user%3AuserA%40gmail.com</id>
  <updated>2009-12-03T22:01:05.963Z</updated>
  <app:edited xmlns:app="http://www.w3.org/2007/app">2009-12-03T22:01:05.963Z</app:edited>
  <category scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/acl/2007#accessRule"/>
  <link rel="self" type="application/atom+xml"
      href="https://sites.google.com/feeds/acl/site/domainName/siteName/user%3AuserA%40google.com"/>
  <link rel="edit" type="application/atom+xml"
      href="https://sites.google.com/feeds/acl/site/domainName/siteName/user%3AuserA%40google.com"/>
  <gAcl:scope type="user" value="userA@google.com"/>
  <gAcl:role value="owner"/>
</entry>
<entry>
  <id>https://sites.google.com/feeds/acl/site/domainName/siteName/user%3AuserB%40gmail.com</id>
  <updated>2009-12-03T22:01:05.963Z</updated>
  <app:edited xmlns:app="http://www.w3.org/2007/app">2009-12-03T22:01:05.963Z</app:edited>
  <category scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/acl/2007#accessRule"/>
  <link rel="self" type="application/atom+xml"
      href="https://sites.google.com/feeds/acl/site/domainName/siteName/user%3AuserB%40gmail.com"/>
  <link rel="edit" type="application/atom+xml"
      href="https://sites.google.com/feeds/acl/site/domainName/siteName/user%3AuserB%40gmail.com"/>
  <gAcl:scope type="user" value="userB@gmail.com"/>
  <gAcl:role value="writer"/>
</entry>
<entry>
  <id>https://sites.google.com/feeds/acl/site/domainName/siteName/user%3AuserC%40gmail.com</id>
  <updated>2009-12-03T22:01:05.963Z</updated>
  <app:edited xmlns:app="http://www.w3.org/2007/app">2009-12-03T22:01:05.963Z</app:edited>
  <category scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/acl/2007#accessRule"/>
  <link rel="self" type="application/atom+xml"
      href="https://sites.google.com/feeds/acl/site/domainName/siteName/user%3AuserC%40gmail.com"/>
  <link rel="edit" type="application/atom+xml"
      href="https://sites.google.com/feeds/acl/site/domainName/siteName/user%3AuserC%40gmail.com"/>
  <gAcl:scope type="user" value="userC@gmail.com"/>
  <gAcl:role value="reader"/>
</entry>
...
</feed>

맨 위로

사이트 공유

ACL 피드는 GET, POST, PUT 요청을 허용합니다. ACL 피드에 새 역할을 삽입하려면 사이트의 ACL 피드에 POST 요청을 실행하면 됩니다.

참고: 일부 공유 ACL은 도메인이 이러한 권한을 허용하도록 구성된 경우에만 사용할 수 있습니다 (예: G Suite 도메인의 도메인 외부에 공유가 사용 설정된 경우).

다음 예에서는 사이트에 새 공동작업자 (작성자)를 추가합니다.

POST /feeds/acl/site/domainName/siteName HTTP/1.1
Host: sites.google.com
GData-Version: 1.4
Authorization: <your authorization header here>

<entry xmlns="http://www.w3.org/2005/Atom" xmlns:gAcl='http://schemas.google.com/acl/2007'>
  <category scheme='http://schemas.google.com/g/2005#kind'
    term='http://schemas.google.com/acl/2007#accessRule'/>
  <gAcl:role value='writer'/>
  <gAcl:scope type='user' value='new_writer@example.com'/>
</entry>

삽입에 성공하면 201 Created 및 새 항목이 반환됩니다.

<entry>
  <id>https://sites.google.com/feeds/acl/site/domainName/siteName/user%3Anew_writer%40example.com</id>
  <updated>2009-12-03T22:01:05.963Z</updated>
  <app:edited xmlns:app="http://www.w3.org/2007/app">2009-12-03T22:01:05.963Z</app:edited>
  <category scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/acl/2007#accessRule"/>
  <link rel="self" type="application/atom+xml"
      href="https://sites.google.com/feeds/acl/site/domainName/siteName/user%3Anew_writer%40example.com"/>
  <link rel="edit" type="application/atom+xml"
      href="https://sites.google.com/feeds/acl/site/domainName/siteName/user%3Anew_writer%40example.com"/>
  <gAcl:role value='writer'/>
  <gAcl:scope type='user' value='new_writer@example.com'/>
</entry>

'초대' 범위를 통해 사용자 초대하기

Google 계정이 없는 사용자를 추가하면 API가 초대하려는 사용자에게 제공해야 하는 URL을 반환합니다. URL을 클릭한 후 기존 계정으로 로그인하거나 새 계정을 만들어 사이트에 액세스할 수 있습니다.

초대에 성공하면 201 Created 및 사용자에게 전달해야 하는 URL이 포함된 새 항목이 반환됩니다.

<entry>
  <id>https://sites.google.com/feeds/acl/site/domainName/siteName/user%3Anew_invite%40example.com</id>
  <updated>2009-12-03T22:01:05.963Z</updated>
  <app:edited xmlns:app="http://www.w3.org/2007/app">2009-12-03T22:01:05.963Z</app:edited>
  <category scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/acl/2007#accessRule"/>
  <link rel="http://schemas.google.com/sites/2008#invite" type="text/html"href="domainName/siteName?invite=inviteToken"/>
  <link rel="self" type="application/atom+xml"
      href="https://sites.google.com/feeds/acl/site/domainName/siteName/user%3Anew_invite%40example.com"/>
  <link rel="edit" type="application/atom+xml"
      href="https://sites.google.com/feeds/acl/site/domainName/siteName/user%3Anew_invite%40example.com"/>
  <gAcl:role value='writer'/>
  <gAcl:scope type='invite' value='new_invite%40example.com'/>
</entry>

그룹 및 도메인 수준 공유

단일 사용자와 사이트를 공유할 때와 마찬가지로 Google 그룹 또는 G Suite 도메인 간에 사이트를 공유할 수 있습니다. 필요한 scope 값은 다음과 같습니다.

그룹 이메일 주소로 공유:

<gAcl:scope type="group" value="group@example.com"/>

전체 도메인에 공유:

<gAcl:scope type="domain" value="example.com"/>

도메인 수준에서의 공유는 G Suite 도메인과 사이트가 호스팅되는 도메인에만 지원됩니다. 예를 들어 http://sites.google.com/a/domain1.com/siteA에서는 전체 사이트를 domain2.com이 아닌 domain1.com에만 공유할 수 있습니다. G Suite 도메인 (예: http://sites.google.com/site/siteB)에서 호스팅되지 않는 사이트는 도메인을 초대할 수 없습니다.

공유 권한 수정

ACL 항목을 업데이트하려면 필요에 따라 항목을 수정하고 'rel' 속성이 'edit'으로 설정된 단순히 <link> 요소인 항목의 edit 링크로 HTTP PUT 요청을 실행합니다. 이전 예에서 해당 링크는 다음과 같습니다.

<link rel='edit' type='application/atom+xml'
    href='https://sites.google.com/feeds/acl/site/domainName/siteName/user%3Anew_writer%40example.com'/>

아래 스니펫은 new_writer@gmail.com의 역할을 'Reader'로 변경합니다.

PUT /feeds/acl/site/domainName/siteName/user%3Anew_writer%40example.com HTTP/1.1
Host: sites.google.com
GData-Version: 1.4
Authorization: <your authorization header here>

<entry xmlns="http://www.w3.org/2005/Atom" xmlns:gAcl='http://schemas.google.com/acl/2007'>
  <category scheme='http://schemas.google.com/g/2005#kind' term='http://schemas.google.com/acl/2007#accessRule'/>
  <gAcl:role value='reader'/>
  <gAcl:scope type='user' value='new_writer@gmail.com'/>
</entry>

공유 권한 삭제 중

이 사용자의 권한을 삭제하려면 PUT 요청에 사용된 것과 동일한 edit 링크에 DELETE 요청을 실행하세요.

DELETE /feeds/acl/site/domainName/siteName/user%3Anew_writer%40example.com HTTP/1.1
Host: sites.google.com
GData-Version: 1.4
Authorization: <your authorization header here>

서버가 200 OK로 응답합니다.

맨 위로

특별 주제

피드 또는 항목 다시 가져오기

이전에 검색한 피드나 항목을 검색하려는 경우 마지막으로 검색한 이후에 변경된 목록이나 항목만 전송하도록 서버에 지시하여 효율성을 높일 수 있습니다.

이러한 종류의 조건부 검색을 수행하려면 HTTP If-None-Match 헤더가 포함된 HTTP GET 요청을 전송합니다. 헤더에서 목록이나 항목의 ETag를 지정합니다. 이는 <feed> 요소 또는 <entry> 요소의 gd:etag 속성에서 찾을 수 있습니다.

사이트 피드 사용 예:

GET /feeds/site/domainName/myOtherTestSite/
GData-Version: 1.4
If-None-Match: W/"Ck8GQXk7fil7ImA9WxNSFk0."

서버는 이 요청을 수신하면 요청한 항목에 지정된 ETag와 동일한 ETag가 있는지 확인합니다. ETag가 일치하면 항목이 변경되지 않고 서버는 HTTP 304 Not Modified 상태 코드 또는 HTTP 412 Precodition Failed 상태 코드를 반환합니다. 이 두 상태 코드는 이미 검색한 항목이 최신 상태임을 나타냅니다.

ETag가 일치하지 않으면 마지막 요청 이후 항목이 수정된 것이므로 서버에서 항목을 반환합니다.

ETag에 대한 자세한 내용은 Google Data API 참조 가이드를 확인하세요.

일괄 처리

일괄 요청을 사용하면 클라이언트가 각 작업을 개별적으로 제출하는 대신 한 번의 요청으로 여러 작업을 실행할 수 있습니다.

서버는 요청된 변경을 최대한 많이 실행하고 각 작업의 성공 또는 실패를 평가하는 데 사용할 수 있는 상태 정보를 반환합니다. Google Data API의 일괄 처리에 대한 자세한 내용은 Google Data API를 사용한 일괄 처리를 참조하세요.

일괄 피드의 모든 작업에는 삽입 작업을 제외한 <id> 요소가 있습니다. 이 요소는 콘텐츠 피드를 업데이트, 삭제 또는 쿼리할 때 일반적으로 사용하는 요청 URL과 동일합니다. 예를 들어 수정사항을 업데이트하는 경우 <id>를 해당 항목의 edit 링크로 설정합니다. 대상 항목을 식별하는 데 사용됩니다. 새 항목은 아직 생성되지 않았으므로 <id> 요소가 없습니다. 대신 <batch:id>에 문자열 값을 정의할 수 있습니다. 이 값은 서버의 응답으로 반환되고 해당 항목을 찾는 데 사용됩니다.

일괄 요청을 하려면 일괄 피드를 생성하고 피드의 일괄 링크에 HTTP POST를 전송합니다.

<link rel="http://schemas.google.com/g/2005#batch" type="application/atom+xml"
    href="https://sites.google.com/feeds/content/site/siteName/batch"/>

아래 예는 웹페이지 항목을 쿼리, 삽입, 업데이트, 삭제하는 방법을 보여줍니다.

POST /feeds/content/site/siteName/batch HTTP/1.1
Host: sites.google.com
Accept: */*
If-Match: *
GData-Version: 1.4
Authorization: <your authorization header here>

<feed xmlns="http://www.w3.org/2005/Atom" xmlns:sites="http://schemas.google.com/sites/2008"
      xmlns:gd="http://schemas.google.com/g/2005" xmlns:batch='http://schemas.google.com/gdata/batch'>
  <entry>
    <id>https://sites.google.com/feeds/content/site/siteName/ENTRY_ID1</id>
    <batch:operation type="query"/>
  </entry>
  <entry>
    <batch:id>1</batch:id>
    <batch:operation type='insert'/>
    <category scheme="http://schemas.google.com/g/2005#kind"
        term="http://schemas.google.com/sites/2008#webpage" label="webpage"/>
    <title>New Webpage1</title>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">HTML body goes here</div>
    </content>
  </entry>
  <entry gd:etag="&quot;YDgpeyI.&quot;">
    <id>https://sites.google.com/feeds/content/site/siteName/ENTRY_ID2</id>
    <batch:operation type='update'/>
    <category scheme="http://schemas.google.com/g/2005#kind"
        term="http://schemas.google.com/sites/2008#webpage" label="webpage"/>
    <title>Updated Title for Webpage2</title>
    ...
    <batch:operaation type="update"/>
  </entry>
  <entry gd:etag="&quot;YassseyI.&quot;">
    <id>https://sites.google.com/feeds/content/site/siteName/ENTRY_ID3</id>
    <batch:operation type='delete'/>
  </entry>
</feed>

반환된 피드에는 각 작업에 대한 하나의 결과 항목이 포함됩니다.

 
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/"
    xmlns:sites="http://schemas.google.com/sites/2008" xmlns:gs="http://schemas.google.com/spreadsheets/2006"
    xmlns:dc="http://purl.org/dc/terms" xmlns:batch="http://schemas.google.com/gdata/batch"
    xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0">
<id>https://sites.google.com/feeds/content/site/siteName/ENTRY_ID1</id>
<updated>2009-11-10T22:44:08.369Z</updated>
<title>Batch Feed</title>
<entry gd:etag="&quot;YDgpsdfeyI.&quot;">
  <id>https://sites.google.com/feeds/content/site/siteName/ENTRY_ID1</id>
  <published>2009-08-31T04:42:45.251Z</published>
  <updated>2009-10-25T22:46:13.729Z</updated>
  <app:edited xmlns:app="http://www.w3.org/2007/app">2009-10-25T22:46:13.671Z</app:edited>
  <category scheme="http://schemas.google.com/g/2005#kind"
      term="http://schemas.google.com/sites/2008#webpage" label="webpage"/>
  <title>Page Title</title>
  ...
  <batch:status code="200" reason="Success"/>
  <batch:operation type="query"/>
</entry>
<entry gd:etag="&quot;YDsseyI.&quot;">
  <id>https://sites.google.com/feeds/content/site/siteName/ENTRY_ID4</id>
  <published>2009-11-10T22:44:08.531Z</published>
  <updated>2009-11-10T22:44:08.560Z</updated>
  <app:edited xmlns:app="http://www.w3.org/2007/app">2009-11-10T22:44:08.531Z</app:edited>
  <category scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/sites/2008#webpage" label="webpage"/>
  <title>New Webpage1</title>
  <content type="xhtml">
    <div xmlns="http://www.w3.org/1999/xhtml">
    <table cellspacing="0" class="sites-layout-name-one-column sites-layout-hbox">
      <tbody>
        <tr>
          <td class="sites-layout-tile sites-tile-name-content-1">
            <div>HTML body goes here</div>
          </td>
        </tr>
      </tbody>
    </table>
  </div>
</content>
...
<batch:id>1</batch:id>
<batch:status code="201" reason="Created"/>
<batch:operation type="insert"/>
</entry>
<entry gd:etag="&quot;YDkpeyI.&quot;">
  <id>https://sites.google.com/feeds/content/site/siteName/ENTRY_ID2</id>
  <updated>2009-11-10T22:44:09.296Z</updated>
  <title>Updated Title for Webpage2</title>
  ...
  <sites:pageName>updated-title-for-webpage2</sites:pageName>
  <sites:revision>5</sites:revision>
  <batch:status code="200" reason="Success"/>
  <batch:operation type="update"/>
</entry>
<entry>
  <id>https://sites.google.com/feeds/content/site/siteName/ENTRY_ID3</id>
  <title>Deleted</title>
  <content>Deleted</content>
  <batch:status code="200" reason="Success"/>
  <batch:operation type="delete"/>
</entry>
</feed>

맨 위로