Google Sites API แบบคลาสสิกอนุญาตให้แอปพลิเคชันเข้าถึง เผยแพร่ และแก้ไขเนื้อหาภายใน Google Site นอกจากนี้ แอปพลิเคชันยังขอรายการกิจกรรมล่าสุด ดึงข้อมูลประวัติการแก้ไข และอัปโหลด/ดาวน์โหลดไฟล์แนบและไฟล์ได้ด้วย
กลุ่มเป้าหมาย
เอกสารนี้ถือว่าคุณเข้าใจแนวคิดทั่วไปเบื้องหลังโปรโตคอล Google Data APIs
เอกสารนี้มีไว้สำหรับโปรแกรมเมอร์ที่ต้องการเขียนแอปพลิเคชันไคลเอ็นต์ที่โต้ตอบกับ Google Sites ได้ โดยจะแสดงตัวอย่างการโต้ตอบ API ข้อมูลพื้นฐานโดยใช้ XML/HTTP ดิบ พร้อมคำอธิบาย หลังจากอ่านเอกสารนี้แล้ว คุณจะดูข้อมูลเพิ่มเติมเกี่ยวกับการโต้ตอบกับ API โดยใช้ไลบรารีของไคลเอ็นต์ได้โดยอ่าน ตัวอย่างเฉพาะภาษาที่อยู่ในคำแนะนำอื่นๆ ในแถบนำทางด้านซ้าย
ดูข้อมูลอ้างอิงของเนื้อหาในคู่มือนี้ได้ที่คู่มืออ้างอิง
การอนุญาตคำขอ
เมื่อแอปพลิเคชันขอข้อมูลผู้ใช้ที่ไม่ใช่ข้อมูลสาธารณะ แอปจะต้องมีโทเค็นการให้สิทธิ์ โทเค็นดังกล่าวจะระบุตัวตนแอปพลิเคชันของคุณให้ Google ทราบด้วย
เกี่ยวกับโปรโตคอลการให้สิทธิ์
แอปพลิเคชันต้องใช้ OAuth 2.0 เพื่อให้สิทธิ์คำขอ ระบบไม่รองรับโปรโตคอลการให้สิทธิ์อื่นๆ หากแอปพลิเคชันใช้ลงชื่อเข้าใช้ด้วย Google ระบบจะจัดการการให้สิทธิ์บางส่วนแก่คุณ
การให้สิทธิ์คำขอด้วย OAuth 2.0
คำขอที่ส่งไปยัง Google Sites Data API สำหรับข้อมูลผู้ใช้ที่ไม่ใช่แบบสาธารณะจะต้องได้รับสิทธิ์จากผู้ใช้ที่ตรวจสอบสิทธิ์แล้ว
รายละเอียดของกระบวนการให้สิทธิ์หรือ "ขั้นตอน" ของ OAuth 2.0 จะแตกต่างกันไปโดยขึ้นอยู่กับประเภทของแอปพลิเคชันที่คุณเขียน แอปพลิเคชันทุกประเภทจะใช้กระบวนการทั่วไปต่อไปนี้
- เมื่อสร้างแอปพลิเคชัน คุณจะลงทะเบียนแอปได้โดยใช้คอนโซล Google API จากนั้น Google จะให้ข้อมูลที่คุณต้องใช้ในภายหลัง เช่น รหัสไคลเอ็นต์และรหัสลับไคลเอ็นต์
- เปิดใช้งาน Google Sites Data API ในคอนโซล Google API (หากไม่เห็น API ดังกล่าวในคอนโซล API ให้ข้ามขั้นตอนนี้ไป)
- เมื่อแอปพลิเคชันต้องการเข้าถึงข้อมูลผู้ใช้ แอปจะขอขอบเขตการเข้าถึงที่จำเป็นจาก Google
- Google จะแสดงหน้าจอขอคำยินยอมแก่ผู้ใช้เพื่อขอให้ผู้ใช้ให้สิทธิ์แอปพลิเคชันของคุณในการขอข้อมูลบางอย่างของผู้ใช้
- หากผู้ใช้อนุมัติ Google จะให้โทเค็นเพื่อการเข้าถึงที่มีอายุชั่วคราวแก่แอปพลิเคชันของคุณ
- แอปพลิเคชันขอข้อมูลผู้ใช้โดยแนบโทเค็นเพื่อการเข้าถึงไปกับคำขอ
- หาก Google ตัดสินว่าคำขอและโทเค็นของคุณถูกต้อง ระบบจะแสดงข้อมูลที่ขอ
บางกระบวนการจะมีขั้นตอนเพิ่มเติม เช่น การใช้โทเค็นการรีเฟรชเพื่อขอโทเค็นเพื่อการเข้าถึงใหม่ ดูข้อมูลอย่างละเอียดเกี่ยวกับกระบวนการของแอปพลิเคชันประเภทต่างๆ ได้ที่เอกสารประกอบเกี่ยวกับ OAuth 2.0 ของ Google
ข้อมูลขอบเขตของ OAuth 2.0 สำหรับ Google Sites Data API มีดังต่อไปนี้
https://sites.google.com/feeds/
หากต้องการขอสิทธิ์โดยใช้ OAuth 2.0 แอปพลิเคชันของคุณต้องมีข้อมูลขอบเขต รวมถึงข้อมูลที่ Google ให้คุณตอนลงทะเบียนแอปพลิเคชัน (เช่น รหัสไคลเอ็นต์และรหัสลับไคลเอ็นต์)
การระบุเวอร์ชัน
ทุกคำขอที่คุณส่งไปยัง Google Sites Data API ควรระบุเวอร์ชัน 1.4 หากต้องการระบุหมายเลขเวอร์ชัน
ให้ใช้ส่วนหัว HTTP ของ GData-Version ดังนี้
GData-Version: 1.4
หรือหากตั้งค่าส่วนหัว HTTP ไม่ได้ คุณจะระบุ v=1.4 เป็นพารามิเตอร์การค้นหาใน URL ได้ แต่เราขอแนะนำให้ใช้
ส่วนหัว HTTP หากเป็นไปได้
หมายเหตุ: ไลบรารีของไคลเอ็นต์จะระบุส่วนหัวของเวอร์ชันที่เหมาะสมโดยอัตโนมัติ ดังนั้นจึงไม่ควร
ใช้พารามิเตอร์การค้นหา v=1.4 เมื่อใช้ไลบรารีของไคลเอ็นต์
ฟีดของเว็บไซต์
ฟีดเว็บไซต์ใช้เพื่อแสดงรายการเว็บไซต์ Google ที่ผู้ใช้เป็นเจ้าของหรือมีสิทธิ์ดู และแก้ไขชื่อของเว็บไซต์ที่มีอยู่ได้ สำหรับโดเมน G Suite คุณยังใช้เพื่อสร้างหรือคัดลอก ทั้งเว็บไซต์ได้ด้วย
เว็บไซต์ข้อมูล
หากต้องการแสดงรายการเว็บไซต์ที่ผู้ใช้มีสิทธิ์เข้าถึง ให้ส่งGETคำขอที่ผ่านการตรวจสอบสิทธิ์ไปยัง URL ต่อไปนี้
https://sites.google.com/feeds/site/domainName| พารามิเตอร์ฟีด | คำอธิบาย |
|---|---|
domainName | 'site' หรือโดเมนของโดเมนที่โฮสต์ G Suite (เช่น example.com) |
การตอบกลับจะมีฟีดที่มีรายการเว็บไซต์ดังนี้
GET /feeds/site/domainName HTTP/1.1 Host: sites.google.com GData-Version: 1.4 Authorization: <your authorization header here> HTTP/1.1 200 OK <feed xmlns="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:gAcl="http://schemas.google.com/acl/2007" xmlns:sites="http://schemas.google.com/sites/2008" xmlns:gs="http://schemas.google.com/spreadsheets/2006" xmlns:dc="http://purl.org/dc/terms" xmlns:batch="http://schemas.google.com/gdata/batch" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0"> <id>https://sites.google.com/feeds/site/site</id> <updated>2009-12-02T17:47:34.406Z</updated> <title>Site</title> <link rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml" href="https://sites.google.com/feeds/site/site"/> <link rel="http://schemas.google.com/g/2005#post" type="application/atom+xml" href="https://sites.google.com/feeds/feeds/site/domainName"/> <link rel="self" type="application/atom+xml" href="https://sites.google.com/feeds/site/domainName"/> <link rel="next" type="application/atom+xml" href="https://sites.google.com/feeds/site/domainName/?start-index=2"/> <generator version="1" uri="http://sites.google.com/">Google Sites</generator> <openSearch:startIndex>1</openSearch:startIndex> <entry gd:etag="W/"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>
คำขอข้างต้นจะสร้างเว็บไซต์ Google ใหม่ที่มีธีม "Slate" ภายใต้โดเมน G Suite example.com
URL ของเว็บไซต์จะเป็น http://sites.google.com/a/example.com/source-site/
หากสร้างเว็บไซต์สำเร็จ เซิร์ฟเวอร์จะตอบกลับด้วย 201 Created
รายการการตอบกลับจะมีองค์ประกอบที่เซิร์ฟเวอร์เพิ่ม เช่น ลิงก์ไปยังเว็บไซต์ ลิงก์ไปยังฟีด ACL ของเว็บไซต์ ชื่อเว็บไซต์ ชื่อ และข้อมูลสรุป
<entry xmlns="http://www.w3.org/2005/Atom" xmlns:gAcl="http://schemas.google.com/acl/2007"
xmlns:sites="http://schemas.google.com/sites/2008" xmlns:gs="http://schemas.google.com/spreadsheets/2006"
xmlns:dc="http://purl.org/dc/terms" xmlns:batch="http://schemas.google.com/gdata/batch"
xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0"
gd:etag="W/"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 เท่านั้น
คุณสามารถทำซ้ำเว็บไซต์ที่มีอยู่ได้ในลักษณะเดียวกับการสร้างเว็บไซต์ใหม่ อย่างไรก็ตาม ในรายการ Atom ของPOSTคำขอ
ให้ใส่ <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 Sites
- คุณสามารถคัดลอกเว็บไซต์จากโดเมนอื่นได้หากคุณเป็นเจ้าของเว็บไซต์ต้นทาง
การอัปเดตข้อมูลเมตาของเว็บไซต์
หากต้องการอัปเดตชื่อหรือข้อมูลสรุปของเว็บไซต์ ให้ส่ง HTTP PUT ไปยังลิงก์ edit ของรายการเว็บไซต์
ตัวอย่างเช่น ตัวอย่างต่อไปนี้จะอัปเดตชื่อของเว็บไซต์ก่อนหน้าเป็น New Test Site2 และคำอธิบายเป็น Newer description
PUT /feeds/site/example.com/source-site HTTP/1.1 Host: sites.google.com GData-Version: 1.4 Authorization: <your authorization header here> <entry xmlns="http://www.w3.org/2005/Atom" xmlns:gAcl="http://schemas.google.com/acl/2007" xmlns:sites="http://schemas.google.com/sites/2008" xmlns:gs="http://schemas.google.com/spreadsheets/2006" xmlns:dc="http://purl.org/dc/terms" xmlns:batch="http://schemas.google.com/gdata/batch" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" gd:etag="W/"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 ไปยังลิงก์ edit ของรายการเว็บไซต์ที่มีแท็ก category ดูบรรทัดที่เป็นตัวหนาในตัวอย่างต่อไปนี้
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>
ตัวอย่างนี้เพิ่ม 2 หมวดหมู่ ได้แก่ "เว็บไซต์ของทีม" และ "ฝ่ายกฎหมาย"
การจับคู่ที่อยู่เว็บ
การแมปที่อยู่เว็บช่วยให้ผู้ใช้ Sites แมปโดเมนของตนเองกับ Google Site ได้ เช่น ใช้ 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' เช่น ในตัวอย่างข้างต้น
มี webAddressMapping 3 รายการที่ชี้ไปยังเว็บไซต์
http://sites.google.com/site/myOtherTestSite
การแก้ไขการจับคู่ที่อยู่เว็บ
หมายเหตุ: การดำเนินการ GET/POST/PUT ทั้งหมดควรระบุพารามิเตอร์ with-mappings=true เมื่อทำงาน
กับการแมปที่อยู่เว็บ หากไม่มีพารามิเตอร์ ระบบจะไม่แสดง webAddressMapping ในรายการเว็บไซต์ (GET) หรือพิจารณา
เมื่ออัปเดต/นำ (PUT) การแมปออกจากรายการ
หากต้องการเพิ่ม อัปเดต หรือลบการแมป เพียงระบุ เปลี่ยนแปลง หรือนำลิงก์ดังกล่าวออกเมื่อสร้างเว็บไซต์ใหม่หรืออัปเดตข้อมูลเมตาของเว็บไซต์ ต้องใส่พารามิเตอร์ with-mappings=true ไว้ใน URI ของฟีดเว็บไซต์
หมายเหตุ: หากต้องการอัปเดตการแมปที่อยู่ คุณต้องเป็นผู้ดูแลระบบเว็บไซต์หรือผู้ดูแลระบบโดเมนในกรณีที่เป็นเว็บไซต์ที่โฮสต์ใน G Suite
เช่น คำขอต่อไปนี้จะอัปเดต http://www.mysitemapping.com เป็น http://www.my-new-sitemapping.com
และนำ http://www.mysitemapping2.com ออกโดยไม่ใส่ลิงก์ในรายการ
PUT /feeds/site/domainName?with-mappings=true HTTP/1.1 Host: sites.google.com GData-Version: 1.4 Authorization: <your authorization header here> <entry gd:etag="W/"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 ไปยัง URL ของฟีดกิจกรรม
https://sites.google.com/feeds/activity/domainName/siteName
| พารามิเตอร์ฟีด | คำอธิบาย |
|---|---|
domainName | 'site' หรือโดเมนของโดเมนที่โฮสต์ G Suite (เช่น example.com) |
siteName | ชื่อพื้นที่เว็บของเว็บไซต์ ซึ่งอยู่ใน URL ของเว็บไซต์ (เช่น myCoolSite) |
ตัวอย่างคำขอและการตอบกลับ
GET /feeds/activity/site/siteName HTTP/1.1 Host: sites.google.com GData-Version: 1.4 Authorization: <your authorization header here> HTTP/1.1 200 OK <?xml version="1.0" encoding="UTF-8"?> <feed xmlns="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/"> <id>https://sites.google.com/feeds/activity/site/siteName</id> <updated>2009-09-10T05:24:23.120Z</updated> <title>Activity</title> <link rel="alternate" type="text/html" href="http://sites.google.com/site/siteName/system/app/pages/recentChanges"/> <link rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml" href="https://sites.google.com/feeds/activity/site/siteName"/> <link rel="self" type="application/atom+xml" href="https://sites.google.com/feeds/activity/site/siteName"/> <generator version="1" uri="http://sites.google.com">Google Sites</generator> <openSearch:startIndex>1</openSearch:startIndex> <entry xmlns:gd="http://schemas.google.com/g/2005" gd:etag="W/"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 | ชื่อพื้นที่เว็บของเว็บไซต์ ซึ่งอยู่ใน URL ของเว็บไซต์ (เช่น myCoolSite) |
หากต้องการค้นหาลิงก์การแก้ไขสำหรับหน้า/ความคิดเห็น/ไฟล์แนบ/รายการที่ต้องการ ให้ดึงข้อมูลรายการจากฟีดเนื้อหาโดยใช้ CONTENT_ENTRY_ID ก่อน รายการที่ดึงมาจะมี <atom:link> ไปยังฟีดการแก้ไข
เช่น
<link rel="http://schemas.google.com/sites/2008#revision" type="application/atom+xml"
href="https://sites.google.com/feeds/revision/domainName/siteName/CONTENT_ENTRY_ID"/>
ตัวอย่างคำขอและการตอบกลับ
GET /feeds/revision/domainName/siteName/CONTENT_ENTRY_ID HTTP/1.1 Host: sites.google.com GData-Version: 1.4 Authorization: <your authorization header here> HTTP/1.1 200 OK <?xml version="1.0" encoding="UTF-8"?> <feed xmlns="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:sites="http://schemas.google.com/sites/2008" xmlns:gs="http://schemas.google.com/spreadsheets/2006" xmlns:dc="http://purl.org/dc/terms" xmlns:batch="http://schemas.google.com/gdata/batch" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0"> <id>https://sites.google.com/feeds/revision/domainName/siteName/CONTENT_ENTRY_ID</id> <updated>2009-09-10T04:33:35.337Z</updated> <title>Revisions</title> <link rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml" href="https://sites.google.com/feeds/revision/domainName/siteName/CONTENT_ENTRY_ID"/> <link rel="self" type="application/atom+xml" href="https://sites.google.com/feeds/revision/domainName/siteName/CONTENT_ENTRY_ID"/> <generator version="1" uri="http://sites.google.com">Google Sites</generator> <openSearch:startIndex>1</openSearch:startIndex> <entry gd:etag="W/"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 ที่มีการตรวจสอบสิทธิ์ไปยัง URL ต่อไปนี้
https://sites.google.com/feeds/content/domainName/siteName
| พารามิเตอร์ฟีด | คำอธิบาย |
|---|---|
domainName | 'site' หรือโดเมนของโดเมนที่โฮสต์ G Suite (เช่น example.com) |
siteName | ชื่อพื้นที่เว็บของเว็บไซต์ ซึ่งอยู่ใน URL ของเว็บไซต์ (เช่น myCoolSite) |
ผลลัพธ์คือฟีดที่แสดงรายการหน้าแรกของรายการเนื้อหาในเว็บไซต์ แต่ละรายการในฟีดจะแสดงถึงรายการเนื้อหาประเภทต่างๆ เช่น webpage, filecabinet, attachment, comment เป็นต้น โดยองค์ประกอบ <category scheme="http://schemas.google.com/g/2005#kind"> จะกำหนดประเภทของรายการ ดูรายการค่า kind ที่รองรับได้ในคู่มืออ้างอิง
หมายเหตุ: ฟีดนี้อาจต้องมีการตรวจสอบสิทธิ์หรือไม่ก็ได้ ทั้งนี้ขึ้นอยู่กับสิทธิ์การแชร์ของเว็บไซต์
หากเว็บไซต์เป็นแบบไม่สาธารณะ ลูกค้าต้องส่งส่วนหัว Authorization ที่ถูกต้อง (ตามที่เห็นในตัวอย่างด้านบน)
และอ้างอิงโทเค็นที่ได้รับในการให้สิทธิ์คำขอ
GET /feeds/content/domainName/siteName HTTP/1.1 Host: sites.google.com GData-Version: 1.4 Authorization: <your authorization header here> HTTP/1.1 200 OK <?xml version="1.0" encoding="UTF-8"?> <feed xmlns="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:sites="http://schemas.google.com/sites/2008" xmlns:gs="http://schemas.google.com/spreadsheets/2006" xmlns:dc="http://purl.org/dc/terms" xmlns:batch="http://schemas.google.com/gdata/batch" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0"> <id>https://sites.google.com/feeds/content/domainName/siteName</id> <updated>2009-08-31T01:39:20.286Z</updated> <title>Content</title> <link rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml" href="https://sites.google.com/feeds/content/domainName/siteName"/> <link rel="http://schemas.google.com/g/2005#post" type="application/atom+xml" href="https://sites.google.com/feeds/content/domainName/siteName"/> <link rel="self" type="application/atom+xml" href="https://sites.google.com/feeds/content/domainName/siteName"/> <link rel="http://schemas.google.com/g/2005#batch" type="application/atom+xml" href="https://sites.google.com/feeds/content/domainName/siteName/batch""/> <link rel="next" type="application/atom+xml" href="https://sites.google.com/feeds/content/domainName/siteName/?start-index=2"/> <generator version="1" uri="http://sites.google.com">Google Sites</generator> <openSearch:startIndex>1</openSearch:startIndex> <entry gd:etag="W/"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
องค์ประกอบที่มีความหมายเฉพาะสำหรับ Classic Sites API จะอธิบายไว้ด้านล่าง รายการบางประเภทจะมีพร็อพเพอร์ตี้เพิ่มเติม (ไม่ได้ระบุไว้ด้านล่าง) ในขณะที่รายการอื่นๆ จะไม่มี เช่น รายการ listitem อาจมีองค์ประกอบ <gs:field> ในขณะที่รายการ webpage ไม่มี
| องค์ประกอบ | คำอธิบาย |
|---|---|
<content ...> | ข้อความด้านในคือเนื้อหา HTML ของหน้าเว็บ สำหรับบางรายการ (เช่น ไฟล์แนบ) องค์ประกอบนี้จะมีแอตทริบิวต์ src ที่ชี้ไปยังไฟล์ |
<link rel="alternate" ...> | ลิงก์ไปยังหน้าหรือรายการใน Google Sites |
<link rel="http://schemas.google.com/sites/2008#revision" ...> | แอตทริบิวต์ href ชี้ไปยังฟีดการแก้ไขของรายการ |
<link rel="http://schemas.google.com/sites/2008#parent" ...> | แอตทริบิวต์ href ชี้ไปยังรายการระดับบนของรายการ |
<link rel="http://schemas.google.com/sites/2008#template" ...> | แอตทริบิวต์ href ชี้ไปยังหน้าเทมเพลตของรายการ |
<category scheme="http://schemas.google.com/g/2005#kind" ...> | label คือประเภทของรายการ |
<category term="http://schemas.google.com/g/2005#template" ...> | label=template ซึ่งหมายความว่ารายการนั้นเป็นเทมเพลต |
<gd:feedLink> | แอตทริบิวต์ href จะชี้ไปยังรายการย่อยของรายการหลัก |
<sites:pageName> | ชื่อพื้นที่เว็บของหน้าเว็บ ซึ่งสอดคล้องกับชื่อใน URL ของหน้าเว็บ |
<sites:revision> | หมายเลขการแก้ไขปัจจุบัน |
ตัวอย่างการค้นหาฟีดเนื้อหา
คุณค้นหาฟีดเนื้อหาได้โดยใช้พารามิเตอร์การค้นหา API มาตรฐานของ Google Data และพารามิเตอร์ที่เฉพาะเจาะจงสำหรับ Classic Sites API ดูข้อมูลโดยละเอียดเพิ่มเติมและรายการพารามิเตอร์ที่รองรับทั้งหมดได้ในคู่มืออ้างอิง
การดึงข้อมูลรายการบางประเภท
หากต้องการดึงข้อมูลเฉพาะรายการประเภทใดประเภทหนึ่ง ให้ใช้พารามิเตอร์ kind ตัวอย่างนี้จะแสดงเฉพาะรายการ webpage
GET /feeds/content/domainName/siteName?kind=webpage
หากต้องการแสดงผลประเภทรายการมากกว่า 1 รายการ ให้คั่นแต่ละ 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 Sites คุณสามารถใช้พารามิเตอร์ path เพื่อดึงข้อมูลหน้าเว็บนั้นได้
ตัวอย่างนี้จะแสดงหน้าเว็บที่อยู่ใน
http://sites.google.com/site/siteName/path/to/the/page
GET /feeds/content/domainName/siteName?path=/path/to/the/page
การดึงข้อมูลรายการทั้งหมดภายใต้หน้าหลัก
หากทราบรหัสรายการของหน้าเว็บ คุณสามารถใช้พารามิเตอร์ 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
การสร้างเนื้อหา
คุณสร้างเนื้อหาใหม่ (หน้าเว็บ, หน้า Listpage, หน้า Filecabinet, หน้าประกาศ ฯลฯ) ได้โดยส่ง HTTP POST
ไปยังฟีดเนื้อหา
https://sites.google.com/feeds/content/domainName/siteName
ดูรายการประเภทรายการที่รองรับได้ในพารามิเตอร์ kind ในคู่มืออ้างอิง
การสร้างรายการ / หน้าใหม่
ตัวอย่างนี้สร้าง webpage ใหม่ภายใต้ระดับบนสุดของเว็บไซต์ รวมถึง XHTML บางส่วนสำหรับเนื้อหาของหน้าเว็บ
และตั้งค่าชื่อส่วนหัวเป็น "ชื่อหน้าเว็บใหม่"
POST /feeds/content/domainName/siteName HTTP/1.1 Host: sites.google.com GData-Version: 1.4 Authorization: <your authorization header here> Content-Length: 328 Content-Type: application/atom+xml <entry xmlns="http://www.w3.org/2005/Atom"> <category scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/sites/2008#webpage" label="webpage"/> <title>New Webpage Title</title> <content type="xhtml"> <div xmlns="http://www.w3.org/1999/xhtml">HTML body goes here</div> </content> </entry>
หากสำเร็จ เซิร์ฟเวอร์จะตอบกลับด้วย 201 Created และสำเนาของรายการ
การสร้างรายการ/หน้าเว็บภายใต้เส้นทาง URL ที่กำหนดเอง
โดยค่าเริ่มต้น ตัวอย่างก่อนหน้าจะสร้างขึ้นภายใต้ URL
http://sites.google.com/domainName/siteName/new-webpage-title และ
มีส่วนหัวของหน้าเป็น "ชื่อหน้าเว็บใหม่" กล่าวคือ ระบบจะทำให้ <atom:title> อยู่ในค่าปกติเป็น new-webpage-title สำหรับ URL
หากต้องการปรับแต่งเส้นทาง URL ของหน้าเว็บ คุณสามารถตั้งค่าองค์ประกอบ <sites:pageName> ได้
ตัวอย่างนี้สร้าง filecabinet ใหม่ที่มีส่วนหัวของหน้าเป็น "ที่เก็บไฟล์" แต่สร้างหน้าภายใต้ URL http://sites.google.com/domainName/siteName/files โดยการระบุองค์ประกอบ <sites:pageName>
POST /feeds/content/domainName/siteName HTTP/1.1 Host: sites.google.com GData-Version: 1.4 Authorization: <your authorization header here> Content-Length: 393 Content-Type: application/atom+xml <entry xmlns="http://www.w3.org/2005/Atom" xmlns:sites="http://schemas.google.com/sites/2008"> <category scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/sites/2008#filecabinet" label="filecabinet"/> <title>File Storage</title> <content type="xhtml"> <div xmlns="http://www.w3.org/1999/xhtml">A list of files is below.</div> </content> <sites:pageName>files</sites:pageName> </entry>
เซิร์ฟเวอร์ใช้กฎลำดับความสำคัญต่อไปนี้ในการตั้งชื่อเส้นทาง URL ของหน้าเว็บ
<sites:pageName>หากมี ต้องเป็นไปตามa-z, A-Z, 0-9, -, _<atom:title>ต้องไม่ใช่ Null หากไม่มี pageName การทำให้เป็นมาตรฐานคือการตัด + ยุบช่องว่างให้เป็น "-" และ นำอักขระที่ไม่ตรงกับa-z, A-Z, 0-9, -, _ออก
เช่น เซิร์ฟเวอร์จะยอมรับ "Custom_Page2"
การสร้างหน้าย่อย
หากต้องการสร้างหน้าย่อย (หน้าลูก) ภายใต้หน้าหลัก ให้ใส่ <link rel="http://schemas.google.com/sites/2008#parent"> ในรายการ Atom ใหม่
ตั้งค่าแอตทริบิวต์ href ของลิงก์เป็นลิงก์ด้วยตนเองของรายการระดับบน
ตัวอย่างนี้สร้าง announcement ใหม่ที่มีส่วนหัว "ประกาศ" ภายใต้หน้าประกาศหลักที่มีรหัสรายการ PARENT_ENTRY_ID นอกจากนี้ ยังมีเนื้อหา XHTML สำหรับส่วนเนื้อหาของหน้าเว็บด้วย
POST /feeds/content/domainName/siteName HTTP/1.1 Host: sites.google.com GData-Version: 1.4 Authorization: <your authorization header here> Content-Length: 470 Content-Type: application/atom+xml <entry xmlns="http://www.w3.org/2005/Atom"> <category scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/sites/2008#announcement" label="announcement"/> <link rel="http://schemas.google.com/sites/2008#parent" type="application/atom+xml" href="https://sites.google.com/feeds/content/domainName/siteName/PARENT_ENTRY_ID"/> <title>announcement</title> <content type="xhtml"> <div xmlns="http://www.w3.org/1999/xhtml">This weekend. My place.</div> </content> </entry>
เทมเพลตของหน้าเว็บ
การสร้างเทมเพลตหน้าเว็บ
กระบวนการสร้างเทมเพลตหน้าเว็บจะเหมือนกับการสร้างรายการ/หน้าเว็บใหม่และ
การสร้างหน้าย่อย ความแตกต่างคือการเพิ่ม 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หน้าใหม่จากเทมเพลตหน้าที่มีอยู่ซึ่งกำหนดตู้เก็บเอกสาร
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> ไว้ เซิร์ฟเวอร์จะปฏิเสธ
การอัปโหลดไฟล์
API นี้ช่วยให้คุณอัปโหลดไฟล์แนบไปยังหน้าจัดการไฟล์และหน้าหลักได้เช่นเดียวกับใน Google Sites
หากต้องการอัปโหลดไฟล์แนบไปยังผู้ปกครอง ให้ส่งคำขอ HTTP POST ไปยัง URL ของฟีดเนื้อหา
https://sites.google.com/feeds/content/domainName/siteName
ส่วนเนื้อหาของ POST ควรเป็นคำขอแบบหลายส่วนของ MIME เพื่อรวมเนื้อหาไฟล์กับ
<atom:entry> ที่มีข้อมูลเมตาของไฟล์แนบ <atom:entry> ควรลิงก์ไปยังลิงก์ตัวเองของรายการหลักเพื่อระบุตำแหน่งที่จะสร้างไฟล์แนบ
ดูข้อมูลเพิ่มเติมได้ที่การสร้างหน้าย่อย
กำลังอัปโหลดไฟล์แนบ
ตัวอย่างการอัปโหลดไฟล์ PDF ไปยังตู้เก็บเอกสารที่มีรหัส 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">ไฟล์แนบในเว็บ
ไฟล์แนบในเว็บเป็นไฟล์แนบประเภทพิเศษ โดยพื้นฐานแล้ว ลิงก์เหล่านี้คือลิงก์ไปยังไฟล์อื่นๆ บนเว็บ ซึ่งคุณสามารถเพิ่มลงในข้อมูลของตู้เก็บไฟล์ได้ ฟีเจอร์นี้คล้ายกับวิธีการอัปโหลด "เพิ่มไฟล์ด้วย URL" ใน UI ของ Google Sites
หมายเหตุ: คุณจะสร้างไฟล์แนบจากเว็บได้ในตู้เก็บเอกสารเท่านั้น และอัปโหลดไปยังหน้าประเภทอื่นไม่ได้
ตัวอย่างนี้สร้าง webattachment ภายใต้ตู้เก็บเอกสารที่อ้างอิงโดยรหัส FILECABINET_ENTRY_ID
โดยระบบจะตั้งชื่อและคำอธิบาย (ไม่บังคับ) เป็น "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'
การอัปเดตเนื้อหา
คุณสามารถแก้ไขข้อมูลเมตา (ชื่อ, pageName ฯลฯ) และเนื้อหาของหน้าเว็บใดก็ได้ด้วยPUTคำขอเดียวไปยังeditลิงก์
เนื้อหาของคำขอควรมีรายการ Atom ที่อธิบายหน้าเว็บที่อัปเดต ข้อยกเว้นของกฎนี้คือรายการไฟล์แนบ ซึ่งจะใช้ได้เฉพาะในการอัปเดตข้อมูลเมตาของไฟล์แนบเท่านั้น
หากต้องการเปลี่ยนเนื้อหาของไฟล์ที่แนบมา เพียงใส่ข้อมูลดิบเป็นเนื้อหาของคำขอ PUT ไปยังedit-mediaลิงก์ของไฟล์แนบ นอกจากนี้ คุณยังอัปเดตทั้งข้อมูลเมตาและเนื้อหาไฟล์ที่แนบมาพร้อมกันได้โดยใช้คำขอแบบหลายส่วน MIME
หากต้องการยืนยันว่าการอัปเดตของคุณจะไม่เขียนทับการเปลี่ยนแปลงของไคลเอ็นต์รายอื่น ให้ระบุค่า ETag ของรายการเดิม คุณทำได้โดยระบุค่า ETag ในส่วนหัว If-Match ของ HTTP หรือโดยใส่แอตทริบิวต์ gd:etag ของรายการเดิมในรายการที่อัปเดต หากต้องการระบุค่า ETag ของรายการเดิม ให้ตรวจสอบแอตทริบิวต์ gd:etag ขององค์ประกอบ <entry>
สำหรับรายการสื่อ คุณอาจดู ETag ของสื่อได้ในแอตทริบิวต์ gd:etag ของลิงก์ edit-media
หากต้องการอัปเดตรายการไม่ว่าจะมีผู้อื่นอัปเดตรายการดังกล่าวตั้งแต่ที่คุณดึงข้อมูลมาหรือไม่ ให้ใช้
If-Match: * และไม่ต้องระบุ ETag ดูข้อมูลเพิ่มเติมเกี่ยวกับ ETag ได้ที่คู่มืออ้างอิง Google Data APIs
การอัปเดตข้อมูลเมตาหรือเนื้อหา HTML ของรายการ
หากต้องการอัปเดตข้อมูลเมตาหรือเนื้อหา HTML ของรายการ ให้ส่ง HTTP PUT ไปยังลิงก์ edit ของรายการ
ต่อไปนี้เป็นตัวอย่างการอัปเดตรายการ listpage (แสดงด้วยรหัส ENTRY_ID) ด้วยการเปลี่ยนแปลงต่อไปนี้
- ระบบจะแก้ไขชื่อเป็น "เนื้อหาที่อัปเดต"
- เนื้อหา HTML ที่อัปเดต
- ระบบจะอัปเดตส่วนหัวของคอลัมน์แรกของรายการเป็น "เจ้าของ"
- องค์ประกอบ
<sites:pageName>จะแก้ไขเส้นทาง URL ของหน้าเว็บ
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 Sites ให้ดึงข้อมูลรายการก่อน แล้วส่งDELETE
คำขอไปยัง URL ของeditรายการ นี่คือ URL เดียวกันที่ใช้เมื่ออัปเดตข้อมูลเมตาหรือเนื้อหา 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
หากต้องการตรวจสอบว่าคุณไม่ได้ลบรายการที่ไคลเอ็นต์อื่นเปลี่ยนแปลงไปแล้วตั้งแต่ที่คุณดึงข้อมูลมา ให้ใส่ส่วนหัว HTTP If-Match ที่มีค่า ETag ของรายการเดิม คุณกำหนดค่า ETag ของรายการเดิมได้โดยตรวจสอบแอตทริบิวต์ gd:etag ขององค์ประกอบ <entry>
หากต้องการลบรายการไม่ว่าจะมีผู้อื่นอัปเดตรายการดังกล่าวตั้งแต่ที่คุณดึงข้อมูลหรือไม่ก็ตาม ให้ใช้
If-Match: * และไม่ต้องระบุ ETag (ในกรณีนี้ คุณไม่จำเป็นต้องดึงข้อมูลรายการก่อนที่จะลบ)
ดูข้อมูลเพิ่มเติมเกี่ยวกับ ETag ได้ที่คู่มืออ้างอิง Google Data APIs
การดาวน์โหลดไฟล์แนบ
เมื่อมีรายการไฟล์แนบแล้ว คุณจะดาวน์โหลดไฟล์ได้โดยส่ง HTTP GET ที่ได้รับการตรวจสอบสิทธิ์ไปยังลิงก์ <content> src ของรายการ ตัวอย่างลิงก์เนื้อหาของ PDF
<content type="application/pdf" src="http://502377765-a-google-com-s-sites.googlegroups.com/feeds/media/content/domainName/siteName/678942036"/>
ฟีด ACL
ภาพรวมของสิทธิ์การแชร์ (ACL)
รายการ ACL แต่ละรายการในฟีด ACL แสดงถึงบทบาทการเข้าถึงของเอนทิตีหนึ่งๆ ไม่ว่าจะเป็นผู้ใช้ กลุ่มผู้ใช้ โดเมน หรือสิทธิ์เข้าถึงเริ่มต้น (ซึ่งเป็นเว็บไซต์สาธารณะ) รายการจะแสดงเฉพาะสำหรับเอนทิตีที่มีสิทธิ์เข้าถึงอย่างชัดเจน โดยจะแสดง 1 รายการ สำหรับอีเมลแต่ละรายการในแผง "ผู้ที่มีสิทธิ์เข้าถึง" ในหน้าจอการแชร์ของ UI ของ Google Sites ดังนั้น ผู้ดูแลระบบโดเมนจะไม่ปรากฏ แม้ว่าจะมีสิทธิ์เข้าถึงเว็บไซต์โดยนัยก็ตาม
บทบาท
องค์ประกอบบทบาทแสดงถึงระดับการเข้าถึงที่เอนทิตีมีได้ ค่าที่เป็นไปได้ขององค์ประกอบ gAcl:role มี 4 ค่า ดังนี้
- ผู้อ่าน - ผู้ดู (เทียบเท่าสิทธิ์การเข้าถึงระดับอ่านอย่างเดียว)
- ผู้เขียน - ผู้ทำงานร่วมกัน (เทียบเท่าสิทธิ์การอ่าน/เขียน)
- เจ้าของ - โดยปกติคือผู้ดูแลระบบเว็บไซต์ (เทียบเท่าสิทธิ์เข้าถึงแบบอ่าน/เขียน)
ขอบเขต
องค์ประกอบขอบเขตแสดงถึงเอนทิตีที่มีระดับการเข้าถึงนี้ องค์ประกอบ gAcl:scope มี 5 ประเภทที่เป็นไปได้ ดังนี้
- user - ค่าอีเมล เช่น "user@gmail.com"
- group - อีเมล Google Group เช่น "group@domain.com"
- domain - ชื่อโดเมน G Suite เช่น "domain.com"
- เชิญ - ผู้ใช้ที่ได้รับเชิญให้เข้าชมเว็บไซต์ แต่ยังไม่ได้เพิ่มลงใน ACL ของเว็บไซต์ (ใช้ไม่ได้หากระบุ gdata 1.3 หรือต่ำกว่า)
- default — มีขอบเขตที่เป็นไปได้เพียงขอบเขตเดียวของประเภท "default" ซึ่งไม่มีค่า
(เช่น
<gAcl:scope type="default">) ขอบเขตนี้จะควบคุมสิทธิ์เข้าถึงที่ผู้ใช้ทุกคนมีโดยค่าเริ่มต้น ในเว็บไซต์สาธารณะ
หมายเหตุ: โดเมนต้องไม่มีค่า gAcl:role
ที่ตั้งค่าเป็นสิทธิ์เข้าถึง "เจ้าของ" แต่ต้องเป็นสิทธิ์เข้าถึงแบบผู้อ่านหรือผู้เขียนเท่านั้น
เกี่ยวกับขอบเขต "invite"
API จะแสดงขอบเขตการเชิญเมื่อคุณเพิ่มผู้ใช้ตั้งแต่ 1 คนขึ้นไปลงใน ACL ที่ยังไม่มีบัญชี Google API จะแสดง URL พร้อมโทเค็นที่ฝังไว้ ซึ่งคุณต้องระบุให้ผู้ใช้ที่ได้รับเชิญเพื่ออนุญาตให้ผู้ใช้ยอมรับคำเชิญ
วิธีการเชิญนี้ช่วยให้คุณเชิญผู้ใช้ที่ไม่ใช่ Google ได้โดยไม่ต้องทราบล่วงหน้าว่าผู้ใช้ต้องการใช้อีเมลใด ตราบใดที่ผู้ใช้คลิก URL ของคำเชิญที่มีโทเค็นฝังอยู่ ผู้ใช้จะลงชื่อสมัครใช้เพื่อรับสิทธิ์เข้าถึงได้โดยใช้อีเมลใดก็ได้ นอกจากนี้ ผู้ใช้หลายคนอาจใช้ URL นี้เพื่อยอมรับคำเชิญได้ ซึ่งจะเป็นประโยชน์หากคุณเชิญผู้ใช้คนเดียวหรือกลุ่มผู้ใช้
หมายเหตุ: ขอบเขต "เชิญ" ใช้ได้ใน gdata เวอร์ชัน 1.4 ขึ้นไปเท่านั้น วิธีนี้จะใช้ไม่ได้หากคุณระบุ 1.3 หรือต่ำกว่าอย่างชัดเจน
การเรียกข้อมูลฟีด ACL
ฟีด ACL ใช้เพื่อควบคุมสิทธิ์การแชร์ของเว็บไซต์ และเข้าถึงได้ผ่าน URI ต่อไปนี้
https://sites.google.com/feeds/acl/site/domainName/siteName
| พารามิเตอร์ฟีด | คำอธิบาย |
|---|---|
domainName | 'site' หรือโดเมนของโดเมนที่โฮสต์ G Suite (เช่น example.com) |
siteName | ชื่อพื้นที่เว็บของเว็บไซต์ ซึ่งอยู่ใน URL ของเว็บไซต์ (เช่น myCoolSite) |
โปรดทราบว่ารายการแต่ละรายการในฟีดเว็บไซต์จะมีลิงก์ไปยังฟีดนี้
<link rel="http://schemas.google.com/acl/2007#accessControlList" type="application/atom+xml"
href="https://sites.google.com/feeds/acl/site/domainName/siteName"/>
หากต้องการดึงสิทธิ์การแชร์ของเว็บไซต์ ให้ส่ง HTTP GET ไปยัง URI ฟีด ACL ดังนี้
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 ของเว็บไซต์
หมายเหตุ: 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>
การเชิญผู้ใช้ผ่านขอบเขต "invite"
หากคุณเพิ่มผู้ใช้ที่ไม่มีบัญชี Google API จะแสดง URL ที่คุณต้องระบุต่อผู้ใช้ที่ต้องการเชิญ หลังจากคลิก URL แล้ว ผู้ใช้จะเข้าถึงเว็บไซต์ได้โดยลงชื่อเข้าใช้ด้วยบัญชีที่มีอยู่หรือสร้างบัญชีใหม่
หากเชิญสำเร็จ ระบบจะแสดง 201 Created และรายการใหม่ที่มี URL ที่คุณต้องส่งให้ผู้ใช้
<entry> <id>https://sites.google.com/feeds/acl/site/domainName/siteName/user%3Anew_invite%40example.com</id> <updated>2009-12-03T22:01:05.963Z</updated> <app:edited xmlns:app="http://www.w3.org/2007/app">2009-12-03T22:01:05.963Z</app:edited> <category scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/acl/2007#accessRule"/> <link rel="http://schemas.google.com/sites/2008#invite" type="text/html"href="domainName/siteName?invite=inviteToken"/> <link rel="self" type="application/atom+xml" href="https://sites.google.com/feeds/acl/site/domainName/siteName/user%3Anew_invite%40example.com"/> <link rel="edit" type="application/atom+xml" href="https://sites.google.com/feeds/acl/site/domainName/siteName/user%3Anew_invite%40example.com"/> <gAcl:role value='writer'/> <gAcl:scope type='invite' value='new_invite%40example.com'/> </entry>
การแชร์ระดับกลุ่มและโดเมน
คุณแชร์เว็บไซต์ในกลุ่ม Google หรือโดเมน G Suite ได้เช่นเดียวกับการแชร์เว็บไซต์กับผู้ใช้คนเดียว ค่า scope ที่จำเป็นแสดงอยู่ด้านล่าง
การแชร์ไปยังอีเมลกลุ่ม
<gAcl:scope type="group" value="group@example.com"/>
การแชร์กับทั้งโดเมน
<gAcl:scope type="domain" value="example.com"/>
การแชร์ที่ระดับโดเมนจะรองรับเฉพาะโดเมน G Suite และเฉพาะโดเมนที่โฮสต์เว็บไซต์ ตัวอย่างเช่น http://sites.google.com/a/domain1.com/siteA จะแชร์ทั้งเว็บไซต์ได้เฉพาะกับ domain1.com เท่านั้น ไม่ใช่ domain2.com ส่วนเว็บไซต์ที่ไม่ได้โฮสต์ในโดเมน G Suite (เช่น http://sites.google.com/site/siteB) จะเชิญโดเมนไม่ได้
การแก้ไขสิทธิ์การแชร์
หากต้องการอัปเดตรายการ ACL ให้แก้ไขรายการตามที่จำเป็น แล้วส่งคำขอ HTTP PUT ไปยังลิงก์ edit ของรายการ ซึ่งเป็นเพียงองค์ประกอบ <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>
การนำสิทธิ์การแชร์ออก
หากต้องการนำสิทธิ์สำหรับผู้ใช้นี้ออก ให้ส่งDELETEคำขอไปยังลิงก์editเดียวกันกับที่ใช้สำหรับคำขอPUT
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 GET ที่มีส่วนหัว HTTP If-None-Match ในส่วนหัว ให้ระบุ ETag ของรายการหรือรายการย่อย ซึ่งคุณดูได้ในแอตทริบิวต์ gd:etag ขององค์ประกอบ <feed> หรือองค์ประกอบ <entry>
ตัวอย่างการใช้ฟีดเว็บไซต์
GET /feeds/site/domainName/myOtherTestSite/ GData-Version: 1.4 If-None-Match: W/"Ck8GQXk7fil7ImA9WxNSFk0."
เมื่อเซิร์ฟเวอร์ได้รับคำขอนี้ เซิร์ฟเวอร์จะตรวจสอบว่ารายการที่คุณขอมี ETag เดียวกับ ETag ที่คุณระบุหรือไม่
หาก ETag ตรงกัน แสดงว่ารายการนั้นไม่มีการเปลี่ยนแปลง และเซิร์ฟเวอร์จะแสดงรหัสสถานะ HTTP 304 Not Modified หรือรหัสสถานะ HTTP 412 Precodition Failed รหัสสถานะทั้ง 2 รายการนี้บ่งชี้ว่ารายการที่คุณดึงข้อมูลไปแล้วเป็นข้อมูลล่าสุด
หาก ETag ไม่ตรงกัน แสดงว่ามีการแก้ไขรายการตั้งแต่ครั้งล่าสุดที่คุณขอ และเซิร์ฟเวอร์จะแสดงรายการ
ดูข้อมูลเพิ่มเติมเกี่ยวกับ ETag ได้ที่คู่มืออ้างอิง Google Data APIs
การประมวลผลแบบกลุ่ม
คำขอแบบกลุ่มช่วยให้ไคลเอ็นต์ดำเนินการหลายอย่างได้ในคำขอเดียว แทนที่จะส่งการดำเนินการแต่ละอย่างแยกกัน
เซิร์ฟเวอร์จะทำการเปลี่ยนแปลงที่ขอให้ได้มากที่สุด และแสดงข้อมูลสถานะที่คุณใช้เพื่อ ประเมินความสำเร็จหรือความล้มเหลวของการดำเนินการแต่ละอย่างได้ ดูรายละเอียดเพิ่มเติมเกี่ยวกับการประมวลผลแบบกลุ่มใน Google Data API ได้ที่การประมวลผลแบบกลุ่มด้วย Google Data API
การดำเนินการทุกอย่างในฟีดกลุ่มจะมีองค์ประกอบ <id> ยกเว้นการดำเนินการแทรก
องค์ประกอบนี้เหมือนกับ URL ของคำขอที่คุณมักจะใช้เมื่ออัปเดต ลบ หรือค้นหาฟีดเนื้อหา
เช่น หากคุณกำลังอัปเดตการแก้ไข ให้ตั้งค่า <id> เป็นลิงก์ edit สำหรับรายการที่เป็นปัญหา
ใช้เพื่อระบุรายการเป้าหมาย รายการใหม่ไม่มีองค์ประกอบ <id> เนื่องจากยังไม่ได้สร้าง แต่คุณสามารถกำหนดค่าสตริงใน <batch:id> แทนได้ ซึ่งจะแสดงในการตอบกลับของเซิร์ฟเวอร์และใช้เพื่อค้นหารายการที่เกี่ยวข้อง
หากต้องการส่งคำขอแบบกลุ่ม ให้สร้างฟีดแบบกลุ่มและส่ง HTTP POST ไปยังลิงก์แบบกลุ่มของฟีด
<link rel="http://schemas.google.com/g/2005#batch" type="application/atom+xml"
href="https://sites.google.com/feeds/content/site/siteName/batch"/>
ตัวอย่างด้านล่างแสดงวิธีค้นหา แทรก อัปเดต และลบรายการหน้าเว็บ
POST /feeds/content/site/siteName/batch HTTP/1.1 Host: sites.google.com Accept: */* If-Match: * GData-Version: 1.4 Authorization: <your authorization header here> <feed xmlns="http://www.w3.org/2005/Atom" xmlns:sites="http://schemas.google.com/sites/2008" xmlns:gd="http://schemas.google.com/g/2005" xmlns:batch='http://schemas.google.com/gdata/batch'> <entry> <id>https://sites.google.com/feeds/content/site/siteName/ENTRY_ID1</id> <batch:operation type="query"/> </entry> <entry> <batch:id>1</batch:id> <batch:operation type='insert'/> <category scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/sites/2008#webpage" label="webpage"/> <title>New Webpage1</title> <content type="xhtml"> <div xmlns="http://www.w3.org/1999/xhtml">HTML body goes here</div> </content> </entry> <entry gd:etag=""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>
ฟีดที่แสดงผลจะมีรายการผลลัพธ์ 1 รายการสําหรับการดําเนินการแต่ละอย่าง ดังนี้
<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>