คู่มือโปรโตคอล

Google Sites API แบบคลาสสิกช่วยให้แอปพลิเคชันเข้าถึง เผยแพร่ และแก้ไขเนื้อหาภายในเว็บไซต์จาก Google Sites ได้ นอกจากนี้ แอปพลิเคชันของคุณยังสามารถขอรายการกิจกรรมล่าสุด เรียกประวัติการแก้ไข และอัปโหลด/ดาวน์โหลดไฟล์แนบและไฟล์ได้ด้วย

ผู้ชม

เอกสารนี้ถือว่าคุณเข้าใจแนวคิดทั่วไปเบื้องหลังโปรโตคอล Google Data API

เอกสารนี้มีไว้สำหรับโปรแกรมเมอร์ที่ต้องการเขียนแอปพลิเคชันไคลเอ็นต์ที่สามารถโต้ตอบกับ Google Sites ได้ โดยมีชุดตัวอย่างการโต้ตอบกับ API ข้อมูลพื้นฐานโดยใช้ XML/HTTP ดิบพร้อมคำอธิบาย หลังจากอ่านเอกสารนี้ ดูข้อมูลเพิ่มเติมเกี่ยวกับการโต้ตอบกับ API โดยใช้ไลบรารีไคลเอ็นต์ได้โดยอ่าน ตัวอย่างภาษาเฉพาะที่พบในคำแนะนำอื่นๆ ในแถบนำทางด้านซ้าย

หากต้องการข้อมูลอ้างอิงของเนื้อหาในคู่มือนี้ โปรดดูคู่มืออ้างอิง

การอนุญาตคำขอ

เมื่อแอปพลิเคชันขอข้อมูลผู้ใช้ที่ไม่ใช่แบบสาธารณะ จะต้องมีโทเค็นการให้สิทธิ์ด้วย โทเค็นดังกล่าวจะระบุตัวตนแอปพลิเคชันของคุณให้ Google ทราบด้วย

เกี่ยวกับโปรโตคอลการให้สิทธิ์

แอปพลิเคชันต้องใช้ OAuth 2.0 เพื่อให้สิทธิ์คำขอ ระบบไม่รองรับโปรโตคอลการให้สิทธิ์อื่นๆ หากแอปพลิเคชันใช้ลงชื่อเข้าใช้ด้วย Google ระบบจะจัดการการให้สิทธิ์บางส่วนแก่คุณ

การให้สิทธิ์คำขอด้วย OAuth 2.0

คำขอไปยัง Google Sites Data API สำหรับข้อมูลผู้ใช้ที่ไม่เป็นสาธารณะจะต้องได้รับสิทธิ์จากผู้ใช้ที่ผ่านการตรวจสอบสิทธิ์แล้ว

รายละเอียดของกระบวนการให้สิทธิ์หรือ "ขั้นตอน" ของ OAuth 2.0 จะแตกต่างกันไปโดยขึ้นอยู่กับประเภทของแอปพลิเคชันที่คุณเขียน แอปพลิเคชันทุกประเภทจะใช้กระบวนการทั่วไปต่อไปนี้

  1. เมื่อสร้างแอปพลิเคชัน คุณจะลงทะเบียนแอปได้โดยใช้คอนโซล Google API จากนั้น Google จะให้ข้อมูลที่คุณต้องใช้ในภายหลัง เช่น รหัสไคลเอ็นต์และรหัสลับไคลเอ็นต์
  2. เปิดใช้งาน Google Sites Data API ในคอนโซล Google API (หากไม่เห็น API ดังกล่าวในคอนโซล API ให้ข้ามขั้นตอนนี้ไป)
  3. เมื่อแอปพลิเคชันต้องการเข้าถึงข้อมูลผู้ใช้ แอปจะขอขอบเขตการเข้าถึงที่จำเป็นจาก Google
  4. Google จะแสดงหน้าจอขอคำยินยอมแก่ผู้ใช้เพื่อขอให้ผู้ใช้ให้สิทธิ์แอปพลิเคชันของคุณในการขอข้อมูลบางอย่างของผู้ใช้
  5. หากผู้ใช้อนุมัติ Google จะให้โทเค็นเพื่อการเข้าถึงที่มีอายุชั่วคราวแก่แอปพลิเคชันของคุณ
  6. แอปพลิเคชันขอข้อมูลผู้ใช้โดยแนบโทเค็นเพื่อการเข้าถึงไปกับคำขอ
  7. หาก 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 Sites ที่ผู้ใช้เป็นเจ้าของหรือมีสิทธิ์ดู และแก้ไขชื่อของเว็บไซต์ที่มีอยู่ได้ สำหรับโดเมน G Suite ยังใช้เพื่อสร้างหรือคัดลอก ทั่วทั้งเว็บไซต์

แสดงรายการเว็บไซต์

หากต้องการแสดงรายการเว็บไซต์ที่ผู้ใช้มีสิทธิ์เข้าถึง ให้ส่งคำขอ GET ที่ตรวจสอบสิทธิ์แล้วไปยัง URL ต่อไปนี้

https://sites.google.com/feeds/site/domainName
พารามิเตอร์ฟีดคำอธิบาย
domainName"site" หรือโดเมนของโดเมนที่โฮสต์ใน G Suite ของคุณ (เช่น example.com)

การตอบกลับจะมีฟีดพร้อมรายการเว็บไซต์:

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

HTTP/1.1 200 OK

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

โดยเว็บไซต์จะแสดงตามลำดับตัวอักษร

การสร้างเว็บไซต์ใหม่

หมายเหตุ: ฟีเจอร์นี้ใช้ได้กับโดเมน G Suite เท่านั้น

คุณจะจัดสรรเว็บไซต์ใหม่ได้โดยสร้าง HTTP POST ไปยังฟีดเว็บไซต์ ตัวอย่างเช่น

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

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

คำขอข้างต้นจะสร้างเว็บไซต์จาก Google Sites ใหม่ที่มี "แถบสเลท" ภายใต้โดเมน G Suite example.com URL ของเว็บไซต์จะเป็น http://sites.google.com/a/example.com/source-site/

หากสร้างเว็บไซต์สำเร็จ เซิร์ฟเวอร์จะตอบกลับด้วย 201 Created รายการตอบกลับจะมีองค์ประกอบที่เซิร์ฟเวอร์เพิ่ม เช่น ลิงก์ไปยัง ลิงก์ไปยังฟีด ACL ของเว็บไซต์ ชื่อเว็บไซต์ ชื่อ และข้อมูลสรุป

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

การคัดลอกเว็บไซต์

หมายเหตุ: ฟีเจอร์นี้ใช้ได้กับโดเมน G Suite เท่านั้น

เว็บไซต์ที่มีอยู่สามารถทำซ้ำได้ในลักษณะเดียวกันกับการสร้างเว็บไซต์ใหม่ แต่ในรายการ 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/&quot;DEECR38l7I2A9WxNaF0Q.&quot;">
  <id>https://sites.google.com/feeds/site/example.com/source-site</id>
  <updated>2009-12-02T23:31:06.184Z</updated>
  <app:edited xmlns:app="http://www.w3.org/2007/app">2009-12-02T23:31:06.184Z</app:edited>
  <title>New Test Site2</title>
  <summary>Newer description</summary>
  <category scheme="http://schemas.google.com/sites/2008#tag" term="Category"/>
  <link rel="alternate" type="text/html" href="http://sites.google.com/a/example.com/source-site/"/>
  <link rel="http://schemas.google.com/acl/2007#accessControlList" type="application/atom+xml"
      href="https://sites.google.com/feeds/acl/site/example.com/source-site"/>
  <link rel="self" type="application/atom+xml" href="https://sites.google.com/feeds/site/example.com/source-site"/>
  <link rel="edit" type="application/atom+xml" href="https://sites.google.com/feeds/site/example.com/source-site"/>
  <sites:siteName>source-site</sites:siteName>
</entry>

การเพิ่มหมวดหมู่

หมายเหตุ: ฟีเจอร์นี้ใช้ได้กับโดเมน G Suite เท่านั้น

G Suite สำหรับเว็บไซต์ในโดเมนของคุณมีข้อมูลเมตาหมวดหมู่ที่เป็นประโยชน์สำหรับการจัดหมวดหมู่เว็บไซต์ภายในโดเมนของคุณ หากต้องการเพิ่มหรืออัปเดตข้อมูลเมตาหมวดหมู่ ให้ส่ง 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/&quot;DEECR38l7I2A9WxNaF0Q.&quot;">
  <id>https://sites.google.com/feeds/site/example.com/source-site</id>
  <updated>2009-12-02T23:31:06.184Z</updated>
  <app:edited xmlns:app="http://www.w3.org/2007/app">2009-12-02T23:31:06.184Z</app:edited>
  <title>My Team website</title>
  <summary>This site contains contact information and a summary of major efforts our team owns</summary>
  <category scheme="http://schemas.google.com/sites/2008#tag" term="Team Site"/>
  <link rel="alternate" type="text/html" href="http://sites.google.com/a/example.com/my-team-site/"/>
  <link rel="http://schemas.google.com/acl/2007#accessControlList" type="application/atom+xml"
      href="https://sites.google.com/feeds/acl/site/example.com/my-team-site"/>
  <link rel="self" type="application/atom+xml" href="https://sites.google.com/feeds/site/example.com/my-team-site"/>
  <link rel="edit" type="application/atom+xml" href="https://sites.google.com/feeds/site/example.com/my-team-site"/>
  <sites:siteName>my-team-site</sites:siteName>
</entry>

ตัวอย่างนี้แก้ไขเว็บไซต์ที่มีอยู่และเพิ่มหมวดหมู่ "เว็บไซต์ของทีม"

นอกจากนี้ คุณยังเพิ่มหมวดหมู่ได้หลายรายการโดยเพิ่มแท็ก <category> อีก โปรดดูเส้นตัวหนาในตัวอย่างต่อไปนี้

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

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

ตัวอย่างนี้เพิ่มหมวดหมู่ 2 หมวดหมู่ ได้แก่ "เว็บไซต์ของทีม" และ "ฝ่ายกฎหมาย"

การแมปที่อยู่เว็บ

การจับคู่ที่อยู่เว็บจะช่วยให้ผู้ใช้ Sites สามารถจับคู่โดเมนของตนเองกับ Google Sites ได้ เช่น http://www.mydomainsite.com สามารถใช้แทน http://sites.google.com/a/domain.com/mysite ได้ คุณสามารถแก้ไข การแมปที่อยู่เว็บของเว็บไซต์ ดูข้อมูลเพิ่มเติมได้จากบทความในศูนย์ช่วยเหลือ

การดึงข้อมูลการแมปที่อยู่เว็บของเว็บไซต์

หากต้องการแสดงผลการแมปที่อยู่เว็บสำหรับเว็บไซต์ ให้ดึงข้อมูลรายการ/ฟีดของเว็บไซต์ด้วยพารามิเตอร์ with-mappings=true ดังนี้

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

HTTP/1.1 200 OK

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

การแมปที่มีอยู่จะแสดงเป็น 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/&quot;DkQGQHczfA9WxNaFk4.&quot;">
  <id>https://sites.google.com/feeds/site/domainName/myOtherTestSite</id>
  <updated>2009-12-01T02:25:21.987Z</updated>
  <app:edited xmlns:app="http://www.w3.org/2007/app">2009-12-01T02:25:21.987Z</app:edited>
  <title>myOtherTestSite</title>
  <summary>A new site to hold memories</summary>
  <link rel="alternate" type="text/html" href="http://sites.google.com/site/myOtherTestSite"/>
  <link rel="http://schemas.google.com/acl/2007#accessControlList" type="application/atom+xml"
      href="https://sites.google.com/feeds/acl/site/domainName/myOtherTestSite"/>
  <link rel="self" type="application/atom+xml" href="https://sites.google.com/feeds/site/domainName/myOtherTestSite"/>
  <link rel="edit" type="application/atom+xml" href="https://sites.google.com/feeds/site/domainName/myOtherTestSite"/>
  <link rel='webAddressMapping' href='www.my-new-sitemapping.com'>
  <!-- missing mapping2 will be deleted -->
  <link rel='webAddressMapping' href='http://www.myothermapping.org'>
</entry>

โปรดทราบว่าการจับคู่ที่อยู่เว็บสามารถระบุขณะสร้าง/คัดลอกเว็บไซต์ได้เช่นกัน

กลับไปด้านบน

ฟีดกิจกรรม

คุณสามารถดึงข้อมูลกิจกรรมล่าสุด (การเปลี่ยนแปลง) ของเว็บไซต์โดยการดึงข้อมูลฟีดกิจกรรม แต่ละรายการใน ฟีดกิจกรรมมีข้อมูลเกี่ยวกับการเปลี่ยนแปลงที่เกิดขึ้นกับเว็บไซต์

ในการค้นหาฟีดกิจกรรม ให้ส่ง HTTP GET ไปยัง URL ของฟีดกิจกรรม

https://sites.google.com/feeds/activity/domainName/siteName
พารามิเตอร์ฟีดคำอธิบาย
domainName"site" หรือโดเมนของโดเมนที่โฮสต์ใน G Suite ของคุณ (เช่น example.com)
siteNameชื่อเว็บสเปซของเว็บไซต์ ที่พบใน URL ของเว็บไซต์ (เช่น myCoolSite)

ตัวอย่างคำขอและการตอบกลับ

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

HTTP/1.1 200 OK

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

หมายเหตุ: คุณต้องเป็นผู้ทำงานร่วมกันหรือเจ้าของเว็บไซต์จึงจะเข้าถึงฟีดนี้ได้ ไคลเอ็นต์คุณต้องส่งส่วนหัว Authorization ที่ถูกต้องและอ้างอิงโทเค็นที่ได้รับ ในการให้สิทธิ์คำขอ

กลับไปด้านบน

ฟีดการแก้ไข

หากต้องการเรียกประวัติการแก้ไขสำหรับรายการเนื้อหา ให้ส่ง HTTP GET ไปยังลิงก์การแก้ไขของรายการ ดังนี้

https://sites.google.com/feeds/revision/domainName/siteName/CONTENT_ENTRY_ID
พารามิเตอร์ฟีดคำอธิบาย
domainName"site" หรือโดเมนของโดเมนที่โฮสต์ใน G Suite ของคุณ (เช่น example.com)
siteNameชื่อเว็บสเปซของเว็บไซต์ ที่พบใน URL ของเว็บไซต์ (เช่น myCoolSite)

หากต้องการค้นหาลิงก์การแก้ไขสำหรับหน้า/ความคิดเห็น/ไฟล์แนบ/รายการที่ระบุ ให้เรียกข้อมูลรายการจาก ฟีดเนื้อหาโดยใช้ CONTENT_ENTRY_ID รายการที่ดึงมาจะมี <atom:link> ของฟีดการแก้ไข เช่น

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

ตัวอย่างคำขอและการตอบกลับ

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

HTTP/1.1 200 OK

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

หมายเหตุ: คุณต้องเป็นผู้ทำงานร่วมกันหรือเจ้าของเว็บไซต์จึงจะเข้าถึงฟีดนี้ได้ ไคลเอ็นต์ต้องส่งส่วนหัว Authorization ที่ถูกต้องและอ้างอิงโทเค็นที่ได้รับ ในการให้สิทธิ์คำขอ

กลับไปด้านบน

ฟีดเนื้อหา

กำลังเรียกเนื้อหา

ฟีดเนื้อหาจะแสดงเนื้อหาปัจจุบันของ Sites ส่งคำขอ GET ที่ผ่านการตรวจสอบสิทธิ์ไปยัง URL ต่อไปนี้

https://sites.google.com/feeds/content/domainName/siteName
พารามิเตอร์ฟีดคำอธิบาย
domainName"site" หรือโดเมนของโดเมนที่โฮสต์ใน G Suite ของคุณ (เช่น example.com)
siteNameชื่อเว็บสเปซของเว็บไซต์ ที่พบใน URL ของเว็บไซต์ (เช่น myCoolSite)

ผลลัพธ์จะเป็นฟีดที่แสดงหน้าแรกของรายการเนื้อหาในเว็บไซต์ แต่ละรายการในฟีดจะแสดงรายการเนื้อหา คนละประเภท เช่น webpage, filecabinet, attachment, comment เป็นต้น องค์ประกอบ <category scheme="http://schemas.google.com/g/2005#kind"> จะกำหนดประเภทรายการ ดูคู่มือข้อมูลอ้างอิง สำหรับรายการรองรับค่า kind

หมายเหตุ: ฟีดนี้อาจต้องมีการตรวจสอบสิทธิ์หรือไม่ก็ได้ ขึ้นอยู่กับสิทธิ์การแชร์ของเว็บไซต์ หากเว็บไซต์ไม่เป็นสาธารณะ ลูกค้าจะต้องส่งส่วนหัว Authorization ที่ถูกต้อง (ตามที่เห็นในตัวอย่างด้านบน) และอ้างอิงโทเค็นที่ได้มาจากการให้สิทธิ์คำขอ

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

HTTP/1.1 200 OK

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

หมายเหตุ: นี่เป็นผลลัพธ์เพียง 2-3 รายการแรก หากต้องการเลื่อนดูฟีดเนื้อหาทั้งหมด ให้ทำดังนี้ "ถัดไป" ของฟีด ลิงก์:

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

ดูคำอธิบายเกี่ยวกับองค์ประกอบทั่วไปของ Atom ได้ที่ข้อมูลอ้างอิงสำหรับโปรโตคอลข้อมูลของ Google องค์ประกอบที่มีการอ้างอิงที่เฉพาะเจาะจงไปยัง Sites API แบบคลาสสิกจะอธิบายด้านล่าง บางรายการจะมีพร็อพเพอร์ตี้เพิ่มเติม (ไม่ได้ระบุไว้ด้านล่าง) ขณะที่ ผู้อื่นจะไม่สามารถทำได้ ตัวอย่างเช่น รายการ listitem อาจมีองค์ประกอบ <gs:field> แต่รายการ webpage ไม่มี

องค์ประกอบคำอธิบาย
<content ...>ข้อความด้านในคือเนื้อหา HTML ของหน้าเว็บ สำหรับบางรายการ (เช่น ไฟล์แนบ) องค์ประกอบนี้จะมีแอตทริบิวต์ src ที่ชี้ไปยังไฟล์
<link rel="alternate" ...>ลิงก์ไปยังหน้าหรือรายการใน Google Sites
<link rel="http://schemas.google.com/sites/2008#revision" ...>แอตทริบิวต์ href ชี้ไปยังฟีดการแก้ไขของรายการ
<link rel="http://schemas.google.com/sites/2008#parent" ...>แอตทริบิวต์ href ชี้ไปยังรายการระดับบนสุดของรายการ
<link rel="http://schemas.google.com/sites/2008#template" ...>แอตทริบิวต์ href ชี้ไปยังหน้าเทมเพลตของรายการ
<category scheme="http://schemas.google.com/g/2005#kind" ...>label เป็นประเภทของรายการ
<category term="http://schemas.google.com/g/2005#template" ...>label=template ที่ระบุรายการเป็นเทมเพลต
<gd:feedLink>แอตทริบิวต์ href ชี้ไปยังรายการย่อยของรายการระดับบน
<sites:pageName>ชื่อเว็บสเปซของหน้าเว็บ ซึ่งตรงกับชื่อใน URL ของหน้า
<sites:revision>หมายเลขการแก้ไขปัจจุบัน

ตัวอย่างการค้นหาฟีดเนื้อหา

คุณสามารถค้นหาฟีดเนื้อหาโดยใช้พารามิเตอร์การค้นหาของ Google Data API มาตรฐานบางรายการ และข้อมูลเฉพาะสำหรับ Sites API แบบคลาสสิก สำหรับข้อมูลโดยละเอียดเพิ่มเติมและรายการพารามิเตอร์ที่รองรับทั้งหมด โปรดดู คู่มืออ้างอิง

กำลังดึงข้อมูลประเภทรายการที่เจาะจง

หากต้องการดึงข้อมูลประเภทรายการเฉพาะ ให้ใช้พารามิเตอร์ kind ตัวอย่างนี้แสดงผลเพียง webpage รายการ:

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

หากต้องการแสดงผลรายการมากกว่า 1 ประเภท ให้คั่น kind แต่ละรายการด้วย "," ตัวอย่างนี้แสดง filecabinet และ listpage รายการ:

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

คุณสามารถใช้รูปแบบมาตรฐานสำหรับการค้นหา /-/category ใน Google Data แทนพารามิเตอร์ 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

กลับไปด้านบน



การสร้างเนื้อหา

เนื้อหาใหม่ (หน้าเว็บ หน้ารายการ หน้าจัดการไฟล์ หน้าประกาศ ฯลฯ) สามารถสร้างขึ้นได้ด้วยการส่ง 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 ใหม่ที่มีส่วนหัวหน้าเป็น "File Storage" แต่สร้างหน้า ใน URL http://sites.google.com/domainName/siteName/files โดย การระบุเอลิเมนต์ <sites:pageName>

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

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

เซิร์ฟเวอร์ใช้กฎตามลำดับความสำคัญต่อไปนี้ในการตั้งชื่อเส้นทาง URL ของหน้าเว็บ

  1. <sites:pageName> หากมี ต้องเป็นไปตาม a-z, A-Z, 0-9, -, _
  2. <atom:title> ต้องไม่เป็น 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" และ "เทมเพลต" ตามลำดับ

ตัวอย่างนี้สร้างเทมเพลต 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 ให้ใส่หมวดหมู่ที่มีคำว่า "คำ" กำหนดแอตทริบิวต์เป็นชื่อโฟลเดอร์:

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

ไฟล์แนบจากเว็บ

ไฟล์แนบบนเว็บเป็นไฟล์แนบชนิดพิเศษ โดยพื้นฐานแล้ว เป็นลิงก์ที่เชื่อมโยงไปยังไฟล์อื่นๆ บนเว็บ ที่คุณสามารถเพิ่มลงในรายการตู้ไฟล์ของคุณได้ ฟีเจอร์นี้คล้ายกับ "เพิ่มไฟล์ด้วย URL" ใน UI ของ Google Sites

หมายเหตุ: สามารถสร้างไฟล์แนบในเว็บได้ภายใต้หน้าจัดการไฟล์เท่านั้น แต่จะอัปโหลดไปยังหน้าเว็บประเภทอื่นๆ ไม่ได้

ตัวอย่างนี้สร้าง webattachment ใต้ที่เก็บไฟล์ซึ่งอ้างอิงโดยรหัส FILECABINET_ENTRY_ID ตั้งชื่อและคำอธิบาย (ไม่บังคับ) เป็น "GoogleLogo" และ "สีสวย" ตามลำดับ

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

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

POST จะสร้างลิงก์ในหน้าจัดการไฟล์ของผู้ใช้ซึ่งนำไปยังรูปภาพที่ "http://www.google.com/images/logo.gif"

กลับไปด้านบน



การอัปเดตเนื้อหา

แก้ไขข้อมูลเมตา (ชื่อ, pageName ฯลฯ) และเนื้อหาของหน้าได้ด้วยคำขอ PUT คำขอเดียวที่ส่งไปยังลิงก์ edit เนื้อหาของคำขอควรมีรายการ Atom ที่อธิบายหน้าที่อัปเดต ข้อยกเว้นสำหรับกฎนี้คือรายการไฟล์แนบ ซึ่งรายการนี้สามารถใช้เพื่ออัปเดตข้อมูลเมตาของไฟล์แนบเท่านั้น หากต้องการเปลี่ยนเนื้อหาของไฟล์แนบ ให้รวมข้อมูลดิบเป็นเนื้อหาของคำขอ PUT ในส่วน ลิงก์ edit-media ของไฟล์แนบ นอกจากนี้ คุณสามารถอัปเดตทั้งข้อมูลเมตาและเนื้อหาไฟล์แนบได้พร้อมกันโดยใช้ คำขอหลายส่วนสำหรับ MIME

เพื่อยืนยันว่าการอัปเดตของคุณไม่ได้เขียนทับการเปลี่ยนแปลงของลูกค้ารายอื่น ให้ใส่ค่า ETag ของรายการเดิม คุณสามารถดำเนินการนี้ได้โดย ระบุค่า ETag ในส่วนหัว HTTP If-Match หรือรวมแอตทริบิวต์ gd:etag ของรายการดั้งเดิมในส่วนหัว รายการที่อัปเดต หากต้องการระบุค่า ETag เดิมของรายการ ให้ตรวจสอบแอตทริบิวต์ gd:etag ขององค์ประกอบ <entry> สำหรับรายการสื่อ ETag ของสื่ออาจอยู่ในแอตทริบิวต์ gd:etag ของลิงก์ edit-media

ถ้าคุณต้องการอัปเดตรายการโดยไม่คำนึงว่ามีคนอื่นอัปเดตรายการหลังจากดึงข้อมูลมาหรือไม่ ให้ใช้ If-Match: * และไม่ต้องระบุ ETag สำหรับข้อมูลเพิ่มเติมเกี่ยวกับ ETag โปรดดู คู่มืออ้างอิงสำหรับ Google Data API

การอัปเดตข้อมูลเมตาหรือเนื้อหา HTML ของรายการ

หากต้องการอัปเดตข้อมูลเมตาหรือเนื้อหา HTML ของรายการ ให้ส่ง HTTP PUT ไปยังลิงก์ edit ของรายการ

ต่อไปนี้เป็นตัวอย่างของการอัปเดตรายการ listpage (แสดงด้วยรหัส ENTRY_ID) ด้วยการเปลี่ยนแปลงต่อไปนี้

  • แก้ไขชื่อเป็น "เนื้อหาที่อัปเดต"
  • เนื้อหา HTML ที่อัปเดตแล้ว
  • ส่วนหัวคอลัมน์แรกของรายการอัปเดตเป็น "เจ้าของ"
  • เส้นทาง URL ของหน้าเว็บมีการแก้ไขโดยองค์ประกอบ <sites:pageName>
PUT /feeds/content/domainName/siteName/ENTRY_ID
Host: sites.google.com
GData-Version: 1.4
Authorization: <your authorization header here>
Content-Length: 816
Content-Type: application/atom+xml

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

หมายเหตุ: รายการ (ตามที่เซิร์ฟเวอร์แสดงผล) จะมีองค์ประกอบมากกว่าตัวอย่างด้านบน

การแทนที่เนื้อหาของไฟล์แนบ

ด้านล่างนี้เป็นตัวอย่างการแทนที่เนื้อหาของไฟล์แนบแต่คงข้อมูลเมตาของไฟล์แนบไว้ตามเดิม เนื่องจากคำขอมีเนื้อหาใหม่ มีการใช้ลิงก์ edit-media ของรายการไฟล์แนบ

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

... doc contents here ...

การอัปเดตข้อมูลเมตา + เนื้อหาของไฟล์แนบ

ด้านล่างนี้เป็นตัวอย่างการอัปเดตทั้งข้อมูลเมตาของไฟล์แนบและเนื้อหาของไฟล์แนบพร้อมกัน ระบบจะอัปเดตชื่อไฟล์แนบ เป็น "ชื่อใหม่" และเนื้อหาจะถูกแทนที่ด้วยเนื้อหาของไฟล์ .zip เนื่องจากคำขอมีเนื้อหาไฟล์ใหม่ มีการใช้ลิงก์ edit-media ของรายการไฟล์แนบ

โปรดทราบว่าการรวม ETag สำหรับข้อมูลเมตาจะมี If-Match โดยนัยสำหรับเนื้อหาสื่อด้วย เนื่องจากการอัปเดตไปยัง เนื้อหาสื่อทำให้ ETag ของข้อมูลเมตาเปลี่ยนแปลง

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

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

--END_OF_PART
Content-Type: application/zip

... zip contents here ...

--END_OF_PART

กลับไปด้านบน



การลบเนื้อหา

หากต้องการนำรายการออกจากเว็บไซต์จาก Google 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 API

กลับไปด้านบน



กำลังดาวน์โหลดไฟล์แนบ

เมื่อมีรายการไฟล์แนบแล้ว คุณจะดาวน์โหลดไฟล์ได้โดยการส่ง HTTP GET ที่ผ่านการตรวจสอบสิทธิ์ไปยังไฟล์ <content> src ตัวอย่างลิงก์เนื้อหาของ PDF

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

กลับไปด้านบน

ฟีด ACL

ภาพรวมของสิทธิ์การแชร์ (ACL)

รายการ ACL แต่ละรายการในฟีด ACL แสดงบทบาทการเข้าถึงของเอนทิตีหนึ่งๆ ซึ่งอาจเป็นผู้ใช้ กลุ่มผู้ใช้ โดเมน หรือการเข้าถึงเริ่มต้น (ซึ่งเป็นเว็บไซต์สาธารณะ) ระบบจะแสดงรายการสำหรับบุคคลที่มีสิทธิ์การเข้าถึงอย่างชัดแจ้งเท่านั้น โดยจะแสดง 1 รายการ สำหรับแต่ละอีเมลใน "ผู้ที่มีสิทธิ์เข้าถึง" ในหน้าจอการแชร์ของ UI ของ Google Sites ดังนั้นระบบจะไม่แสดงผู้ดูแลระบบโดเมน แม้ว่าพวกเขาจะมีสิทธิ์เข้าถึงเว็บไซต์โดยปริยายก็ตาม

บทบาท

องค์ประกอบบทบาทแสดงถึงระดับการเข้าถึงที่เอนทิตีหนึ่งๆ มีได้ ค่าที่เป็นไปได้ขององค์ประกอบ gAcl:role มีอยู่ 4 ค่า ได้แก่

  • reader — ผู้มีสิทธิ์อ่าน (เทียบเท่ากับสิทธิ์การเข้าถึงระดับอ่านอย่างเดียว)
  • writer — ผู้ทำงานร่วมกัน (เทียบเท่ากับสิทธิ์การอ่าน/เขียน)
  • owner — โดยทั่วไปคือผู้ดูแลระบบไซต์ (เทียบเท่ากับสิทธิ์การอ่าน/เขียน)

ขอบเขต

องค์ประกอบขอบเขตแสดงถึงเอนทิตีที่มีระดับการเข้าถึงนี้ องค์ประกอบ gAcl:scope ที่เป็นไปได้มี 5 ประเภทดังนี้

  • user — ค่าที่อยู่อีเมล เช่น "user@gmail.com"
  • group — ที่อยู่อีเมลของกลุ่ม Google เช่น "group@domain.com"
  • domain — ชื่อโดเมน G Suite เช่น "domain.com"
  • Invite — ผู้ใช้ที่ได้รับเชิญให้เข้าร่วมเว็บไซต์ แต่ยังไม่ได้เพิ่มลงใน ACL ของเว็บไซต์ (ใช้ไม่ได้หากระบุ gdata 1.3 หรือต่ำกว่า)
  • default — มีขอบเขตประเภท "ค่าเริ่มต้น" ที่เป็นไปได้เพียง 1 ขอบเขตซึ่งไม่มีค่า (เช่น <gAcl:scope type="default">) ขอบเขตเฉพาะนี้ควบคุมการเข้าถึงที่ผู้ใช้มีโดยค่าเริ่มต้น บนเว็บไซต์สาธารณะ

หมายเหตุ: โดเมนมีค่า gAcl:role ไม่ได้ ตั้งค่าเป็น "เจ้าของ" คุณก็เป็น ผู้อ่านหรือผู้เขียนได้เท่านั้น

เกี่ยวกับ "คำเชิญ"

API จะแสดงผลขอบเขตคำเชิญเมื่อคุณเพิ่มผู้ใช้ 1 รายหรือ 1 รายขึ้นไปที่ยังไม่มีบัญชี Google ไปยัง ACL API จะส่งคืน URL ที่มีโทเค็นที่ฝังอยู่ ซึ่งคุณต้องมอบให้กับผู้ใช้ที่ได้รับเชิญเพื่อให้ผู้ใช้ยอมรับคำเชิญได้

วิธีการเชิญนี้ช่วยให้คุณเชิญผู้ที่ไม่ได้ใช้ Google ได้โดยไม่ต้องรู้ล่วงหน้าว่าต้องการใช้อีเมลใด หากผู้ใช้คลิกที่ URL คำเชิญที่มีโทเค็นฝังอยู่ ผู้ใช้จะสามารถลงชื่อสมัครใช้เพื่อรับสิทธิ์เข้าถึงได้โดยใช้อีเมลใดก็ได้ที่ต้องการ นอกจากนี้ ผู้ใช้หลายรายสามารถใช้ URL นี้เพื่อตอบรับคำเชิญได้ ดังนั้นวิธีนี้จึงมีประโยชน์หากเชิญผู้ใช้หรือกลุ่มผู้ใช้เพียง 1 คน

หมายเหตุ: "คำเชิญ" ขอบเขตใช้ได้เฉพาะใน 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>

การเชิญผู้ใช้ผ่าน "คำเชิญ" ขอบเขต

หากคุณเพิ่มผู้ใช้ที่ไม่มีบัญชี 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" ตั้งค่าเป็น "แก้ไข" สำหรับตัวอย่างก่อนหน้านี้ ลิงก์นี้คือ

<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 API

การประมวลผลแบบกลุ่ม

คำขอแบบกลุ่มทำให้ไคลเอ็นต์สามารถดำเนินการหลายรายการในคำขอเดียว แทนที่จะส่งการดำเนินการทีละรายการ

เซิร์ฟเวอร์จะดำเนินการเปลี่ยนแปลงตามคำขอให้ได้มากที่สุด และแสดงผลข้อมูลสถานะที่คุณสามารถใช้เพื่อ ประเมินความสำเร็จหรือความล้มเหลวของการดำเนินการแต่ละอย่าง สำหรับรายละเอียดเพิ่มเติมเกี่ยวกับการประมวลผลแบบกลุ่มใน Google Data API ดูการประมวลผลแบบกลุ่มด้วย Google Data API

การดำเนินการทั้งหมดในฟีดกลุ่มมีองค์ประกอบ &lt;id&gt; ยกเว้นการดำเนินการแทรก องค์ประกอบนี้เหมือนกับ URL คำขอที่โดยปกติแล้วคุณจะใช้เมื่ออัปเดต ลบ หรือค้นหาฟีดเนื้อหา ตัวอย่างเช่น หากกำลังอัปเดตการแก้ไข ให้ตั้งค่า &lt;id&gt; เป็นลิงก์ edit สำหรับรายการที่เป็นปัญหา ซึ่งใช้เพื่อระบุรายการเป้าหมาย รายการใหม่ไม่มีองค์ประกอบ &lt;id&gt; เนื่องจาก ยังไม่ได้สร้าง คุณสามารถกำหนดค่าสตริงใน &lt;batch:id&gt; แทน ซึ่งจะเป็น แสดงผลในการตอบสนองของเซิร์ฟเวอร์และใช้เพื่อค้นหารายการที่เกี่ยวข้อง

หากต้องการส่งคำขอแบบกลุ่ม ให้สร้างฟีดแบบกลุ่มและส่ง HTTP POST ไปยังลิงก์กลุ่มของฟีด ดังนี้

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

ตัวอย่างด้านล่างแสดงวิธีการค้นหา แทรก อัปเดต และลบรายการหน้าเว็บ

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

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

ฟีดที่แสดงผลจะมีรายการผลลัพธ์ 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="&quot;YDgpsdfeyI.&quot;">
  <id>https://sites.google.com/feeds/content/site/siteName/ENTRY_ID1</id>
  <published>2009-08-31T04:42:45.251Z</published>
  <updated>2009-10-25T22:46:13.729Z</updated>
  <app:edited xmlns:app="http://www.w3.org/2007/app">2009-10-25T22:46:13.671Z</app:edited>
  <category scheme="http://schemas.google.com/g/2005#kind"
      term="http://schemas.google.com/sites/2008#webpage" label="webpage"/>
  <title>Page Title</title>
  ...
  <batch:status code="200" reason="Success"/>
  <batch:operation type="query"/>
</entry>
<entry gd:etag="&quot;YDsseyI.&quot;">
  <id>https://sites.google.com/feeds/content/site/siteName/ENTRY_ID4</id>
  <published>2009-11-10T22:44:08.531Z</published>
  <updated>2009-11-10T22:44:08.560Z</updated>
  <app:edited xmlns:app="http://www.w3.org/2007/app">2009-11-10T22:44:08.531Z</app:edited>
  <category scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/sites/2008#webpage" label="webpage"/>
  <title>New Webpage1</title>
  <content type="xhtml">
    <div xmlns="http://www.w3.org/1999/xhtml">
    <table cellspacing="0" class="sites-layout-name-one-column sites-layout-hbox">
      <tbody>
        <tr>
          <td class="sites-layout-tile sites-tile-name-content-1">
            <div>HTML body goes here</div>
          </td>
        </tr>
      </tbody>
    </table>
  </div>
</content>
...
<batch:id>1</batch:id>
<batch:status code="201" reason="Created"/>
<batch:operation type="insert"/>
</entry>
<entry gd:etag="&quot;YDkpeyI.&quot;">
  <id>https://sites.google.com/feeds/content/site/siteName/ENTRY_ID2</id>
  <updated>2009-11-10T22:44:09.296Z</updated>
  <title>Updated Title for Webpage2</title>
  ...
  <sites:pageName>updated-title-for-webpage2</sites:pageName>
  <sites:revision>5</sites:revision>
  <batch:status code="200" reason="Success"/>
  <batch:operation type="update"/>
</entry>
<entry>
  <id>https://sites.google.com/feeds/content/site/siteName/ENTRY_ID3</id>
  <title>Deleted</title>
  <content>Deleted</content>
  <batch:status code="200" reason="Success"/>
  <batch:operation type="delete"/>
</entry>
</feed>

กลับไปด้านบน