프로토콜 가이드

기본 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 데이터 API를 활성화합니다. API 콘솔의 목록에 이 API가 없다면 이 단계를 건너뜁니다.
  3. 애플리케이션에서 사용자 데이터에 액세스해야 하는 경우 Google에 특정 액세스 범위를 요청합니다.
  4. Google에서 사용자에게 애플리케이션이 일부 데이터를 요청하도록 승인할 것인지 물어보는 동의 화면을 표시합니다.
  5. 사용자가 승인하면 Google에서 애플리케이션에 제한 시간이 있는 액세스 토큰을 제공합니다.
  6. 애플리케이션에서 액세스 토큰을 첨부하여 사용자 데이터를 요청합니다.
  7. Google에서 요청과 토큰이 유효하다고 판단하면 요청된 데이터를 반환합니다.

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

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

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

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

맨 위로

버전 지정

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

GData-Version: 1.4

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

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

맨 위로

사이트 피드

사이트 피드를 사용하여 사용자가 소유하거나 보기 권한이 있는 Google Sites를 표시할 수 있습니다. 기존 사이트의 제목도 수정할 수 있습니다 G Suite 도메인의 경우 Google Cloud ID를 사용하여 전체 사이트.

사이트 나열

사용자가 액세스할 수 있는 사이트를 나열하려면 인증된 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>

위의 요청은 '슬레이트'로 새 Google 사이트를 만듭니다. G Suite 도메인(example.com)에 테마를 설정할 수 있습니다. 사이트의 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 설정 페이지에서 선택되어 있는지 확인하세요.
  • 소스 사이트의 소유자로 표시되기 전까지는 다른 도메인에서 사이트를 복사할 수 있습니다.

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

사이트의 제목이나 요약을 업데이트하려면 HTTP PUT를 사이트 항목의 edit 링크로 보냅니다. 예를 들어 다음 예는 이전 사이트의 제목을 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 태그가 포함된 사이트 항목의 edit 링크로 HTTP PUT를 전송합니다. 다음 예에서 굵게 표시된 줄을 참고하세요.

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://www.mydomainsite.com http://sites.google.com/a/domain.com/mysite 대신 사용할 수 있습니다. 사이트가 호스팅되는 위치에 따라 매핑 작업을 수행합니다. 자세한 내용은 고객센터 도움말을 참고하세요.

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

사이트의 웹 주소 매핑을 반환하려면 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로 표시됩니다. 예를 들어, 위의 예에서 사이트를 가리키는 3개의 webAddressMapping가 있음 http://sites.google.com/site/myOtherTestSite입니다.

웹 주소 매핑 수정

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

매핑을 추가, 업데이트 또는 삭제하려면 새 사이트를 만들 때 해당 링크를 지정, 변경 또는 삭제하면 됩니다. 사이트의 메타데이터 업데이트 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>

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

맨 위로

활동 피드

활동 피드를 가져오면 사이트의 최근 활동 (변경사항)을 가져올 수 있습니다. 목록의 각 항목은 활동 피드에는 사이트의 변경사항에 대한 정보가 들어 있습니다.

활동 피드를 쿼리하려면 HTTP GET를 활동 피드 URL에 보냅니다.

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)

지정된 페이지/comment/attachment/listitem의 수정본 링크를 찾으려면 먼저 다음에서 항목을 가져오세요. 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 데이터 API 쿼리 매개변수 중 일부를 사용하여 콘텐츠 피드를 검색할 수 있습니다. 기존 Sites API와 관련된 사이트를 확인할 수 있습니다 자세한 내용과 지원되는 매개변수의 전체 목록은 참조 가이드

특정 항목 종류 검색

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

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

둘 이상의 항목 유형을 반환하려면 각 kind을 ','로 구분합니다. 이 예시에서는 filecabinet를 반환하고 항목 listpage개:

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를 만들지만, 페이지를 만듭니다. URL http://sites.google.com/domainName/siteName/files 아래 <sites:pageName> 요소 지정

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' 는 서버에서 허용됩니다.

하위 페이지 만들기

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

이 예에서는 항목이 있는 상위 공지사항 페이지 아래에 '공지사항'이라는 제목의 새 announcement를 만듭니다. ID: PARENT_ENTRY_ID 페이지 본문용 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를 사용하면 자료실 페이지와 상위 페이지에 첨부파일을 업로드할 수 있습니다.

상위 항목에 첨부파일을 업로드하려면 콘텐츠 피드 URL에 HTTP POST 요청을 보냅니다.

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

POST 본문은 파일 콘텐츠를 다음과 결합하기 위한 MIME 멀티파트 요청이어야 합니다. 첨부파일의 메타데이터를 포함하는 <atom:entry>입니다. <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">

웹 첨부파일

웹 첨부파일은 특별한 종류의 첨부파일입니다. 웹상의 다른 파일에 대한 링크이기 때문에 파일 캐비닛 목록에 추가할 수 있습니다. 이 기능은 'URL로 파일 추가' 업로드 방법을 사용할 수 있습니다.

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

이 예시에서는 ID FILECABINET_ENTRY_ID로 참조되는 파일 캐비닛 아래에 webattachment를 만듭니다. 제목과 (선택사항) 설명이 'GoogleLogo'로 설정되어 있습니다. 각각 '좋은 색상'과 '좋은 색상'의 두 가지 조합을 제공합니다.

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 항목이 포함되어야 합니다. 이 규칙에서 예외적으로 첨부파일 항목은 첨부파일의 메타데이터를 업데이트하는 데에만 사용할 수 있습니다. 첨부된 파일의 콘텐츠를 변경하려면 원시 데이터를 PUT 요청의 본문으로 포함하면 됩니다. 첨부파일의 edit-media 링크 또한 MIME 멀티파트 요청입니다.

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

항목을 검색한 이후 다른 사람이 업데이트했는지 여부와 상관없이 항목을 업데이트하려면 If-Match: *: ETag를 포함하지 않습니다. ETag에 대한 자세한 내용은 Google 데이터 API 참조 가이드

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

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

다음은 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가 제공됩니다. 미디어 콘텐츠로 인해 메타데이터의 infoType이 변경됩니다.

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 Sites에서 항목을 삭제하려면 먼저 항목을 가져온 다음 DELETE를 전송하세요. 항목의 edit URL에 대한 요청을 전송합니다. 항목의 메타데이터 또는 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로 응답합니다.

항목을 가져온 이후 다른 클라이언트에 의해 변경된 항목을 삭제하지 않도록 하려면 원본 항목의 이그레스 값이 포함된 HTTP If-Match 헤더입니다. 다음과 같은 방법으로 원본 항목의 ETag 값을 결정할 수 있습니다. <entry> 요소의 gd: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 항목은 특정 항목(사용자, 사용자 그룹, 도메인)의 액세스 역할을 나타냅니다. 기본 액세스 (공개 사이트)를 지정할 수 있습니다. 명시적인 액세스 권한이 있는 법인의 항목만 표시됩니다. 항목 1개가 표시됩니다. '액세스 권한이 있는 사용자' 목록에서 Google Sites UI의 공유 화면에 있는 패널 따라서 도메인 관리자는 표시되지 않으며 사용자가 사이트에 액세스할 수 있습니다.

역할

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

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

범위

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

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

참고: 도메인에 gAcl:role 값을 포함할 수 없습니다. '소유자'로 설정 권한이 있는 사용자는 독자 또는 작성자만 될 수 있습니다

'초대' 정보 범위를 제공합니다

ACL에 아직 Google 계정이 없는 사용자를 한 명 이상 추가하는 경우 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 항목을 업데이트하려면 필요에 따라 항목을 수정하고 HTTP PUT 요청을 항목의 edit 링크를 'rel'이 포함된 <link> 요소 속성이 'edit'으로 설정되어 있습니다. 이전 예에서 링크는 다음과 같습니다.

<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의 역할을 'leader'로 변경합니다.

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로 응답합니다.

맨 위로

특별 주제

피드 또는 항목 다시 검색

이전에 가져온 피드나 항목을 가져오려는 경우 효율성을 높일 수 있습니다. 서버는 목록 또는 항목을 마지막으로 검색한 이후에 변경된 경우에만 이를 전송합니다.

이러한 종류의 조건부 검색을 수행하려면 GET If-None-Match 헤더. 헤더에서는 <feed> 요소 또는 <entry> 요소의 gd:etag 속성

사이트 피드를 사용한 예:

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

서버는 이 요청을 수신할 때 요청한 항목에 대해 지정합니다. 이 경우, 해당 항목은 변경되지 않았으며 서버는 HTTP 304 Not Modified 상태 코드 또는 HTTP 412 Precodition Failed 상태 코드. 둘 다 상태 코드는 이미 가져온 항목이 최신 상태임을 나타냅니다.

infoType이 일치하지 않으면 마지막으로 요청한 이후 항목이 수정되고 서버가 항목을 반환합니다.

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

일괄 처리

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

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

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

일괄 요청을 하려면 일괄 피드를 생성하고 피드의 일괄 링크로 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>

맨 위로