Protokol Kılavuzu

Klasik Google Sites API, uygulamalarınızın Google Sites içindeki 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, revisionhistory'yi getirebilir ve ekleri ile dosyaları yükleyip indirebilir.

Kitle

Bu belgede, Google Veri API'leri protokolünün temel kavramlarını bildiğiniz varsayılır.

Bu belge, Google Siteler ile etkileşim kurabilen istemci uygulamaları yazmak isteyen programcılar için hazırlanmıştır. Bu dokümanda, ham XML/HTTP kullanılarak yapılan temel Data API etkileşimleriyle ilgili bir dizi örnek ve açıklamalar yer almaktadır. Bu belgeyi okuduktan sonra, sol taraftaki gezinme çubuğunda bulunan diğer kılavuzlardaki 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 istediğinde 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 gönderilen 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 Veri API'si 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ğladığından, istemci kitaplığı kullanırken v=1.4 sorgu parametresini kullanmayın.

Başa dön

Site Feed'i

Site feed'i, kullanıcının sahibi olduğu veya görüntüleme iznine sahip olduğu Google Siteleri'ni listelemek ve mevcut bir sitenin başlığını değiştirmek için kullanılabilir. G Suite alanlarında, sitenin tamamını oluşturmak veya kopyalamak için de 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'te barındırılan alan adınızın alanı (ör. example.com).

Yanıtta, site listesi içeren bir feed yer alır:

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 sıralanır.

Yeni siteler oluşturma

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

Yeni siteler, site feed'ine HTTP POST isteği 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ığı ve özeti) 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şturulurken olduğu gibi kopyalanabilir. Ancak POST isteğinin Atom girişinde, kopyalanacak sitenin site feed'ine işaret eden bir <link> öğesi ekleyin.rel='source' Kopyalanan tüm sitelerde bu bağlantı bulunur. Aşağıda, siteyi kopyalamayla ilgili 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, 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 Siteler ayarları sayfasında "Bu siteyi şablon olarak yayınla" ayarı işaretliyse site şablondur.
  • Kaynak sitede sahibi olarak listeleniyorsanız 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 örnek, önceki sitenin başlığını New Test Site2, açıklamasını ise Newer description olarak günceller.

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 sınıflandı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 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üzenleniyor ve "Ekip Sitesi" kategorisi ekleniyor.

Ek <category> etiketleri ekleyerek birden fazla kategori de ekleyebilirsiniz. Aşağıdaki örnekte kalın çizgileri 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 ekleniyor: "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 ile eşlemesini sağlar. Örneğin, http://sites.google.com/a/domain.com/mysite yerine http://www.mydomainsite.com kullanılabilir. Sitenizin barındırıldığı yere bağlı olarak, bir 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 siteye yönlendiren üç webAddressMapping vardır http://sites.google.com/site/myOtherTestSite.

Web adresi eşlemelerini değiştirme

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

Bir eşleme 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 olmanız veya G Suite'te 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 öğ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 sitenin son etkinliğini (değişikliklerini) getirebilirsiniz. Etkinlik feed'indeki her giriş, 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 isteği gönderin:

https://sites.google.com/feeds/activity/domainName/siteName
Feed parametresiAçıklama
domainName"site" veya G Suite'te barındırılan alan adı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 sahibi veya ortak çalışanı 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 getirmek için girişin düzeltme bağlantısına bir HTTP GET isteği gönderin:

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

Belirli bir sayfa/yorum/ek/liste öğesi için düzeltmeler bağlantısını bulmak üzere öncelikle CONTENT_ENTRY_ID'sini kullanarak içerik feed'inden girişi alın. Alınan giriş, düzeltme feed'ine yönelik 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 sahibi veya ortak çalışanı olmanız gerekir. Müşteriniz doğru Authorization üstbilgisini göndermeli ve İstekleri yetkilendirme bölümünde alınan jetona referans vermelidir.

Başa dön

İçerik feed'i

İçeriği alma

İçerik feed'inde bir sitenin mevcut içeriği listelenir. 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'te barındırılan alan adınızın alanı (ö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ş farklı bir içerik girişini temsil eder. Örneğin, webpage, filecabinet, attachment, comment vb. <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ılavuzuna bakın.

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 üstbilgisini (yukarıdaki örnekte gösterildiği gibi) göndermeli 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: Bu, yalnızca ilk birkaç sonuçtur. İçerik feed'inin tamamını incelemek için feed'in "sonraki" bağlantısını izleyin:

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

Atom'un ortak öğeleriyle ilgili açıklama için Google Data Protocol referansı başlıklı makaleyi inceleyin. Klasik Sites API'si için belirli bir anlamı olan öğeler aşağıda açıklanmıştır. Bazı tür girişlerinde ek özellikler (aşağıda listelenmemiştir) bulunurken bazılarında bulunmaz. Ö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şler (ör. ekler) için 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österiyor.
<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 yönlendirir.
<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 gösterir.
<gd:feedLink>href özelliği, girişin üst öğesinin alt öğelerini gösterir.
<sites:pageName>Sayfanın web alanı adı; sayfanın URL'sindeki adla eşleşir.
<sites:revision>Mevcut düzeltme numarası.

İçerik feed'i sorgu örnekleri

Standart Google Data API sorgu parametrelerinin ve klasik Sites API'ye özgü olanların bir kısmını 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 öğesini "," 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 Verileri /-/category sorgusu için standart biçimi kullanabilirsiniz:

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

Sayfa şablonlarını alma

Bu örnek yalnızca template sayfayı 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

Bir sayfayı yola göre alma

Google Sites'taki bir sayfanın göreli yolunu biliyorsanız bu 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

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

Bir sayfanın giriş kimliğini biliyorsanız parent parametresini kullanarak tüm alt girişlerini (varsa) getirebilirsiniz:

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

Taslaklar veya silinmiş 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 almaktadı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>

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şturuluyor ancak <sites:pageName> öğesi belirtilerek sayfa http://sites.google.com/domainName/siteName/files URL'si altında oluşturuluyor.

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ırırken aşağıdaki öncelik kurallarını kullanır:

  1. Varsa <sites:pageName>. a-z, A-Z, 0-9, -, _ koşulunu karşılamalıdır.
  2. <atom:title>, pageName mevcut değilse boş olmamalıdır. Normalleştirme, boşlukları kırpıp "-" ile 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 sayfalar oluşturma

Bir üst sayfanın altında alt sayfalar (çocuklar) 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 kendi bağlantısı olarak ayarlayın.

Bu örnekte, giriş kimliği PARENT_ENTRY_ID olan bir üst duyuru sayfası 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 süreci, yeni öğeler/sayfalar oluşturma ve alt sayfalar oluşturma ile aynıdır.Aradaki fark, terim ve etiket kümesi sırasıyla "http://schemas.google.com/g/2005#template" ve "template" olarak ayarlanmış 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' ile bir <link> ekleyerek şablondan yeni bir sayfa örneklendirebilirsiniz.

Bu örnekte, bir dosya dolabını tanımlayan mevcut bir sayfa şablonundan yeni bir filecabinet sayfası 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#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 <category> tanımlasa da girişinize bir tane eklemeniz gerekir. Ayrıca, <content> öğesi eklerseniz sunucunun bunu reddedeceğini unutmayın.

Dosya yükleme

Google Siteler'de olduğu gibi, API sayesinde dosya dolabı sayfalarına ve üst sayfalara ek yükleyebilirsiniz.

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 eklerin meta verilerini içeren bir <atom:entry> ile birleştirmek için MIME çok parçalı bir istek olmalıdır. <atom:entry>, eklerin nerede oluşturulacağını belirtmek için üst girişin kendi bağlantısına referans vermelidir. Daha fazla bilgi için Alt sayfalar 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 "İK paketi" açıklamasıyla (isteğe bağlı) 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 ile birlikte 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 "terim" ö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, web'deki diğer dosyalara yönelik bağlantılardır ve dosya dolabı listelerinize ekleyebilirsiniz. Bu özellik, Google Sites kullanıcı arayüzündeki "URL ile dosya ekle" yükleme yöntemine benzer.

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

Bu örnek, FILECABINET_ENTRY_ID kimliğiyle referans verilen dosya dolabının altında webattachment oluşturur. Başlığı ve (isteğe bağlı) açıklaması sırasıyla "GoogleLogo" ve "nice colors" olarak ayarlanı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



İçeriği Güncelleme

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

Güncellemenizin başka bir istemcinin değişikliklerinin üzerine yazılmadığını onaylamak için orijinal girişin ETag değerini ekleyin. Bunu, ETag değerini bir HTTP If-Match üst bilgisinde sağlayarak veya orijinal girişin gd:etag özelliğini güncellenen girişe ekleyerek yapabilirsiniz. Orijinal girişin ETag değerini belirlemek için <entry> öğesinin gd:etag özelliğini inceleyin. Medya girişlerinde, medyanın ETag'i edit-media bağlantısının gd:etag özelliğinde bulunabilir.

Girişi, siz aldığınızdan beri başka biri tarafından güncellenip güncellenmediğ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 başvuru 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 isteği gönderin.

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

  • Başlık "Güncellenmiş İçerik" olarak değiştirilir.
  • Güncellenen HTML içeriği
  • Listenin ilk sütun başlığı "Sahip" olarak güncellenir.
  • Sayfanın URL yolu, <sites:pageName> öğesiyle 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üğü şekliyle) yukarıdaki örnekten daha fazla öğe içerir.

Ekin içeriğini değiştirme

Aşağıda, bir ekteki içeriğin değiştirilip meta verilerinin değiştirilmediği bir örnek verilmiştir. İstek yeni içerik barındırdığı için 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, hem bir ek meta verisinin hem de içeriğinin aynı anda güncellenmesine dair bir örnek verilmiştir. Eklerin adı "Yeni Başlık" olarak güncellenir ve içeriği .zip dosyasının içeriğiyle değiştirilir. İstek yeni dosya içeriği içerdiğinden, ek girişinin edit-media bağlantısı kullanılır.

Meta verilerin ETag'inin eklenmesinin, medya içeriği için de dolaylı bir If-Match sağladığını unutmayın. Bunun nedeni, medya içeriğinde yapılan herhangi bir 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



İçeriği Silme

Bir öğeyi Google Sites'tan kaldırmak için önce girişi alın, ardından DELETEgirişin edit URL'sine istek gönderin. Bu, bir öğenin meta verileri veya HTML içeriği güncellenirken 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ındıktan 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. Orijinal girişin ETag değerini, <entry> öğesinin gd:etag özelliğini inceleyerek belirleyebilirsiniz.

Girişi, siz aldığınızdan beri başka bir kullanıcı tarafından güncellenip güncellenmediğine bakılmaksızın silmek istiyorsanız If-Match: * kullanın ve ETag'i eklemeyin. (Bu durumda, girişi silmeden önce 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 oluşturduktan sonra, girişteki GET src bağlantısına kimliği doğrulanmış bir HTTP <content> göndererek dosyayı indirebilirsiniz. PDF'nin 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ış

Erişim kontrol listesi feed'indeki her erişim kontrol listesi girişi, belirli bir varlığın (kullanıcı, kullanıcı grubu, alan veya varsayılan erişim (genel site)) erişim rolünü temsil eder. Girişler yalnızca açık erişime sahip öğeler için gösterilir. Google Siteler 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 örtülü erişimleri olsa bile alan yöneticileri gösterilmez.

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üleyici (salt okuma erişimine eşdeğerdir).
  • writer: Ortak çalışan (okuma/yazma erişimine eşdeğerdir).
  • owner: Genellikle site yöneticisidir (okuma/yazma erişimine eşdeğerdir).

Kapsamlar

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

  • user: "user@gmail.com" gibi bir e-posta adresi değeri.
  • group: Google Grubu e-posta adresi (ör. "group@domain.com").
  • domain: G Suite alan adı (ör. "domain.com")
  • invite: Siteye davet edilmiş ancak henüz sitenin erişim kontrol listesine 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: Alanların gAcl:role değeri "sahip" erişimi olarak ayarlanamaz. Alanlar yalnızca okuyucu veya yazar olabilir.

"Davet" kapsamı hakkında

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

Bu davet yöntemi, Google dışı kullanıcıları hangi e-posta adresini kullanmak istediklerini önceden bilmeden davet etmenize olanak tanır. Kullanıcılar, yerleştirilmiş jeton içeren davet URL'sini tıkladıkları sürece istedikleri e-posta adresini kullanarak erişim için kaydolabilir. Ayrıca, birden fazla kullanıcı davetiye kabul etmek için bu URL'yi kullanabilir. Bu nedenle, tek bir kullanıcıyı veya bir grup kullanıcıyı davet ediyorsanız bu URL'yi kullanabilirsiniz.

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

EKL feed'ini alma

EKL 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'te barındırılan alan adınızın alanı (ö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 belirtmek isteriz:

 <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 URI'sine bir HTTP GET isteği 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'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 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ında alan dışında paylaşım etkinleştirilmişse 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>

Kullanıcıları "invite" kapsamı üzerinden davet etme

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 davet işlemi 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 Google Grubu veya G Suite alanı genelinde 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"/>

Alan genelinde paylaşım:

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

Alan düzeyinde paylaşım yalnızca G Suite alanları ve yalnızca sitenin barındırıldığı alan için desteklenir. Örneğin, http://sites.google.com/a/domain1.com/siteA yalnızca domain1.com ile paylaşılabilir, domain2.com ile paylaşılamaz. G Suite alanında barındırılmayan siteler (ör. http://sites.google.com/site/siteB) alan 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ış basit 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 adlı kullanıcı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 izinlerini kaldırma

Bu kullanıcının izinlerini kaldırmak için DELETE isteğini, PUT isteği için kullanılan edit bağlantısına 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 tekrar almak istiyorsanız sunucuya listeyi ya da girişi yalnızca son aldığınız zamandan bu yana değiştiyse göndermesini söyleyerek verimliliği artırabilirsiniz.

Bu tür bir koşullu alma işlemi yapmak için HTTP GET isteği gönderin. Bu istekte bir HTTP If-None-Match başlığı bulunmalıdır. Başlıkta, listenin veya girişin ETag'ini belirtin. Bu değeri <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 isteğinizden bu yana değiştirilmiş demektir 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, müşterinize her işlemi ayrı ayrı göndermek yerine tek bir istekte birden fazla işlem yürütme olanağı tanır.

Sunucu, istenen değişikliklerin mümkün olduğunca çoğunu 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 İşleme başlıklı makaleyi inceleyin.

Toplu feed'deki her işlemin, ekleme işlemleri hariç olmak üzere bir <id> öğesi vardır. Bu öğe, içerik feed'ini güncellerken, silerken veya sorgularken normalde kullandığınız istek URL'siyle aynıdır. Örneğin, bir düzenlemeyi güncelliyorsanız <id> öğesini söz konusu girişin edit bağlantısı olarak ayarlayın. Hedef girişi tanımlamak için kullanılır. Yeni girişler henüz oluşturulmadıkları için <id> öğelerini 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 istekte bulunmak için 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