Protokol Kılavuzu

Klasik Google Sites API, uygulamalarınızın bir Google Sites sitesindeki içeriğe erişmesine, bu içeriği yayınlamasına ve değiştirmesine olanak tanır. Ayrıca uygulamanız son etkinliklerin listesini isteyebilir, düzeltme geçmişini getirebilir ve ekler ile dosyaları yükleyebilir/indirebilir.

Kitle

Bu dokümanda, Google Veri API'leri protokolünün arkasındaki genel fikirleri anladığınız varsayılmaktadır.

Bu doküman, Google Sites ile etkileşim kurabilen istemci uygulamaları yazmak isteyen programcılar için hazırlanmıştır. Bu makalede, ham XML/HTTP kullanan temel Veri API'si etkileşimleriyle ilgili bir dizi örnek ve açıklama yer almaktadır. Bu dokümanı okuduktan sonra, sol gezinme çubuğundaki diğer kılavuzlarda bulunan dile özgü örnekleri okuyarak istemci kitaplıklarımızı kullanarak API ile etkileşim kurma hakkında daha fazla bilgi edinebilirsiniz.

Bu kılavuzdaki materyallerle ilgili referans için referans kılavuzuna bakın.

İstekleri yetkilendirme

Uygulamanız herkese açık olmayan kullanıcı verileri için istekte bulunduğunda bir yetkilendirme jetonu içermelidir. Bu jeton ayrıca uygulamanızı Google'a tanıtır.

Yetkilendirme protokolleri hakkında

Uygulamanız, istekleri yetkilendirmek için OAuth 2.0 kullanmalıdır. Başka hiçbir yetkilendirme protokolü desteklenmez. Uygulamanız Google ile Oturum Açma özelliğini kullanıyorsa yetkilendirme işleminin bazı kısımları sizin adınıza gerçekleştirilir.

OAuth 2.0 kullanarak istekleri yetkilendirme

Google Sites Veri API'sine gönderilen herkese açık olmayan kullanıcı verileriyle ilgili isteklerin, kimliği doğrulanmış bir kullanıcı tarafından yetkilendirilmesi gerekir.

OAuth 2.0 ile yetkilendirme işleminin ("akış") ayrıntıları, yazdığınız uygulamanın türüne bağlı olarak değişiklik gösterir. Aşağıdaki genel işlem tüm uygulama türleri için geçerlidir:

  1. Uygulamanızı oluştururken Google API Konsolu'nu kullanarak kaydedersiniz. Ardından Google, daha sonra ihtiyaç duyacağınız bilgiler (ör. istemci kimliği ve istemci gizli anahtarı) sağlar.
  2. Google API Konsolu'nda Google Sites Data API'yi etkinleştirin. (API, API Konsolu'nda listelenmemişse bu adımı atlayın.)
  3. Uygulamanız kullanıcı verilerine erişmesi gerektiğinde Google'dan belirli bir erişim kapsamı ister.
  4. Google, kullanıcıya uygulamanızı kullanıcının verilerinden bazılarını istemeye yetkilendirmesi için bir onay ekranı gösterir.
  5. Kullanıcı onaylarsa Google, uygulamanıza kısa süreli bir erişim jetonu verir.
  6. Uygulamanız, erişim jetonunu isteğe ekleyerek kullanıcı verileri için istekte bulunur.
  7. Google, isteğinizin ve jetonun geçerli olduğuna kanaat getirirse istenen verileri döndürür.

Bazı akışlarda başka adımlar da yer alır. Örneğin, yeni erişim jetonları almak için yenileme jetonları kullanmak. Farklı uygulama türlerine yönelik akışlar hakkında ayrıntılı bilgi için Google'ın OAuth 2.0 dokümanlarına bakın.

Google Sites Data API için OAuth 2.0 kapsam bilgileri şöyledir:

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

Uygulamanızın OAuth 2.0 kullanarak erişim isteğinde bulunabilmesi için hem kapsam bilgilerine hem de uygulamanızı kaydederken Google tarafından sağlanan bilgilere (ör. istemci kimliği ve istemci gizli anahtarı) ihtiyacı vardır.

Başa dön

Sürüm belirtme

Google Sites Data API'ye gönderdiğiniz her istekte 1.4 sürümü belirtilmelidir. Sürüm numarası belirtmek için GData-Version HTTP üstbilgisini kullanın:

GData-Version: 1.4

Alternatif olarak, HTTP üstbilgilerini ayarlayamıyorsanız URL'de sorgu parametresi olarak v=1.4 değerini belirtebilirsiniz. Ancak mümkün olduğunda HTTP üstbilgisi tercih edilir.

Not: İstemci kitaplıkları, uygun sürüm başlıklarını otomatik olarak sağlar. Bu nedenle, istemci kitaplığı kullanırken v=1.4 sorgu parametresini kullanmayın.

Başa dön

Site Feed'i

Site feed'i, bir kullanıcının sahip olduğu veya görüntüleme iznine sahip olduğu Google Sites sitelerini listelemek ve mevcut bir sitenin başlığını değiştirmek için kullanılabilir. G Suite alanları için, tüm bir siteyi oluşturmak veya kopyalamak amacıyla da kullanılabilir.

Listeleme siteleri

Bir kullanıcının erişebildiği siteleri listelemek için aşağıdaki URL'ye kimliği doğrulanmış bir GET isteği gönderin:

https://sites.google.com/feeds/site/domainName
Feed parametresiAçıklama
domainName"site" veya G Suite tarafından barındırılan alan adınız (ör. example.com).

Yanıtta, sitelerin listesini içeren bir feed bulunur:

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>

Siteler alfabetik sıralamaya göre listelenir.

Yeni site oluşturma

Not: Bu özellik yalnızca G Suite alanlarında kullanılabilir.

Yeni siteler, site feed'ine bir HTTP POST gönderilerek sağlanabilir. Örneğin:

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>

Yukarıdaki istek, example.com G Suite alanında "slate" temalı yeni bir Google Sites sitesi oluşturur. Sitenin URL'si http://sites.google.com/a/example.com/source-site/ olur.

Site başarıyla oluşturulursa sunucu 201 Created ile yanıt verir. Yanıt girişi, sunucu tarafından eklenen öğeleri (ör. site bağlantısı, sitenin ACL feed'i bağlantısı, site adı, başlık ve özet) içerir.

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

Site kopyalama

Not: Bu özellik yalnızca G Suite alanlarında kullanılabilir.

Mevcut bir site, yeni bir site oluşturma ile aynı şekilde kopyalanabilir. Ancak POST isteğinin Atom girişinde, kopyalanacak sitenin site feed'ini işaret eden rel='source' ile bir <link> ekleyin. Kopyalanan tüm sitelerde bu bağlantı bulunur. Bir siteyi kopyalamayla ilgili örnek:

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>

Yukarıdaki istek, http://sites.google.com/a/example.com/source-site/ adresindeki siteyi kopyalar.

Önemli noktalar:

  • Yalnızca kimliği doğrulanmış kullanıcının sahip olduğu siteler ve site şablonları kopyalanabilir.
  • Site şablonları da kopyalanabilir. Google Sites ayarları sayfasında "Bu siteyi şablon olarak yayınla" ayarı işaretliyse site bir şablondur.
  • Kaynak sitede sahip olarak listelenmeniz koşuluyla başka bir alandaki siteyi kopyalayabilirsiniz.

Bir sitenin meta verilerini güncelleme

Bir sitenin başlığını veya özetini güncellemek için site girişinin edit bağlantısına bir HTTP PUT gönderin. Örneğin, aşağıdaki örnekte önceki sitenin başlığı New Test Site2, açıklaması ise Newer description olarak güncellenir.

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>

Kategori ekleme

Not: Bu özellik yalnızca G Suite alanlarında kullanılabilir.

Alanınız için G Suite siteleri, alanınızdaki siteleri kategorilere ayırmak için yararlı olan kategori meta verilerini içerir. Kategori meta verilerini eklemek veya güncellemek için site girişinizin edit bağlantısına category etiketi içeren bir HTTP PUT gönderin. Aşağıdaki örnekte kalın harflerle yazılmış satıra bakın:

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>

Bu örnekte, mevcut bir site düzenlenir ve "Ekip Sitesi" kategorisi eklenir.

Ek <category> etiketleri ekleyerek birden fazla kategori de ekleyebilirsiniz. Aşağıdaki örnekte kalın harflerle yazılmış satırlara bakın:

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>

Bu örnekte iki kategori eklenir: "Ekip Sitesi" ve "Hukuk Departmanı"

Web adresi eşlemeleri

Web adresi eşlemeleri, Sites kullanıcılarının kendi alanlarını bir Google Sites sitesiyle eşlemesine olanak tanır. Örneğin, http://sites.google.com/a/domain.com/mysite yerine http://www.mydomainsite.com kullanılabilir. Sitenizin nerede barındırıldığına bağlı olarak, sitenin web adresi eşlemelerini manuel olarak değiştirebilirsiniz. Daha fazla bilgi için Yardım Merkezi makalemizi inceleyin.

Bir sitenin web adresi eşlemelerini getirme

Bir sitenin web adresi eşlemelerini döndürmek için site girişini/feed'ini with-mappings=true parametresiyle getirin:

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>

Mevcut eşlemeler, rel='webAddressMapping' ile link olarak gösterilir. Örneğin, yukarıdaki örnekte http://sites.google.com/site/myOtherTestSite sitesine yönlendiren üç webAddressMapping vardır.

Web adresi eşlemelerini değiştirme

Not: Web adresi eşlemeleriyle çalışırken tüm GET/POST/PUT işlemlerinde with-mappings=true parametresi belirtilmelidir. Parametre yoksa site girişlerinde (GET) webAddressMapping döndürülmez veya bir girişten eşlemeler güncellenirken/kaldırılırken (PUT) dikkate alınmaz.

Bir eşlemeyi eklemek, güncellemek veya silmek için yeni siteler oluştururken ya da bir sitenin meta verilerini güncellerken bu tür bir bağlantıyı belirtmeniz, değiştirmeniz veya kaldırmanız yeterlidir. with-mappings=true parametresi, site feed'i URI'sine eklenmelidir. Not: Adres eşlemelerini güncellemek için site yöneticisi veya G Suite tarafından barındırılan bir site söz konusuysa alan yöneticisi olmanız gerekir.

Örneğin, aşağıdaki istek http://www.mysitemapping.com eşlemesini http://www.my-new-sitemapping.com olarak günceller ve bağlantıyı girişin dışında bırakarak http://www.mysitemapping2.com değerini kaldırır:

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>

Web adresi eşlemelerinin bir site oluşturulurken/kopyalanırken de belirtilebileceğini unutmayın.

Başa dön

Etkinlik Feed'i

Etkinlik feed'ini getirerek bir sitenin son etkinliklerini (değişikliklerini) getirebilirsiniz. Etkinlik feed'indeki her giriş, sitede yapılan bir değişiklikle ilgili bilgi içerir.

Etkinlik feed'ini sorgulamak için etkinlik feed'i URL'sine bir HTTP GET gönderin:

https://sites.google.com/feeds/activity/domainName/siteName
Feed parametresiAçıklama
domainName"site" veya G Suite tarafından barındırılan alan adınız (ör. example.com).
siteNameSitenizin web alanı adı.Sitenin URL'sinde bulunur (ör. myCoolSite).

Örnek istek ve yanıt:

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>

Not: Bu feed'e erişmek için sitenin ortak çalışanı veya sahibi olmanız gerekir. İstemciniz doğru Authorization üstbilgisini göndermeli ve İstekleri yetkilendirme bölümünde elde edilen jetona referans vermelidir.

Başa dön

Düzeltme Feed'i

Herhangi bir içerik girişinin düzeltme geçmişini almak için girişin düzeltme bağlantısına bir HTTP GET gönderin:

https://sites.google.com/feeds/revision/domainName/siteName/CONTENT_ENTRY_ID
Feed parametresiAçıklama
domainName"site" veya G Suite tarafından barındırılan alan adınız (ör. example.com).
siteNameSitenizin web alanı adı.Sitenin URL'sinde bulunur (ör. myCoolSite).

Belirli bir sayfa/yorum/ek/liste öğesinin düzeltme bağlantısını bulmak için önce CONTENT_ENTRY_ID değerini kullanarak içerik feed'inden girişi alın. Alınan giriş, düzeltme feed'ine bir <atom:link> içerir. Örneğin:

<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"/>

Örnek istek ve yanıt:

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>

Not: Bu feed'e erişmek için sitenin ortak çalışanı veya sahibi olmanız gerekir. Müşteriniz doğru Authorization üstbilgisini göndermeli ve İstekleri yetkilendirme bölümünde elde edilen jetona referans vermelidir.

Başa dön

İçerik Feed'i

İçerik alınıyor

İçerik feed'i, bir Sites sitesinin mevcut içeriğini listeler. Aşağıdaki URL'ye kimliği doğrulanmış bir GET isteği gönderin:

https://sites.google.com/feeds/content/domainName/siteName
Feed parametresiAçıklama
domainName"site" veya G Suite tarafından barındırılan alan adınız (ör. example.com).
siteNameSitenizin web alanı adı.Sitenin URL'sinde bulunur (ör. myCoolSite).

Sonuç, Sitedeki içerik girişlerinin ilk sayfasını listeleyen bir feed'dir. Feed'deki her giriş, webpage, filecabinet, attachment, comment gibi farklı bir içerik girişi türünü temsil eder. <category scheme="http://schemas.google.com/g/2005#kind"> öğesi, girişin türünü belirler. Desteklenen kind değerlerinin listesi için referans kılavuzunu inceleyin.

Not: Bu feed, sitenin paylaşım izinlerine bağlı olarak kimlik doğrulama gerektirebilir veya gerektirmeyebilir. Site herkese açık değilse istemciniz doğru Authorization başlığını göndermeli (yukarıdaki örnekte gösterildiği gibi) ve İstekleri yetkilendirme bölümünde elde edilen jetona referans vermelidir.

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>

Not: Bunlar yalnızca ilk birkaç sonuçtur. İçerik feed'inin tamamında gezinmek için feed'in "sonraki" bağlantısını takip edin:

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

Atom'un ortak öğelerinin açıklaması için Google Veri Protokolü referansına bakın. Klasik Sites API için özel bir anlamı olan öğeler aşağıda açıklanmıştır. Belirli tür girişleri ek özelliklere (aşağıda listelenmemiştir) sahipken diğerleri sahip değildir. Örneğin, bir listitem girişinde <gs:field> öğeleri bulunabilirken webpage girişinde bulunmaz.

ÖğeAçıklama
<content ...>İç metin, sayfanın HTML gövdesidir. Bazı girişlerde (ör. ekler) bu öğe, dosyayı işaret eden bir src özelliği içerir.
<link rel="alternate" ...>Google Sites'taki sayfanın veya öğenin bağlantısı.
<link rel="http://schemas.google.com/sites/2008#revision" ...>href özelliği, girişin düzeltme feed'ini gösterir.
<link rel="http://schemas.google.com/sites/2008#parent" ...>href özelliği, girişin üst girişini gösterir.
<link rel="http://schemas.google.com/sites/2008#template" ...>href özelliği, girişin şablon sayfasına işaret eder.
<category scheme="http://schemas.google.com/g/2005#kind" ...>label, giriş türüdür.
<category term="http://schemas.google.com/g/2005#template" ...>label=template, girişin bir şablon olduğunu belirtir.
<gd:feedLink>href özelliği, girişin üst öğesinin alt öğelerini gösterir.
<sites:pageName>Sayfanın web alanı adı; sayfanın URL'sindeki ada karşılık gelir.
<sites:revision>Mevcut düzeltme numarası.

İçerik feed'i sorgu örnekleri

Standart Google Data API sorgu parametrelerinden bazılarını ve klasik Sites API'ye özgü parametreleri kullanarak içerik feed'inde arama yapabilirsiniz. Daha ayrıntılı bilgi ve desteklenen parametrelerin tam listesi için Referans Kılavuzu'na bakın.

Belirli giriş türlerini alma

Yalnızca belirli bir giriş türünü getirmek için kind parametresini kullanın. Bu örnek yalnızca webpage giriş döndürür:

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

Birden fazla giriş türü döndürmek için her kind değerini "," ile ayırın. Bu örnekte filecabinet ve listpage girişleri döndürülür:

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

Alternatif olarak, kind parametresi yerine Google Veri /-/category sorgusu için standart biçimi kullanabilirsiniz:

GET /feeds/content/domainName/siteName/-/filecabinet|listpage

Sayfa şablonları alınıyor

Bu örnekte yalnızca template sayfa döndürülür:

GET /feeds/content/domainName/siteName/-/template

Tüm giriş türlerini döndürmek ve template sayfalarını dahil etmek için şunu kullanın:

GET /feeds/content/domainName/siteName/-/template|-template

Yola göre sayfa alma

Google Sites sitesindeki bir sayfanın göreli yolunu biliyorsanız ilgili sayfayı getirmek için path parametresini kullanabilirsiniz. Bu örnek, http://sites.google.com/site/siteName/path/to/the/page adresinde bulunan sayfayı döndürür:

GET /feeds/content/domainName/siteName?path=/path/to/the/page

Üst sayfa altındaki tüm girişleri alma

Bir sayfanın giriş kimliğini biliyorsanız tüm alt girişlerini (varsa) getirmek için parent parametresini kullanabilirsiniz:

GET /feeds/content/domainName/siteName?parent=CONTENT_ENTRY_ID

Taslaklar veya silinen girişler dahil

Taslak veya silinmiş girişleri dahil etmek için sırasıyla include-drafts veya include-deleted parametrelerini kullanın. Bu örnekte, içerik feed'indeki taslak girişler yer alır:

GET /feeds/content/domainName/siteName?include-drafts=true

Tam metin arama

Bir sitenin tüm içeriğinde arama yapmak için q parametresini kullanarak tam metin araması yapın:

GET /feeds/content/domainName/siteName?q=Text%20I%20am%20looking%20for

Başa dön



İçerik oluşturma

İçerik feed'ine bir HTTP POST göndererek yeni içerik (web sayfaları, liste sayfaları, dosya dolabı sayfaları, duyuru sayfaları vb.) oluşturulabilir:

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

Desteklenen giriş türlerinin listesi için Referans Kılavuzu'ndaki kind parametresine bakın.

Yeni öğe/sayfa oluşturma

Bu örnek, sitenin üst düzeyinde yeni bir webpage oluşturur, sayfa gövdesi için bazı XHTML'ler içerir ve başlık adını "Yeni Web Sayfası Başlığı" olarak ayarlar:

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>

İşlem başarılı olursa sunucu, 201 Created ve girişin bir kopyasıyla yanıt verir.

Özel URL yolları altında öğe/sayfa oluşturma

Varsayılan olarak, önceki örnek http://sites.google.com/domainName/siteName/new-webpage-title URL'si altında oluşturulur ve "Yeni Web Sayfası Başlığı" sayfa başlığına sahip olur. Yani URL için <atom:title>, new-webpage-title olarak normalleştirilir. Bir sayfanın URL yolunu özelleştirmek için <sites:pageName> öğesini ayarlayabilirsiniz.

Bu örnekte, sayfa başlığı "Dosya Depolama" olan yeni bir filecabinet oluşturulur ancak <sites:pageName> öğesi belirtilerek sayfa http://sites.google.com/domainName/siteName/files URL'si altında oluşturulur.

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>

Sunucu, bir sayfanın URL yolunu adlandırmak için aşağıdaki öncelik kurallarını kullanır:

  1. <sites:pageName> (varsa). a-z, A-Z, 0-9, -, _ koşulunu karşılamalıdır.
  2. <atom:title>, pageName yoksa boş olmamalıdır. Normalleştirme, boşlukları kırpıp "-" karakterine daraltmak ve a-z, A-Z, 0-9, -, _ ile eşleşmeyen karakterleri kaldırmaktır.

Örneğin, "Custom_Page2" sunucu tarafından kabul edilir.

Alt sayfa oluşturma

Üst sayfanın altında alt sayfalar (alt öğeler) oluşturmak için yeni Atom girişinize bir <link rel="http://schemas.google.com/sites/2008#parent"> ekleyin. Bağlantının href özelliğini üst girişin öz bağlantısına ayarlayın.

Bu örnekte, giriş kimliği PARENT_ENTRY_ID olan bir üst duyuru sayfasının altında "duyuru" başlığıyla yeni bir announcement oluşturulur. Sayfa gövdesi için XHTML içeriği de eklenir:

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>

Sayfa şablonları

Sayfa şablonları oluşturma

Sayfa şablonu oluşturma işlemi, yeni öğe/sayfa oluşturma ve alt sayfa oluşturma işlemleriyle aynıdır. Fark, sırasıyla "http://schemas.google.com/g/2005#template" ve "template" olarak ayarlanmış terim ve etiketle category öğesinin eklenmesidir.

Bu örnekte yeni bir webpage şablonu oluşturulur.

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>

Şablondan sayfa oluşturma

Sayfa şablonları oluşturmaya benzer şekilde, bir sayfa şablonunun öz bağlantısına işaret eden rel='http://schemas.google.com/sites/2008#template' içeren bir <link> ekleyerek şablondan yeni bir sayfa örneklendirebilirsiniz.

Bu örnekte, dosya dolabını tanımlayan mevcut bir sayfa şablonundan yeni bir filecabinet sayfası oluşturulmaktadır.

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>

Not: Şablon bir <category> tanımlasa da girişinize bir tane eklemeniz gerekir. Ayrıca, <content> öğesi eklerseniz sunucu bunu reddeder.

Dosyalar yükleniyor

Google Sites'ta olduğu gibi, API, dosya dolabı sayfalarına ve üst sayfalara ek yüklemenize olanak tanır.

Bir üst öğeye ek yüklemek için içerik feed'i URL'sine bir HTTP POST isteği gönderin:

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

POST gövdesi, dosya içeriklerini ekin meta verilerini içeren bir <atom:entry> ile birleştirmek için MIME çok parçalı istek olmalıdır. <atom:entry>, ekin nerede oluşturulacağını belirtmek için üst girişin öz bağlantısına referans vermelidir. Daha fazla bilgi için Alt sayfa oluşturma başlıklı makaleyi inceleyin.

Ekler yükleniyor

Aşağıda, kimliği PARENT_ENTRY_ID olan bir dosya dolabı sayfasına PDF dosyası yükleme örneği verilmiştir. Ek, "PDF Dosyası" başlığı ve (isteğe bağlı) "İK paketi" açıklamasıyla oluşturulur.

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

Yükleme başarılı olursa sunucu 201 Created ve yeni oluşturulan ek girişinin bir kopyasıyla yanıt verir.

Klasöre ek yükleme

filecabinet içindeki mevcut bir klasöre ek yüklemek için "term" özelliği klasörün adına ayarlanmış bir kategori ekleyin:

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

Web ekleri

Web ekleri, özel ek türleridir. Bunlar, dosya dolabı listelerinize ekleyebileceğiniz, web'deki diğer dosyalara yönlendiren bağlantılardır. Bu özellik, Google Sites kullanıcı arayüzündeki "URL ile dosya ekle" yükleme yöntemine benzer.

Not: Web ekleri yalnızca dosya dolabı sayfasında oluşturulabilir. Diğer sayfa türlerine yüklenemezler.

Bu örnekte, FILECABINET_ENTRY_ID kimliğiyle referans verilen dosya dolabının altında bir webattachment oluşturulur. Başlığı ve (isteğe bağlı) açıklaması sırasıyla "GoogleLogo" ve "güzel renkler" olarak ayarlanmıştır.

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, kullanıcının dosya dolabında "http://www.google.com/images/logo.gif" adresindeki resme yönlendiren bir bağlantı oluşturur.

Başa dön



İçerik Güncelleme

Herhangi bir sayfanın meta verileri (başlık, sayfa adı vb.) ve sayfa içeriği, edit bağlantısına tek bir PUT isteği gönderilerek düzenlenebilir. İstek gövdesi, güncellenen sayfayı açıklayan bir Atom girişi içermelidir. Bu kuralın istisnası, yalnızca eklerin meta verilerini güncellemek için kullanılabilen ek girişleridir. Ekli dosyanın içeriğini değiştirmek için ham verileri, ek dosyanın edit-media bağlantısına gönderilen bir PUT isteğinin gövdesi olarak eklemeniz yeterlidir. MIME çok parçalı istek kullanarak hem meta verileri hem de ekli dosya içeriklerini aynı anda güncelleyebilirsiniz.

Güncellemenizin başka bir istemcinin değişikliklerinin üzerine yazmadığını doğrulamak için orijinal girişin ETag değerini ekleyin. Bunu yapmak için ETag değerini bir HTTP If-Match üstbilgisinde sağlayabilir veya orijinal girişin gd:etag özelliğini güncellenen girişe ekleyebilirsiniz. Orijinal girişin ETag değerini belirlemek için <entry> öğesinin gd:etag özelliğini inceleyin. Medya girişleri için medyanın ETag'i, edit-media bağlantısının gd:etag özelliğinde bulunabilir.

Girişi, siz aldıktan sonra başka birinin güncelleyip güncellemediğine bakılmaksızın güncellemek istiyorsanız If-Match: * kullanın ve ETag'i eklemeyin. ETag'ler hakkında daha fazla bilgi için Google Veri API'leri referans kılavuzuna bakın.

Bir öğenin meta verilerini veya HTML içeriğini güncelleme

Bir girişin meta verilerini veya HTML içeriğini güncellemek için girişin edit bağlantısına bir HTTP PUT gönderin.

Aşağıda, bir listpage girişinin (ENTRY_ID kimliğiyle temsil edilir) aşağıdaki değişikliklerle güncellenmesine dair bir örnek verilmiştir:

  • Başlık, "Güncellenmiş İçerik" olarak değiştirildi.
  • Güncellenen HTML içeriği
  • Listenin ilk sütun başlığı "Sahip" olarak güncellendi.
  • Sayfanın URL yolu, <sites:pageName> öğesi tarafından değiştiriliyor
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="Description"/>
    <gs:column index="C" name="Completed"/>
  </gs:data>
  <sites:pageName>newPagePath</sites:pageName>
</entry>

Not: Giriş (sunucu tarafından döndürüldüğü şekilde), yukarıdaki örnekten daha fazla öğe içerir.

Ek içeriğini değiştirme

Aşağıda, bir ekin içeriğini değiştirip meta verilerini değiştirmeden bırakma örneği verilmiştir. İstek yeni içerik barındırdığından ek girişinin edit-media bağlantısı kullanılır.

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

Ek meta verileri ve içeriği güncelleniyor

Aşağıda, bir ekin hem meta verilerini hem de içeriğini aynı anda güncelleme örneği verilmiştir. Eklerin adı "Yeni Başlık" olarak güncellenir ve içeriği bir .zip dosyasının içeriğiyle değiştirilir. İstek yeni dosya içeriği barındırdığından ek girişinin edit-media bağlantısı kullanılır.

Meta veriler için ETag eklemenin, medya içeriği için de dolaylı bir If-Match sağladığını unutmayın. Bunun nedeni, medya içeriğinde yapılan her güncellemenin meta verilerin ETag'inin değişmesine neden olmasıdır.

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

Başa dön



İçerik silme

Bir Google Sitesi'nden öğe kaldırmak için önce girişi alın, ardından girişin edit URL'sine bir DELETE isteği gönderin. Bu, bir öğenin meta verilerini veya HTML içeriğini güncellerken kullanılan URL ile aynıdır.

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>

Giriş başarıyla silindiyse sunucu HTTP 200 OK ile yanıt verir.

Alınmasından sonra başka bir istemci tarafından değiştirilen bir girişi silmediğinizden emin olmak istiyorsanız orijinal girişin ETag değerini içeren bir HTTP If-Match üstbilgisi ekleyin. <entry> öğesinin gd:etag özelliğini inceleyerek orijinal girişin ETag değerini belirleyebilirsiniz.

Siz aldıktan sonra başka birinin güncelleyip güncellemediğine bakılmaksızın girişi silmek istiyorsanız If-Match: * kullanın ve ETag'i eklemeyin. (Bu durumda, girişi silmeden önce almanıza gerek yoktur.)

ETag'ler hakkında daha fazla bilgi için Google Veri API'leri referans kılavuzuna bakın.

Başa dön



Ekler indiriliyor

Ek girişiniz olduğunda, girişin <content> src bağlantısına kimliği doğrulanmış bir HTTP GET göndererek dosyayı indirebilirsiniz. PDF'nin içerik bağlantısına bir örnek:

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

Başa dön

ACL Feed'i

Paylaşım izinlerine (Erişim Denetim Listeleri) genel bakış

EKL feed'indeki her EKL girişi, belirli bir öğenin erişim rolünü temsil eder. Bu öğe bir kullanıcı, kullanıcı grubu, alan veya varsayılan erişim (herkese açık bir site) olabilir. Yalnızca açık erişime sahip varlıklar için girişler gösterilir. Google Sites kullanıcı arayüzünün paylaşım ekranındaki "Erişimi olan kişiler" panelinde her e-posta adresi için bir giriş gösterilir. Bu nedenle, bir siteye dolaylı erişimi olan alan yöneticileri gösterilmez.

Roller

Rol öğesi, bir varlığın sahip olabileceği erişim düzeyini temsil eder. gAcl:role öğesinin dört olası değeri vardır:

  • reader: Görüntüleyici (salt okuma erişimine eşdeğer).
  • writer: Ortak çalışan (okuma/yazma erişimine eşdeğer).
  • owner: Genellikle site yöneticisidir (okuma/yazma erişimine eşdeğerdir).

Kapsamlar

Kapsam öğesi, bu erişim düzeyine sahip varlığı temsil eder. gAcl:scope öğesinin beş olası türü vardır:

  • user: E-posta adresi değeri (ör. "user@gmail.com").
  • group: Google Grubu e-posta adresi (ör. "grup@alan.com").
  • domain: G Suite alan adı (ör. "alan.com").
  • invite: Siteye davet edilen ancak henüz sitenin ACL'sine eklenmemiş bir kullanıcı. (gdata 1.3 veya daha eski bir sürüm belirtilmişse kullanılamaz.)
  • default: "default" türünde yalnızca bir olası kapsam vardır ve bu kapsamın değeri yoktur (ör. <gAcl:scope type="default">). Bu kapsam, herhangi bir kullanıcının herkese açık bir sitede varsayılan olarak sahip olduğu erişimi kontrol eder.

Not: Alan adlarının gAcl:role değeri "sahip" erişimi olarak ayarlanamaz. Alan adları yalnızca okuyucu veya yazıcı olabilir.

"Davet" kapsamı hakkında.

API, henüz Google Hesabı olmayan bir veya daha fazla kullanıcıyı ACL'ye eklediğinizde davet kapsamını döndürür. API, davet edilen kullanıcıların daveti kabul etmesine izin vermek için onlara sağlamanız gereken yerleşik jeton içeren bir URL döndürür.

Bu davet yöntemi, Google hesabı olmayan kullanıcıları hangi e-posta adresini kullanmak istediklerini önceden bilmeden davet etmenize olanak tanır. Kullanıcılar, yerleştirilmiş jetonun bulunduğu davet URL'sini tıkladıkları sürece istedikleri e-posta adresini kullanarak erişim için kaydolabilir. Ayrıca, birden fazla kullanıcı daveti kabul etmek için bu URL'yi kullanabilir. Bu nedenle, bir kullanıcıyı veya bir kullanıcı grubunu davet ederken bu URL'den yararlanabilirsiniz.

Not: "Davet" kapsamı yalnızca gdata 1.4 ve sonraki sürümlerde kullanılabilir. Açıkça 1.3 veya daha düşük bir sürüm belirtiyorsanız bu işlem işe yaramaz.

EKL feed'ini alma

ACL feed'i, bir sitenin paylaşım izinlerini kontrol etmek için kullanılabilir ve aşağıdaki URI üzerinden erişilebilir:

https://sites.google.com/feeds/acl/site/domainName/siteName
Feed parametresiAçıklama
domainName"site" veya G Suite tarafından barındırılan alan adınız (ör. example.com).
siteNameSitenizin web alanı adı.Sitenin URL'sinde bulunur (ör. myCoolSite).

Site feed'indeki her girişin bu feed'e bir bağlantı içerdiğini belirtmekte fayda var:

 <link rel="http://schemas.google.com/acl/2007#accessControlList" type="application/atom+xml"
      href="https://sites.google.com/feeds/acl/site/domainName/siteName"/>

Bir sitenin paylaşım izinlerini almak için ACL feed'i URI'sine bir HTTP GET gönderin:

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

Sunucu, 200 OK ve ACL girişlerinin feed'iyle yanıt verir:

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

Başa dön

Site paylaşma

Erişim denetim listesi feed'i GET, POST ve PUT isteklerini kabul eder. Erişim denetim listesi feed'ine yeni bir rol eklemek için sitenin erişim denetim listesi feed'ine bir POST isteği göndermeniz yeterlidir.

Not: Belirli paylaşım ACL'leri yalnızca alan bu tür izinlere izin verecek şekilde yapılandırılmışsa (ör.G Suite alanları için alan dışında paylaşıma izin veriliyorsa vb.) mümkün olabilir.

Bu örnekte, siteye yeni bir ortak çalışan (yazar) eklenmektedir:

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>

Başarılı bir ekleme işleminde 201 Created ve yeni giriş döndürülür:

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

"Davet" kapsamı aracılığıyla kullanıcıları davet etme

Google Hesabı olmayan kullanıcılar eklerseniz API, davet etmek istediğiniz kullanıcılara vermeniz gereken bir URL döndürür. URL'yi tıkladıktan sonra mevcut bir hesapla oturum açarak veya yeni bir hesap oluşturarak siteye erişebilirler.

Başarılı bir davet, 201 Created ve kullanıcıya iletmeniz gereken URL'yi içeren yeni bir giriş döndürür:

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

Grup ve alan düzeyinde paylaşım

Bir siteyi tek bir kullanıcıyla paylaşmaya benzer şekilde, bir siteyi bir Google grubu veya G Suite alanında paylaşabilirsiniz. Gerekli scope değerleri aşağıda listelenmiştir.

Grup e-posta adresiyle paylaşma:

<gAcl:scope type="group" value="group@example.com"/>

Tüm alanla paylaşma:

<gAcl:scope type="domain" value="example.com"/>

Alan düzeyinde paylaşım yalnızca G Suite alanları ve sitenin barındırıldığı alan için desteklenir. Örneğin, http://sites.google.com/a/alan1.com/siteA, sitenin tamamını yalnızca alan1.com ile paylaşabilir, alan2.com ile paylaşamaz. G Suite alanında barındırılmayan siteler (ör. http://sites.google.com/site/siteB) alanları davet edemez.

Paylaşım izinlerini değiştirme

Bir ACL girişini güncellemek için girişi gerektiği gibi değiştirin ve girişin edit bağlantısına bir HTTP PUT isteği gönderin. Bu bağlantı, "rel" özelliği "edit" olarak ayarlanmış bir <link> öğesidir. Önceki örnekte bu bağlantı şöyledir:

<link rel='edit' type='application/atom+xml'
    href='https://sites.google.com/feeds/acl/site/domainName/siteName/user%3Anew_writer%40example.com'/>

Aşağıdaki snippet, new_writer@gmail.com kullanıcısının rolünü "okuyucu" olarak değiştirir:

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>

Paylaşım izinleri kaldırılıyor

Bu kullanıcının izinlerini kaldırmak için PUT isteği için kullanılan edit bağlantısına bir DELETE isteği gönderin:

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>

Sunucu 200 OK ile yanıt verir.

Başa dön

Özel Konular

Feed'i veya girişi tekrar alma

Daha önce aldığınız bir feed'i veya girişi almak istiyorsanız sunucuya, listeyi veya girişi yalnızca son aldığınızdan bu yana değiştiyse göndermesini söyleyerek verimliliği artırabilirsiniz.

Bu tür koşullu alma işlemi yapmak için HTTP If-None-Match üstbilgisi içeren bir HTTP GET isteği gönderin. Başlıkta, listenin veya girişin ETag'ini belirtin. Bu bilgiyi <feed> öğesinin veya <entry> öğesinin gd:etag özelliğinde bulabilirsiniz.

Site feed'ini kullanan bir örnek:

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

Sunucu bu isteği aldığında, istediğiniz öğenin belirttiğiniz ETag ile aynı ETag'e sahip olup olmadığını kontrol eder. ETag'ler eşleşirse öğe değişmemiştir ve sunucu, HTTP 304 Not Modified durum kodu veya HTTP 412 Precodition Failed durum kodu döndürür. Bu durum kodlarının her ikisi de daha önce aldığınız öğenin güncel olduğunu gösterir.

ETag'ler eşleşmiyorsa öğe, son istediğinizden bu yana değiştirilmiştir ve sunucu öğeyi döndürür.

ETag'ler hakkında daha fazla bilgi için Google Veri API'leri referans kılavuzuna bakın.

Toplu İşleme

Toplu istekler, istemcinize her işlemi ayrı ayrı göndermek yerine tek bir istekte birden fazla işlem yürütme olanağı sağlar.

Sunucu, istenen değişikliklerden mümkün olduğunca fazlasını gerçekleştirir ve her işlemin başarılı veya başarısız olduğunu değerlendirmek için kullanabileceğiniz durum bilgilerini döndürür. Google Veri API'lerinde toplu işlem hakkında daha fazla bilgi için Google Veri API'leri ile Toplu İşlem başlıklı makaleyi inceleyin.

Ekleme işlemleri hariç olmak üzere, toplu feed'deki her işlemin bir <id> öğesi vardır. Bu öğe, içerik feed'ini güncellerken, silerken veya sorgularken normalde kullanacağınız istek URL'si ile aynıdır. Örneğin, bir düzenlemeyi güncelliyorsanız <id> değerini söz konusu girişin edit bağlantısına ayarlayın. Hedef girişi tanımlamak için kullanılır. Yeni girişler henüz oluşturulmadığı için <id> öğeleri içermez. Bunun yerine, <batch:id> içinde bir dize değeri tanımlayabilirsiniz. Bu değer, sunucunun yanıtında döndürülür ve ilgili girişi aramak için kullanılır.

Toplu istek oluşturmak için bir toplu feed oluşturun ve feed'in toplu bağlantısına bir HTTP POST gönderin:

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

Aşağıdaki örnekte bir web sayfası girişinin nasıl sorgulanacağı, ekleneceği, güncelleneceği ve silineceği gösterilmektedir:

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>

Döndürülen feed, her işlem için bir sonuç girişi içerir:

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

Başa dön