傳統版 Google 協作平台 API 可讓應用程式存取、發布及修改 Google 協作平台中的內容。此外,您的應用程式可以要求最近活動清單、擷取修訂版本記錄,以及上載/下載附件和檔案。
觀眾
本文假設您已瞭解 Google Data API 通訊協定背後的一般概念。
本文件的適用對象,是想編寫可與 Google 協作平台互動的用戶端應用程式。提供一系列使用原始 XML/HTTP 的基本資料 API 互動範例及相關說明。閱讀本文件後,您可以閱讀左側導覽列其他指南中的語言範例,進一步瞭解如何使用我們的用戶端程式庫與 API 互動。
如需本指南中教材的參考資料,請參閱參考指南。
授權要求
應用程式要求存取非公開使用者資料時,都必須提供授權權杖。這個憑證也可讓 Google 識別您的應用程式。
關於授權通訊協定
您的應用程式必須使用 OAuth 2.0 對要求進行授權,系統不支援其他授權通訊協定。如果您的應用程式採用使用 Google 帳戶登入功能,系統會為您處理部分授權事項。
使用 OAuth 2.0 對要求進行授權
用於向非公開的 Google 使用者資料 API 所發出的要求,必須由通過驗證的使用者進行授權。
OAuth 2.0 授權程序 (或「流程」) 的細節會根據您編寫的應用程式類型而有所不同。下列一般程序適用於所有應用程式類型:
- 建立應用程式後,請透過 Google API 控制台註冊應用程式。接著 Google 會向您提供稍後需要的資訊,例如用戶端 ID 和用戶端密碼。
- 在 Google API 主控台中啟用 Google Sites Data API。(如果 API 控制台裡沒有列出該 API,則可略過這個步驟)。
- 當應用程式需要存取使用者資料時,會向 Google 要求特定的存取範圍。
- Google 會向使用者顯示同意畫面,請對方授權您的應用程式要求部分資料。
- 如果使用者同意,Google 即會授予短期存取憑證給您的應用程式。
- 您的應用程式向使用者要求資料,並且在要求中附上存取憑證。
- 如果 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 標頭,可以在網址中將 v=1.4
指定為查詢參數。但我們會盡可能採用 HTTP 標頭。
附註:用戶端程式庫會自動提供適當的版本標頭,因此請勿在使用用戶端程式庫時使用 v=1.4
查詢參數。
網站資訊提供
網站資訊提供可用於列出使用者擁有的 Google 協作平台,或是具有檢視權限,同時可以修改現有網站的標題。您也可以使用 G Suite 網域來建立或複製整個網站。
商家資訊網站
如要列出使用者可存取的網站,請將經過驗證的 GET
要求傳送至下列網址:
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/"CkUAQH4_eil7I2A9WxNaFk4.""> <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/"DkQGQHczfA9WxNaFk4.""> <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 協作平台網站,其主題為 G Suite 網域 example.com
下的「插入畫面」主題。
網站網址會是 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/"DEECR38l7I2A9WxNaF0Q.""> <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 項目中,加入 <link>
並搭配 rel='source'
指向要複製的網站資訊提供。任何已複製的網站
都會包含這個連結以下是複製網站的範例:
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 協作平台的設定頁面勾選 [發布這個網站為範本] 設定,協作平台即為範本。
- 您從其他來源複製網站,但實際上您已被列為來源網站的擁有者。
更新網站中繼資料
如要更新網站的標題或摘要,請將 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/"DEECR38l7I2A9WxNaF0Q.""> <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 網域網站包含類別中繼資料,可用於分類網域中的網站。如要新增或更新類別中繼資料,請傳送 HTTP PUT
到含有 category
標記的網站項目 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/"DEECR38l7I2A9WxNaF0Q.""> <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/"DEECR38l7I2A9WxNaF0Q.""> <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>
這個範例加入「團隊網站」和「法務部門」這兩個類別
網址的對應
網址對應可讓協作平台使用者將自己的網域對應至 Google 協作平台。例如,可以使用 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/"DkQGQHczfA9WxNaFk4.""> <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
。例如,在上述範例中,有三個 webAddressMapping
指向網站 http://sites.google.com/site/myOtherTestSite
。
修改網址對應
注意:使用網址對應時,所有 GET/POST/PUT 作業都應指定 with-mappings=true
參數。如果沒有這項參數,在網站更新 (GET) 時不會傳回 webAddressMapping
,也不會在從項目更新/移除 (PUT) 對應時考慮。
如要新增、更新或刪除對應關係,只要在建立新網站或更新網站中繼資料時指定、變更或移除這類連結即可。網站動態饋給 URI 必須包含 with-mappings=true
參數。注意:如要更新地址對應,您必須是營業地點管理員或網域管理員 (如果是 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/"DkQGQHczfA9WxNaFk4.""> <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
傳送至活動資訊提供網址:
https://sites.google.com/feeds/activity/domainName/siteName
資訊提供參數 | 說明 |
---|---|
domainName | 「site 」或您的 G Suite 代管網域 (例如 example.com )。 |
siteName | 網站的網頁空間名稱,顯示在網站的網址 (例如 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/"CU4GQ3szfSl7ImA9WxNRFUg.""> <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/"CU8DQn45fyl7ImA9WxNRFUg.""> <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/"CU8AR3s4cSl7ImA9WxNRFUg.""> <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 | 網站的網頁空間名稱,顯示在網站的網址 (例如 myCoolSite )。 |
如要尋找特定頁面/註解/附件/清單項目的修訂版本連結,請先使用內容 CONTENT_FILENAME_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/"CU4GQmA9WxNRFUg.""> <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&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/"CU8DQ388eSl7ImA9WxNRFUg.""> <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&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
要求傳送至下列網址:
https://sites.google.com/feeds/content/domainName/siteName
資訊提供參數 | 說明 |
---|---|
domainName | 「site 」或您的 G Suite 代管網域 (例如 example.com )。 |
siteName | 網站的網頁空間名稱,顯示在網站的網址 (例如 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/"Ck8GQXk7fil7ImA9WxNSFk0.""> <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/"CkMBQH08fCl7ImA9WxNSFk0.""> <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/"AkYHQ3ozcCl7ImA9WxJaE08.""> <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 Data 通訊協定參考資料。
下方將說明對傳統版 Site API 採用特定意義的元素。某些種類項目會包含額外屬性 (未列於下方),其他屬性則不會。舉例來說,listitem
項目可能有 <gs:field>
元素,而 webpage
項目則沒有。
元素 | 說明 |
---|---|
<content ...> | 內部文字是網頁的 HTML 內文。對於某些項目 (例如附件),這個元素會包含指向檔案的 src 屬性。 |
<link rel="alternate" ...> | 連結到 Google 協作平台中的網頁或項目。 |
<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> | 網頁空白的網頁名稱;對應網頁名稱。 |
<sites:revision> | 目前的修訂版本編號。 |
內容資訊提供查詢範例
您可以使用部分標準 Google Data API 查詢參數及傳統版 Site API 的相關參數搜尋內容資訊提供。如需詳細資訊和完整的支援參數清單,請參閱參考指南。
擷取特定項目種類
如果只要擷取特定類型的項目,請使用 kind
參數。這個範例只會傳回 webpage
項目:
GET /feeds/content/domainName/siteName?kind=webpage
如要傳回多個項目類型,請以「,」分隔每個 kind
,並以 filecabinet
和 listpage
傳回。
GET /feeds/content/domainName/siteName?kind=filecabinet,listpage
此外,您也可以針對 Google 資料 /-/category
查詢 (而非 kind
參數) 使用標準格式:
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,並將標題標題設為「New WebPage Title」(新網頁標題):
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
和項目的複本。
在自訂網址路徑下建立項目/網頁
根據預設,先前的範例會在 http://sites.google.com/domainName/siteName/new-webpage-title
網址下建立,且頁面標題為「New Pagepage Title」。也就是說,系統會將網址的 <atom:title>
正規化為 new-webpage-title
。如要自訂網頁網址,您可以設定 <sites:pageName>
元素。
這個範例會建立一個含有「File Storage」頁面標題的新 filecabinet
,但透過指定 <sites:pageName>
元素,在網址 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>
為網頁網址命名時,伺服器會使用以下優先順序規則:
<sites:pageName>
(如果有的話)。必須滿足a-z, A-Z, 0-9, -, _
要求。<atom:title>
,如果頁面名稱不存在,則不得為空值。正規化是裁切 + 收合空白字元為「-」,並移除與a-z, A-Z, 0-9, -, _
不相符的字元。
舉例來說,伺服器可接受「Custom_Page2」。
建立子網頁
如要在父項頁面下建立子頁面 (子項),請在新的 Atom 項目中加入 <link rel="http://schemas.google.com/sites/2008#parent">
。將連結的 href
屬性設為上層項目的自我連結。
這個範例會在父項公告頁面 (項目 ID 為 PARENT_ENTRY_ID
) 中,建立一個具有標題「公告」的新 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>
頁面範本
建立頁面範本
建立頁面範本的程序與建立新項目/網頁及建立子頁面的程序相同。差別在於新增 category
時,字詞和標籤會分別設為「http://schemas.google.com/g/2005#template」和「template」。
這個範例會建立新的 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
要求至內容資訊提供網址:
https://sites.google.com/feeds/content/domainName/siteName
POST
主體應為 MIME 多部分要求,以結合檔案內容與包含附件中繼資料的 <atom:entry>
。<atom:entry>
應參照父項目的自我連結,以便指定附件的建立位置。詳情請參閱建立子頁面。
正在上傳附件
以下範例說明如何將 PDF 檔案上傳到 ID 為 PARENT_ENTRY_ID
的檔案櫃。連結將會以標題「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 協作平台 UI 中的 [透過網址新增檔案] 上傳方法類似。
注意:您只能在附件下建立網路附件。無法上傳至其他類型的網頁。
這個範例會在 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
標頭中提供 ETag 值,或是在原始項目中加入原始項目的 gd:etag
屬性。如要判斷原始項目的 ETag 值,請查看 <entry>
元素的 gd:etag
屬性。
媒體項目可在 edit-media
連結的 gd:etag
屬性中取得媒體的 ETag。
如果您要更新項目,而是否有其他人在您擷取之後進行更新,請使用 If-Match: *
且不要包含 ETag。如要進一步瞭解 ETag,請參閱 Google Data API 參考指南。
更新項目的中繼資料或 HTML 內容
如要更新項目的中繼資料或 HTML 內容,請將 HTTP PUT
傳送至該項目的 edit
連結。
以下是使用以下變更來更新 listpage
項目 (以其 ID ENTRY_ID
表示) 的範例:
- 標題已修改為「已更新內容」
- 已更新的 HTML 內容
- 清單的第一欄標題已更新為「擁有者」
<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/"CEEBRn0ymA9WxJWEUw.""> <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 ...
更新附件中繼資料 + 內容
以下為同時更新附件中繼資料及其內容的範例。附件名稱將更新為「New Title」(新標題),其內容將替換為 .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 協作平台中移除項目,請先擷取該項目,然後將 DELETE
要求傳送至該項目的 edit
網址。這個網址可用來更新商品的中繼資料或 HTML 內容。
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 協作平台 UI 的分享畫面中,「擁有存取權的使用者」面板的每個電子郵件地址都會顯示一個項目。因此,即使網域管理員有網站的隱含存取權,系統也不會顯示網域管理員。
角色
角色元素代表實體可以具備的存取層級。gAcl:role
元素有四種可能的值:
- reader - 檢視者 (等同於唯讀存取權)。
- 的情況:協作者 (等同於讀取/寫入)。
- owner - 通常為協作平台管理員 (相當於讀取/寫入權限)。
範圍
範圍元素代表具有此存取層級的實體。gAcl:scope
元素有五種可能類型:
- user:電子郵件地址值,例如「user@gmail.com」。
- group:Google 網路論壇的電子郵件地址,例如「group@domain.com」。
- domain - G Suite 網域名稱,例如「domain.com」。
- 邀請:已受邀加入網站,但尚未加入網站的 ACL 的使用者。(如果指定了 gdata 1.3 或以下版本,則不適用)。
- default — 類型可能只有一種「default」類型,該範圍沒有值 (例如
<gAcl:scope type="default">
)。這個特定範圍可控制所有使用者預設在公開網站上 的存取權限。
注意:網域不能有 gAcl:role
值設為「owner」存取權,只能是讀取者或寫入者。
關於「邀請」範圍。
當您將一或多個使用者加入尚未擁有 Google 帳戶的 ACL 時,API 會傳回邀請範圍。這個 API 會傳回一個含有內嵌憑證的網址,您必須將該網址傳送給受邀的使用者,才能接受邀請。
這種邀請方式可讓您事先邀請非 Google 使用者,不必事先得知他們想要使用的電子郵件地址。只要使用者點選內含內嵌憑證的邀請網址,就能使用任何的電子郵件地址申請存取權。此外,多位使用者可能會使用這個網址接受邀請,因此若邀請單一使用者或一群使用者,這項功能就相當實用。
注意:「邀請」範圍僅適用於 gdata 1.4 以上版本。如果您明確指定 1.3 以下,這個變數將無法運作。
擷取 ACL 資訊提供
ACL 資訊提供可用於控制網站的共用權限,而且可透過以下 URI 存取:
https://sites.google.com/feeds/acl/site/domainName/siteName
資訊提供參數 | 說明 |
---|---|
domainName | 「site 」或您的 G Suite 代管網域 (例如 example.com )。 |
siteName | 網站的網頁空間名稱,顯示在網站的網址 (例如 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
傳送至 HTTP 動態饋給 URI 並傳送 HTTP 要求:
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 資訊提供中傳送 POST
要求,即可將新的角色插入網站的 ACL 資訊提供中,
注意:只有在網域已設為允許這類權限 (例如,在 G Suite 網域外的對象共用檔案的情況下啟用) 時,您才能共用特定共用 ACL。
以下範例會在協作平台中新增協作者 (寫入者):
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 會傳回一個網址,您必須將這個網址提供給您想邀請的使用者。按下網址後,就可以用現有的帳戶登入,或是建立新帳戶。
如果邀請成功,系統會傳回 201 Created
,以及含有您所指定網址的新項目:
<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 只能與 domain1.com 共用整個協作平台,不能與 domain2.com 共用。非由 G Suite 網域 (例如 http://sites.google.com/site/siteB) 代管的網站無法邀請網域。
修改共用權限
如要更新 ACL 項目,請視需要修改項目,並向該項目的 edit
連結發出 HTTP PUT
要求,而該連結只是 <link>
元素,其「rel」屬性設為「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
的角色變更為「讀取者」:
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 相符,則項目尚未變更,而伺服器會傳回 HTTP 304 Not Modified
狀態碼或 HTTP 412 Precodition Failed
狀態碼。這兩個狀態碼都代表您已經擷取的項目是最新的。
如果 ETag 不相符,則代表自您上次提出要求後,此項目已經過修改,且伺服器會傳回該項目。
如要進一步瞭解 ETag,請參閱 Google Data API 參考指南。
批次處理
批次要求可讓用戶端在單一要求中執行多項作業,而非個別提交作業。
伺服器會盡可能執行所有所要求的變更,並傳回可用來評估每項作業成功或失敗狀態的狀態資訊。如要進一步瞭解 Google Data API 中的批次處理,請參閱使用 Google Data API 進行批次處理。
批次資訊提供中的每個作業都有 <id> 元素 (插入作業除外)。
這個元素與您在更新、刪除或查詢內容資訊提供時通常會使用的要求網址相同。
舉例來說,如果您要更新編輯內容,請將相關項目的 <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=""YDgpeyI.""> <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=""YassseyI.""> <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=""YDgpsdfeyI."">
<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=""YDsseyI."">
<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=""YDkpeyI."">
<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>