應用程式可透過傳統版 Google Sites API 存取、發布及修改 Google 網站中的內容。 此外,應用程式可以要求最近活動清單、擷取修訂記錄,以及上傳/下載附件和檔案。
觀眾
本文假設您瞭解 Google Data APIs 通訊協定背後的一般概念。
本文適用於想編寫可與 Google 協作平台互動的用戶端應用程式的程式設計師。並提供一系列使用原始 XML/HTTP 的基本資料 API 互動範例,以及相關說明。閱讀本文後,您可以參閱左側導覽列中其他指南的語言專屬範例,進一步瞭解如何使用用戶端程式庫與 API 互動。
如要參考本指南中的資料,請參閱參考指南。
授權要求
如果應用程式要求存取非公開使用者資料,必須附上授權權杖。這個權杖也可讓 Google 識別您的應用程式。
關於授權通訊協定
您的應用程式必須使用 OAuth 2.0 對要求進行授權,系統不支援其他授權通訊協定。如果您的應用程式採用使用 Google 帳戶登入功能,系統會為您處理部分授權事項。
使用 OAuth 2.0 對要求進行授權
向 Google Sites Data 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 Suite 網域 example.com 下,建立採用「slate」主題的新 Google 協作平台。網站網址為 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 網站包含類別中繼資料,有助於分類網域中的網站。如要新增或更新類別中繼資料,請將包含 category 標記的 HTTP PUT 傳送至網站項目的 edit 連結。請參閱以下範例中的粗體行:
PUT /feeds/site/example.com/source-site HTTP/1.1 Host: sites.google.com GData-Version: 1.4 Authorization: <your authorization header here> <entry xmlns="http://www.w3.org/2005/Atom" xmlns:gAcl="http://schemas.google.com/acl/2007" xmlns:sites="http://schemas.google.com/sites/2008" xmlns:gs="http://schemas.google.com/spreadsheets/2006" xmlns:dc="http://purl.org/dc/terms" xmlns:batch="http://schemas.google.com/gdata/batch" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" gd:etag="W/"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 協作平台使用者將自己的網域對應至 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>
現有對應會顯示為 link,並附上 rel='webAddressMapping'。舉例來說,在上述範例中,有三個指向網站 http://sites.google.com/site/myOtherTestSite 的 webAddressMapping。
修改網址對應
注意:使用網址對應時,所有 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_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/"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 標頭,並參照授權要求中取得的權杖。
內容動態饋給
擷取內容
內容動態饋給會列出 Google 協作平台的現有內容。向下列網址傳送已驗證的 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 Protocol 參考資料。
以下說明對傳統版協作平台 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 查詢參數和傳統 Sites API 專屬參數,搜尋內容動態消息。如需更多詳細資訊和支援的完整參數清單,請參閱參考指南。
擷取特定項目種類
如要只擷取特定類型的項目,請使用 kind 參數。這個範例只會傳回 webpage 項目:
GET /feeds/content/domainName/siteName?kind=webpage
如要傳回多個項目類型,請以半形逗號「,」分隔每個 kind。以下範例會傳回 filecabinet 和 listpage 項目:
GET /feeds/content/domainName/siteName?kind=filecabinet,listpage
或者,您也可以使用 Google Data /-/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 Webpage Title」。也就是說,網址中的 <atom:title> 會正規化為 new-webpage-title。
如要自訂頁面的網址路徑,可以設定 <sites:pageName> 元素。
這個範例會建立新的 filecabinet,並將網頁標題設為「File Storage」,但會透過指定 <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>,如果沒有 pageName,則不得為空值。標準化是將空白字元修剪並摺疊為「-」,以及移除不符合a-z, A-Z, 0-9, -, _的字元。
舉例來說,伺服器會接受「Custom_Page2」。
建立子頁面
如要在父項頁面下建立子頁面 (子項),請在新的 Atom 項目中加入 <link rel="http://schemas.google.com/sites/2008#parent">。將連結的 href 屬性設為父項項目的自我連結。
這個範例會在項目 ID 為 PARENT_ENTRY_ID 的上層公告頁面下,建立標題為「announcement」的新 announcement。網頁內文的 XHTML 內容也包含在內:
POST /feeds/content/domainName/siteName HTTP/1.1 Host: sites.google.com GData-Version: 1.4 Authorization: <your authorization header here> Content-Length: 470 Content-Type: application/atom+xml <entry xmlns="http://www.w3.org/2005/Atom"> <category scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/sites/2008#announcement" label="announcement"/> <link rel="http://schemas.google.com/sites/2008#parent" type="application/atom+xml" href="https://sites.google.com/feeds/content/domainName/siteName/PARENT_ENTRY_ID"/> <title>announcement</title> <content type="xhtml"> <div xmlns="http://www.w3.org/1999/xhtml">This weekend. My place.</div> </content> </entry>
頁面範本
建立頁面範本
建立網頁範本的程序與建立新項目/網頁和建立子網頁相同。不同之處在於新增 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>
使用範本建立頁面
與建立頁面範本類似,您可以從範本例項化新頁面,方法是加入 <link>,並將 rel='http://schemas.google.com/sites/2008#template' 指向頁面範本的自我連結。
這個範例會根據現有的頁面範本 (定義 filecabinet) 建立新的 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 檔案」為標題建立,並附上「人資資料包」說明 (選填)。
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」和「nice colors」。
POST /feeds/content/domainName/siteName HTTP/1.1 Host: sites.google.com GData-Version: 1.4 Authorization: <your authorization header here> Content-Type: application/atom+xml Content-Length: 531 <entry xmlns="http://www.w3.org/2005/Atom"> <category scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/sites/2008#webattachment" label="webattachment"/> <link rel="http://schemas.google.com/sites/2008#parent" type="application/atom+xml" href="https://sites.google.com/feeds/content/domainName/siteName/FILECABINET_ENTRY_ID"/> <title>GoogleLogo</title> <summary>nice colors</summary> <content type="image/gif" src="http://www.google.com/images/logo.gif"></content> </entry>
POST 會在使用者檔案櫃中建立連結,指向「http://www.google.com/images/logo.gif」的圖片。
更新內容
只要對 edit 連結提出單一 PUT 要求,即可編輯任何網頁的中繼資料 (標題、pageName 等) 和網頁內容。
要求主體應包含描述更新網頁的 Atom 項目。不過,附件項目不在此限,這類項目只能用於更新附件的中繼資料。如要變更附加檔案的內容,只要將原始資料做為 PUT 要求的內容,傳送至附件的 edit-media 連結即可。您也可以使用 MIME 多部分要求,一次更新中繼資料和附加檔案內容。
如要確認更新不會覆寫其他用戶的變更,請加入原始項目的 ETag 值。方法是在 HTTP If-Match 標頭中提供 ETag 值,或在更新後的項目中加入原始項目的 gd:etag 屬性。如要判斷原始項目的 ETag 值,請檢查 <entry> 元素的 gd:etag 屬性。如果是媒體項目,媒體的 ETag 可能會顯示在 edit-media 連結的 gd:etag 屬性中。
如要更新項目,無論自您擷取項目後是否有人更新,請使用 If-Match: *,且不要加入 ETag。如要進一步瞭解 ETag,請參閱 Google Data API 參考指南。
更新項目的中繼資料或 HTML 內容
如要更新項目的中繼資料或 HTML 內容,請將 HTTP PUT 傳送至項目的 edit 連結。
以下範例說明如何更新 listpage 項目 (以 ID ENTRY_ID 表示),並進行下列變更:
- 標題修改為「Updated Content」(更新內容)
- 更新後的 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="Description"/> <gs:column index="C" name="Completed"/> </gs:data> <sites:pageName>newPagePath</sites:pageName> </entry>
注意:伺服器傳回的項目會包含比上述範例更多的元素。
替換附件內容
以下範例說明如何替換附件內容,但保留中繼資料不變。由於要求包含新內容,因此使用附件項目的 edit-media 連結。
PUT /feeds/media/content/domainName/siteName/ATTACHMENT_ENTRY_ID Host: sites.google.com GData-Version: 1.4 Authorization: <your authorization header here> Content-Length: 70581 Content-Type: application/msword ... doc contents here ...
更新附件中繼資料 + 內容
以下範例說明如何同時更新附件的中繼資料和內容。附件名稱會更新為「新標題」,內容也會替換為 .zip 檔案的內容。由於要求包含新的檔案內容,因此會使用附件項目的 edit-media 連結。
請注意,如果中繼資料包含 ETag,媒體內容也會隱含 If-Match,因為媒體內容的任何更新都會導致中繼資料的 ETag 變更。
PUT /feeds/media/content/domainName/siteName/ATTACHMENT_ENTRY_ID Host: sites.google.com GData-Version: 1.4 Authorization: <your authorization header here> Content-Type: multipart/related; boundary="END_OF_PART" --END_OF_PART Content-Type: application/atom+xml <?xml version='1.0' encoding='UTF-8'?> <entry xmlns="http://www.w3.org/2005/Atom" xmlns:gd="http://schemas.google.com/g/2005" gd:etag="BxAaTxRZAyp7ImBq"> <link rel="http://schemas.google.com/sites/2008#parent" type="application/atom+xml" href="https://sites.google.com/feeds/content/domainName/siteName/ATTACHMENT_ENTRY_ID"/> <title>New Title</title> </entry> --END_OF_PART Content-Type: application/zip ... zip contents here ... --END_OF_PART
刪除內容
如要從 Google 網站移除項目,請先擷取項目,然後將DELETE要求傳送至項目的 editURL。這個網址與更新項目中繼資料或 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 項目都代表特定實體的存取角色,包括使用者、使用者群組、網域或預設存取權 (即公開網站)。系統只會顯示具有明確存取權的實體項目,Google 協作平台 UI 分享畫面中「有權存取的使用者」面板中的每個電子郵件地址,都會顯示一個項目。因此,即使網域管理員具有網站的隱含存取權,系統也不會顯示他們。
角色
角色元素代表實體可擁有的存取層級。gAcl:role 元素有四個可能的值:
- 讀取者:檢視者 (等同於唯讀存取權)。
- writer:協作者 (等同於讀取/寫入權限)。
- 擁有者:通常是網站管理員 (相當於讀取/寫入權限)。
範圍
範圍元素代表具有這個存取層級的實體。gAcl:scope 元素有五種可能類型:
- 使用者:電子郵件地址值,例如「user@gmail.com」。
- 群組:Google 網路論壇電子郵件地址,例如「group@domain.com」。
- domain:G Suite 網域名稱,例如「domain.com」。
- 邀請:已受邀加入網站,但尚未新增至網站 ACL 的使用者。(如果指定 gdata 1.3 以下版本,則無法使用)。
- default:類型為「default」的範圍只有一個,且沒有值 (例如
<gAcl:scope type="default">)。這個特定範圍會控管任何使用者在公開網站上的預設存取權。
注意:網域的 gAcl:role 值無法設為「擁有者」存取權,只能是讀者或寫手。
關於「邀請」範圍。
當您將一或多位沒有 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 傳送至 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 會傳回網址,您必須將該網址提供給要邀請的使用者。點選網址後,他們就能登入現有帳戶或建立新帳戶,以存取網站。
成功邀請會傳回 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 屬性中找到該 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>