Protokol Kılavuzu

Klasik Google Sites API, uygulamalarınızın bir Google Sites sitesindeki içeriğe erişmesine, içeriğinizi yayınlamasına ve değiştirmesine olanak tanır. Buna ek olarak, uygulamanız en son etkinliklerin listesini isteyebilir, düzeltme geçmişini alabilir 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şimde bulunabilecek istemci uygulamaları yazmak isteyen programcılar için hazırlanmıştır. Ham XML/HTTP kullanan temel veri API'si etkileşimlerine dair bir dizi örnek ve açıklamalar sunar. Bu belgeyi okuduktan sonra, istemci kitaplıklarımızı kullanarak API ile etkileşimde bulunma hakkında daha fazla bilgi edinmek için sol taraftaki gezinme çubuğundaki diğer kılavuzlarda bulunan dile özgü örnekler.

Bu kılavuzdaki malzemelere ilişkin referans için referans kılavuzuna göz atın.

İstekleri yetkilendirme

Uygulamanız herkese açık olmayan kullanıcı verileri istediğinde 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

Herkese açık olmayan kullanıcı verileri için Google Sites Data API'ye yapılan istekler, kimliği doğrulanmış bir kullanıcı tarafından yetkilendirilmelidir.

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 Veri API'sını 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 aşağıda verilmiştir:

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. Bir sürüm numarası belirtmek için: GData-Version HTTP üst bilgisini kullanın:

GData-Version: 1.4

Alternatif olarak, HTTP üstbilgilerini ayarlayamıyorsanız URL'de bir sorgu parametresi olarak v=1.4 belirtebilirsiniz. Ancak Mümkünse HTTP başlığı tercih edilir.

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

Başa dön

Site Özet Akışı

Site özet akışı, bir kullanıcının sahip olduğu veya görüntüleme izinlerine sahip olduğu Google Sites sitelerini listelemek için kullanılabilir. mevcut bir sitenin başlığını da değiştirebilirsiniz. G Suite alanlarında, bir bir şablondur.

Site listeleme

Bir kullanıcının erişebildiği siteleri listelemek için aşağıdaki URL'ye kimliği doğrulanmış 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ınızın alanı (ör. example.com).

Yanıt, sitelerin listesini içeren bir feed içerir:

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

Yeni site oluşturma

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

Site feed'ine HTTP POST eklenerek yeni siteler 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, "seçenek listesi" ile yeni bir Google Sitesi oluşturur G Suite alanı example.com altında bir tema oluşturabilirsiniz. Sitenin URL'si http://sites.google.com/a/example.com/kaynak-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. siteyi, sitenin EKL özet akışının bağlantısını, site adını, başlığını ve özetini 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şturmakla aynı şekilde kopyalanabilir. Ancak, POST isteğinin Atom girişinde, Kopyalanacak sitenin site feed'ini işaret eden rel='source' içeren bir <link> ekleyin. Burada yer alan bu bağlantıya sahip olacak. Aşağıda, bir sitenin kopyasını oluşturmak için bir örnek verilmiştir:

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, siteyi http://sites.google.com/a/example.com/source-site/ adresindeki siteye kopyalar.

Önemli noktalar:

  • Yalnızca kimliği doğrulanmış kullanıcının sahip olduğu siteler ve site şablonları kopyalanabilir.
  • Site şablonu da kopyalanabilir. "Bu siteyi şablon olarak yayınla" seçeneği sunulduğunda site, şablondur ayarının işaretli olup olmadığını kontrol edin.
  • Kaynak sitede sahip olarak listelenmediğiniz sürece, başka bir alandan site 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 HTTP PUT gönderin. Örneğin, aşağıdaki örnekte önceki sitenin başlığı New Test Site2 ve açıklaması Newer description olarak kullanılacak.

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 sitelerin sınıflandırılmasında yararlı olan kategori meta verileri 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ırı inceleyin:

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ırları inceleyin:

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 eklenmiştir: "Ekip Sitesi" ve "Hukuk Departmanı"

Web adresi eşlemeleri

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

Bir sitenin web adresi eşlemelerini getirme

Bir sitenin web adresi eşlemelerini döndürmek için with-mappings=true parametresiyle site girişini/feed'ini 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='webAddress Matching' ile links olarak gösterilir. Örneğin, yukarıdaki örnekte siteye işaret eden üç webAddressMapping var http://sites.google.com/site/myOtherTestSite.

Web adresi eşlemelerini değiştirme

Not: Tüm GET/POST/PUT işlemleri, çalışırken with-mappings=true parametresini belirtmelidir. web adresi eşlemeleri kullanın. Parametre yoksa webAddressMapping öğeleri, site girişlerinde (GET) döndürülmez veya (PUT) eşlemeleri güncellenirken/kaldırılırken.

Bir eşlemeyi eklemek, güncellemek ya da silmek için yeni siteler oluştururken söz konusu bağlantıyı belirtmeniz, değiştirmeniz veya kaldırmanız yeterlidir. bir sitenin meta verilerini güncelleme. 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 kullanıyorsanız 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 öğesini 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, site oluşturma/kopyalama sırasında da belirtilebileceğini unutmayın.

Başa dön

Etkinlik Feed'i

Etkinlik feed'ini getirerek bir Site'nin son etkinliğini (değişiklikleri) getirebilirsiniz. Bu etkinlik feed'i, Sitede yapılan bir değişiklikle ilgili bilgileri 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ınızın alanı (ö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. Müşteriniz doğru Authorization başlığını göndermeli ve alınan jetona referans vermelidir İstekleri yetkilendirme konusuna bakın.

Başa dön

Düzeltme Özet Akışı

Herhangi bir içerik girişinin düzeltme geçmişini getirmek 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ınızın alanı (ör. example.com).
siteNameSitenizin web alanı adı; sitenin URL'sinde bulunur (ör. myCoolSite).

Belirli bir sayfaya/yorum/ek/liste öğesi için düzeltmeler bağlantısını bulmak üzere, önce CONTENT_ENTRY_ID kullanarak içerik feed'i. Alınan giriş, düzeltme feed'i için bir <atom:link> içerecek. Ö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 başlığını göndermeli ve alınan jetona referans vermelidir İstekleri yetkilendirme konusuna bakın.

Başa dön

İçerik Feed'i

İçerik alma

İç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ınızın alanı (ör. example.com).
siteNameSitenizin web alanı adı; sitenin URL'sinde bulunur (ör. myCoolSite).

Sonuç olarak Sitedeki içerik girişlerinin ilk sayfasını listeleyen bir özet akışı elde edilir. Özet akışındaki her bir giriş, farklı bir içerik girişi türünü temsil eder. webpage, filecabinet, attachment, comment vb. <category scheme="http://schemas.google.com/g/2005#kind"> öğesi, girişin türünü belirler. Referans kılavuzunu inceleyin. destek kind değerlerini içeren liste için.

Not: Bu feed, kimlik doğrulama gerektirebilir veya gerekmeyebilir; (Sitenin paylaşım izinlerine bağlı olarak). Site herkese açık değilse, müşteriniz doğru Authorization başlığını göndermelidir (yukarıdaki örnekte görüldüğü gibi) ve Yetkilendirme istekleri bölümünde elde edilen jetona referans verin.

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ını görmek için feed'in "sonraki" bağlantı:

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

Atom'daki ortak öğelerin açıklaması için Google Veri Protokolü referansı sayfasına bakın. Klasik Sites API'ye belirli bir ölçümü olan öğeler aşağıda açıklanmıştır. Belirli tür girişlerin ek özellikleri (aşağıda listelenmeyen), ancak diğerleri de görmez. Örneğin, bir listitem girişi <gs:field> öğesi içerebilirken, bir webpage girişi olmayabilir.

ÖğeAçıklama
<content ...>İç metin, sayfanın HTML gövdesidir. Bazı girişler için (ör. ekler) bu öğe, dosyaya 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 işaret ediyor.
<link rel="http://schemas.google.com/sites/2008#parent" ...>href özelliği, girişin üst girişini işaret ediyor.
<link rel="http://schemas.google.com/sites/2008#template" ...>href özelliği, girişin şablon sayfasını işaret ediyor.
<category scheme="http://schemas.google.com/g/2005#kind" ...>label, girişin türüdür.
<category term="http://schemas.google.com/g/2005#template" ...>label=template, girişin şablon olduğunu belirtir.
<gd:feedLink>href özelliği, girişin üst öğesinin alt öğelerini işaret ediyor.
<sites:pageName>Sayfanın web alanı adı; URL'sindeki ada karşılık gelir.
<sites:revision>Geçerli düzeltme numarası.

İçerik feed'i sorgu örnekleri

Standart Google Data API sorgu parametrelerinden bazılarını kullanarak içerik feed'inde arama yapabilirsiniz. ve klasik Sites API'sine özel olanlar. Daha ayrıntılı bilgi ve desteklenen parametrelerin tam listesi için Başvuru Kılavuzu.

Belirli giriş türlerini alma

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

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

Birden fazla giriş türü döndürmek için her kind öğesini ',' ile ayırın. Bu örnek, filecabinet ve listpage giriş:

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

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

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

Sayfa şablonları alma

Şu örnek yalnızca template sayfaları döndürü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 Sitesindeki bir sayfanın göreli yolunu biliyorsanız o sayfayı getirmek için path parametresini kullanabilirsiniz. Bu örnek, şu adreste bulunan sayfayı döndürür: http://sites.google.com/site/siteName/path/to/the/page:

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 (varsa) tüm alt girişlerini getirmek için parent parametresini kullanabilirsiniz:

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

Taslak veya silinmiş girişler ekleme

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

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

Tam metin arama

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

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

Başa dön



İçerik Oluşturma

Yeni içerikler (web sayfaları, liste sayfaları, dosya dolabı sayfaları, duyuru sayfaları vb.) HTTP POST ekleme:

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

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

Yeni öğeler / sayfalar oluşturma

Bu örnek, Site'nin üst düzeyi altında yeni bir webpage oluşturur ve sayfa gövdesi için bir XHTML içerir. ve başlık başlığı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>

Başarılı olursa sunucu bir 201 Created ve girişin bir kopyası ile yanıt verir.

Özel URL yolları altında öğeler/sayfalar oluşturma

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

Bu örnekte, "Dosya Depolama" sayfa başlığıyla yeni bir filecabinet oluşturulur, ancak sayfa oluşturulur şunun altında bulunur: http://sites.google.com/domainName/siteName/files <sites:pageName> öğesi belirtiliyor.

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. Varsa <sites:pageName>. a-z, A-Z, 0-9, -, _ şartlarını karşılamalıdır.
  2. <atom:title>, pageName yoksa boş olmamalıdır. Normalleştirme, boşlukları "-" olacak şekilde kırpmak ve daraltmak için kullanılır ve a-z, A-Z, 0-9, -, _ ile eşleşmeyen karakterleri kaldırın.

Örnek olarak, "Custom_Page2" tarafından kabul edilir.

Alt sayfalar oluşturma

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

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

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 süreci yeni öğeler/sayfalar oluşturma ve alt sayfalar oluşturmak. Aradaki fark, category öğesinin terimin ve etiketin "http://schemas.google.com/g/2005#template" olarak ayarlandığı şekilde eklenmesidir. ve "template" öğelerini seçin.

Bu örnek yeni bir webpage şablonu oluşturur.

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, rel='http://schemas.google.com/sites/2008#template' ile bir <link> ekleyerek şablondan yeni bir sayfa oluşturabilirsiniz. nişan alma .

Bu örnek, dosya dolabı türünü tanımlayan mevcut bir sayfa şablonundan yeni bir filecabinet sayfası oluşturur.

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: <category> tanımlayan bir şablona rağmen, yine de girilmesi gerekir. Ayrıca, bir <content> öğesi eklerseniz sunucunun bunu reddedeceğini unutmayın.

Dosya yükleme

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

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

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

POST gövdesi, dosya içeriklerinin MIME ile birleştirilmesi için çok parçalı bir MIME isteği olmalıdır Ekin meta verilerini içeren bir <atom:entry>. <atom:entry>, başvuruda bulunmalıdır üst girişin öz bağlantısını tıklayın. Daha fazla bilgi için Alt sayfa oluşturma bölümüne bakın.

Ekler yükleniyor

Aşağıda, PARENT_ENTRY_ID kimliğine sahip bir dosya dolabına PDF dosyası yüklemeyle ilgili bir örnek verilmiştir. Ek oluşturulacak "PDF Dosyası" başlıklı ve (isteğe bağlı) bir açıklama ("HR paketi") içerir.

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 bir 201 Created ve yeni oluşturulan ek girişinin bir kopyası ile yanıt verir.

Klasöre ek yükleme

filecabinet klasöründeki mevcut bir klasöre ek yüklemek için "terim" içeren bir kategori ekleyin özelliği klasörün adına ayarlandı:

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

Web ekleri

Web ekleri, özel ek türleridir. Kısaca, web'deki diğer dosyaların bağlantılarıdır girişlerinize ekleyebilirsiniz. Bu özellik, "URL ile dosya ekle"ye benzerdir. yükleme yöntemini kullanabilirsiniz.

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

Bu örnek, FILECABINET_ENTRY_ID kimliği tarafından referans verilen dosya dolabı altında bir webattachment oluşturur. Başlığı ve (isteğe bağlı) açıklaması "GoogleLogo" olarak ayarlanmıştır ve "güzel renkler" seçeneklerini görebilirsiniz.

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 işaret eden bir bağlantı oluşturur.

Başa dön



İçerik güncelleniyor

Herhangi bir sayfanın meta verileri (başlık, sayfa adı vb.) ve sayfa içeriği, edit bağlantısına yapılan tek bir PUT isteğiyle düzenlenebilir. İsteğin gövdesi, güncellenen sayfayı açıklayan bir Atom girişi içermelidir. Bu kuralın istisnası bir ek girişidir. Bu girişte, yalnızca ekin meta verilerini güncellemek amacıyla kullanılabilir. Ekli dosyanın içeriğini değiştirmek için ham verileri PUT isteğinin gövdesi olarak eklemeniz yeterlidir: ekin edit-media bağlantısı. Ayrıca, meta veri ve ekli dosya içeriğini aynı anda güncellemek için MIME çok parçalı isteği.

Güncellemenizin başka bir istemcide yapılan değişikliklerin üzerine yazmadığını doğrulamak için orijinal girişin ETag değerini ekleyin. Bu işlemi gerçekleştirebilirsiniz: ETag değerini HTTP If-Match başlığında veya orijinal girişin gd:etag özelliğini güncellenmiş giriş. 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 kullanılabilir.

Girişi, siz aldığınızdan sonra başka birinin güncellemiş olup olmadığına bakmadan güncellemek istiyorsanız, şunu kullanın: If-Match: * ve ETag'i eklemeyin. ETag'ler hakkında daha fazla bilgi için Google Veri API'leri başvuru kılavuzu.

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şini (ENTRY_ID kimliğiyle temsil edilen) aşağıdaki değişikliklerle güncellemeye 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üncellenir
  • Sayfanın URL yolu <sites:pageName> öğesi tarafından değiştirildi
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>

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

Bir ekin içeriğini değiştirme

Aşağıda, bir ekin içeriğini değiştirirken meta verilerini değiştirmeden bırakmaya ilişkin bir örnek verilmiştir. Talep 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 verilerini ve içeriğini güncelleme

Aşağıda, bir ekin meta verilerini ve içeriğini aynı anda güncellemeye ilişkin bir örnek verilmiştir. Ek adı güncellenecek "Yeni Başlık" olarak 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.

ETag'in meta veriler için eklenmesi, medya içeriği için de örtülü bir If-Match sağlar. Bunun nedeni, medya içeriği, meta verinin ETag'inin değişmesine neden olur.

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 Siliniyor

Bir öğeyi Google Sitesinden kaldırmak için önce girişi alın, ardından bir DELETE gönderin isteği girişin edit URL'sine ekleyin. Bu, bir öğenin meta verilerini veya html içeriğini güncellerken kullanılan URL'dir.

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.

Siz aldığınızdan sonra başka bir istemci tarafından değiştirilen bir girişi silmediğinizden emin olmak istiyorsanız bir Orijinal girişin ETag değerini içeren HTTP If-Match üst bilgisi. Orijinal girişin ETag değerini şu şekilde belirleyebilirsiniz: <entry> öğesinin gd:etag özelliği inceleniyor.

Girişi, siz aldığınızdan sonra başka birinin güncellemiş olup olmadığından bağımsız olarak silmek istiyorsanız, If-Match: * ve ETag'i eklemeyin. (Bu durumda, girişi silmeden önce geri almanız gerekmez.)

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

Başa dön



Ekleri İndirme

Bir ek girişi aldıktan sonra, girişin altına kimliği doğrulanmış bir HTTP GET göndererek dosyayı indirebilirsiniz. <content> src bağlantısı. Bir PDF içerik bağlantısı örneği:

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

Başa dön

EKL Feed'i

Paylaşım İzinlerine (EKL'ler) Genel Bakış

EKL feed'indeki her EKL girişi, belirli bir varlığın erişim rolünü temsil eder: Kullanıcı, kullanıcı grubu, alan adı, veya varsayılan erişim (herkese açık site). Girişler yalnızca açık erişime sahip varlıklar için gösterilir; bir giriş gösterilir "Erişimi Olan Kişiler"deki her bir e-posta adresi için Google Sites arayüzünün paylaşım ekranındaki paneli açın. Bu nedenle, alan yöneticileri bir siteye erişimleri vardır.

Roller

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

  • reader: Görüntüleyen (salt okuma erişimine eşdeğerdir).
  • writer — bir ortak çalışan (okuma/yazma erişimine eşdeğerdir).
  • owner — genellikle site yöneticisi (okuma/yazma erişimine eşdeğer)

Kapsamlar

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

  • user — bir e-posta adresi değeri (ör. "user@gmail.com").
  • group — bir Google Grubu e-posta adresi, ör. "grup@alan.com".
  • alanadi: Bir G Suite alan adı (ör. "alanadi.com").
  • davet: Siteye davet edilmiş ancak henüz sitenin EKL'sine eklenmemiş bir kullanıcıdır. (gdata 1.3 veya daha eski bir sürüm belirtildiyse kullanılamaz.)
  • default: "Varsayılan" türünde yalnızca bir olası kapsam vardır ve değer yoktur. (örn.<gAcl:scope type="default">). Bu kapsam, herhangi bir kullanıcının varsayılan olarak sahip olduğu erişimi kontrol eder yayınlayabilirsiniz.

Not: Alanların değeri gAcl:role olamaz. "sahip" olarak ayarla yalnızca okuyucu veya yazar olabilirler.

"Davet" hakkında kapsam.

Henüz Google Hesabı olmayan EKL'ye bir veya daha fazla kullanıcı eklediğinizde API, davet kapsamını döndürür. API, davet edilen kullanıcıların davetiyeyi kabul edebilmesi için onlara sağlamanız gereken yerleşik jeton içeren bir URL döndürür.

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

Not: "Davet" kapsam yalnızca gdata sürüm 1.4 ve sonraki sürümlerde kullanılabilir. 1.3 veya daha altını açıkça belirtirseniz bu yöntem işe yaramaz.

EKL feed'ini alma

EKL feed'i bir sitenin paylaşım izinlerini kontrol etmek için kullanılabilir ve şu 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ınızın alanı (ör. example.com).
siteNameSitenizin web alanı adı; sitenin URL'sinde bulunur (ör. myCoolSite).

Site özet akışındaki her girişin bu özet akışına bir bağlantı içerdiği unutulmamalıdır:

 <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 EKL feed URI'sine GET ve HTTP üzerinden 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 bir 200 OK ve EKL girişlerinin feed'i ile 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

EKL feed'i GET, POST ve PUT isteklerini kabul eder. EKL feed'ine yeni bir rol eklemek için, sitenin EKL feed'ine bir POST isteği göndermeniz yeterlidir.

Not: Belirli paylaşım EKL'leri, yalnızca alan yapılandırılmışsa mümkün olabilir tıklayın.

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

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 sonrasında bir 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>

Kullanıcıları "davet" yoluyla davet etme kapsam

Google hesabı olmayan kullanıcılar eklerseniz API, davet etmek istediğiniz kullanıcılara sağlamanız 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 davetiye, bir 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ı. Gerekli scope değerleri aşağıda listelenmiştir.

Bir grup e-posta adresiyle paylaşma:

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

Alanın tamamıyla paylaşma:

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

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

Paylaşım izinlerini değiştirme

Bir EKL girişini güncellemek için, girişi gerektiği gibi değiştirin ve şuraya bir HTTP PUT isteği gönderin girişin edit bağlantısı, "rel" değeri olan bir <link> öğesi özelliğinin değeri "edit" olarak ayarlanmıştır. Önceki örnek için bu bağlantı şu şekildedir:

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

Tekrar yayın veya giriş alma

Daha önce aldığınız bir feed'i veya girişi almak isterseniz şunu söyleyerek verimliliği artırabilirsiniz: sunucunun listeyi veya girişi, yalnızca son almanızdan sonra değişmişse göndermesini.

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

Site feed'inin kullanıldığı 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. ETag'ler eşleşirse öğe değişmemiştir ve sunucu bir HTTP 304 Not Modified durum kodu veya HTTP 412 Precodition Failed durum kodu. Bunların her ikisi de durum kodları, önceden almış olduğunuz öğenin güncel olduğunu gösterir.

ETag'ler eşleşmezse öğe son istekte bulunduğunuzdan beri değiştirilmiştir ve sunucu öğeyi döndürür.

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

Toplu İşleme

Toplu istekler, istemcinizin her işlemi ayrı ayrı göndermek yerine bir istekte birden çok işlem yürütmesine olanak tanır.

Sunucu, istenen değişikliklerin mümkün olduğunca çoğunu gerçekleştirir ve ve her işlemin başarılı ya da başarısız olduğunu değerlendirir. Google Data API'de toplu işleme hakkında daha fazla bilgi için Google Veri API'leriyle Toplu İşleme adlı makaleyi inceleyin

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

Toplu istek yapmak 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