Google Sites के क्लासिक वर्शन का एपीआई, आपके ऐप्लिकेशन को Google Sites में मौजूद कॉन्टेंट को ऐक्सेस करने, पब्लिश करने, और उसमें बदलाव करने की अनुमति देता है. इसके अलावा, आपका ऐप्लिकेशन हाल ही की गतिविधि की सूची का अनुरोध कर सकता है, बदलाव का इतिहास फ़ेच कर सकता है, और अटैचमेंट और फ़ाइलें अपलोड/डाउनलोड कर सकता है.
ऑडियंस
इस दस्तावेज़ में यह माना गया है कि आपको Google डेटा एपीआई प्रोटोकॉल के बारे में सामान्य जानकारी है.
यह दस्तावेज़ उन प्रोग्रामर के लिए है जो ऐसे क्लाइंट ऐप्लिकेशन बनाना चाहते हैं जो Google Sites के साथ इंटरैक्ट कर सकें. इसमें रॉ एक्सएमएल/एचटीटीपी का इस्तेमाल करके, डेटा एपीआई के बुनियादी इंटरैक्शन के कई उदाहरण दिए गए हैं. साथ ही, उनके बारे में जानकारी भी दी गई है. इस दस्तावेज़ को पढ़ने के बाद, हमारी क्लाइंट लाइब्रेरी का इस्तेमाल करके, एपीआई के साथ इंटरैक्ट करने के बारे में ज़्यादा जानें. इसके लिए, बाईं ओर मौजूद नेविगेशन बार में मौजूद अन्य गाइड में, भाषा के हिसाब से दिए गए उदाहरण पढ़ें.
इस गाइड में मौजूद कॉन्टेंट के रेफ़रंस के लिए, रेफ़रंस गाइड देखें.
अनुरोधों को अनुमति देना
जब आपका ऐप्लिकेशन, उपयोगकर्ता के निजी डेटा को ऐक्सेस करने का अनुरोध करता है, तब उसमें अनुमति वाला टोकन होना ज़रूरी है. इस टोकन से Google आपके ऐप्लिकेशन की पहचान भी करता है.
अनुमति देने के प्रोटोकॉल के बारे में जानकारी
अनुरोधों को अनुमति देने के लिए, आपके ऐप्लिकेशन में OAuth 2.0 का इस्तेमाल किया जाना चाहिए. अनुमति देने वाले दूसरे प्रोटोकॉल इस्तेमाल नहीं किए जा सकते. अगर आपका ऐप्लिकेशन Google से साइन इन करने की सुविधा इस्तेमाल करता है, तो अनुमति देने से जुड़े कुछ पहलुओं को Google आपके लिए खुद मैनेज करता है.
OAuth 2.0 से अनुरोधों को अनुमति देना
Google Sites Data API को भेजे गए, उपयोगकर्ता के निजी डेटा के अनुरोधों के लिए अनुमति किसी ऐसे उपयोगकर्ता को देनी चाहिए जिसके पास ऐसा करने का अधिकार हो.
OAuth 2.0 के लिए अनुमति देने की प्रक्रिया या "तरीका" अलग-अलग हो सकता है. यह इस बात पर निर्भर करता है कि ऐप्लिकेशन किस तरह का है. सभी तरह के ऐप्लिकेशन के लिए नीचे दी गई सामान्य प्रक्रिया लागू होती है:
- ऐप्लिकेशन बनाने के बाद, उसे Google API Console का इस्तेमाल करके, रजिस्टर किया जाता है. इसके बाद, Google आपको क्लाइंट आईडी और क्लाइंट सीक्रेट जैसी जानकारी देगा.
- Google API Console में Google Sites Data API को चालू करें. (अगर एपीआई को 'API Console' की सूची में नहीं जोड़ा गया है, तो यह चरण छोड़ दें.)
- जब आपके ऐप्लिकेशन को उपयोगकर्ता के डेटा को ऐक्सेस करने की ज़रूरत होती है, तब वह Google से, डेटा के खास लिंक का अनुरोध करता है.
- Google, उपयोगकर्ता को सहमति वाली स्क्रीन दिखाता है, जिसमें उनसे आपके ऐप्लिकेशन को उनके कुछ डेटा को ऐक्सेस करने की अनुमति मांगी जाती है.
- अगर उपयोगकर्ता इसकी अनुमति दे देता है, तो Google आपके ऐप्लिकेशन को कुछ समय के लिए इस्तेमाल किए जा सकने वाला ऐक्सेस टोकन देता है.
- आपका ऐप्लिकेशन, ऐक्सेस टोकन से उपयोगकर्ता के डेटा को ऐक्सेस करने का अनुरोध करता है.
- अगर Google को पता चलता है कि आपका अनुरोध और टोकन मान्य है, तो वह आपके ऐप्लिकेशन को अनुरोध किए गए डेटा का ऐक्सेस दे देता है.
कुछ तरीकों में दूसरे चरण भी शामिल हो सकते हैं, जैसे कि रिफ़्रेश टोकन इस्तेमाल करके, नया ऐक्सेस टोकन पाना. अलग-अलग तरह के ऐप्लिकेशन के लिए डेटा ऐक्सेस करने के तरीकों के बारे में ज़्यादा जानकारी पाने के लिए, Google का OAuth 2.0 दस्तावेज़ पढ़ें.
यहां Google Sites Data API के लिए, OAuth 2.0 का इस्तेमाल करके अनुमति के लिए अनुरोध करने के बारे में जानकारी दी गई है:
https://sites.google.com/feeds/
OAuth 2.0 का इस्तेमाल करके, डेटा ऐक्सेस करने का अनुरोध करने के लिए, आपके ऐप्लिकेशन को अनुरोध के तरीके की जानकारी देनी होगी. साथ ही, वह जानकारी भी देनी होगी जो आपको ऐप्लिकेशन रजिस्टर करते समय, Google से मिली थी, जैसे कि क्लाइंट आईडी और क्लाइंट सीक्रेट.
वर्शन की जानकारी देना
Google Sites Data API को भेजे जाने वाले हर अनुरोध में, 1.4 वर्शन की जानकारी होनी चाहिए. वर्शन नंबर तय करने के लिए, GData-Version एचटीटीपी हेडर का इस्तेमाल करें:
GData-Version: 1.4
इसके अलावा, अगर एचटीटीपी हेडर सेट नहीं किए जा सकते, तो यूआरएल में क्वेरी पैरामीटर के तौर पर v=1.4 को सेट किया जा सकता है. हालांकि, जहां भी हो सके वहां एचटीटीपी हेडर को प्राथमिकता दी जाती है.
ध्यान दें: क्लाइंट लाइब्रेरी, सही वर्शन के हेडर अपने-आप उपलब्ध कराती हैं. इसलिए, क्लाइंट लाइब्रेरी का इस्तेमाल करते समय, v=1.4 क्वेरी पैरामीटर का इस्तेमाल न करें.
साइट फ़ीड
साइट फ़ीड का इस्तेमाल, उन Google Sites की सूची बनाने के लिए किया जा सकता है जिनका मालिकाना हक किसी उपयोगकर्ता के पास है या जिन्हें देखने की अनुमतियां उसके पास हैं. साथ ही, इसका इस्तेमाल किसी मौजूदा साइट के टाइटल में बदलाव करने के लिए भी किया जा सकता है. G Suite डोमेन के लिए, इसका इस्तेमाल पूरी साइट बनाने या कॉपी करने के लिए भी किया जा सकता है.
लिस्टिंग साइटें
किसी उपयोगकर्ता के पास जिन साइटों का ऐक्सेस है उनकी सूची देखने के लिए, इस यूआरएल पर पुष्टि किया गया GET अनुरोध भेजें:
https://sites.google.com/feeds/site/domainName| फ़ीड पैरामीटर | ब्यौरा |
|---|---|
domainName | 'site' या G Suite पर होस्ट किए गए आपके डोमेन का डोमेन (उदाहरण के लिए, example.com). |
जवाब में, साइटों की सूची वाला एक फ़ीड शामिल होगा:
GET /feeds/site/domainName HTTP/1.1 Host: sites.google.com GData-Version: 1.4 Authorization: <your authorization header here> HTTP/1.1 200 OK <feed xmlns="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:gAcl="http://schemas.google.com/acl/2007" xmlns:sites="http://schemas.google.com/sites/2008" xmlns:gs="http://schemas.google.com/spreadsheets/2006" xmlns:dc="http://purl.org/dc/terms" xmlns:batch="http://schemas.google.com/gdata/batch" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0"> <id>https://sites.google.com/feeds/site/site</id> <updated>2009-12-02T17:47:34.406Z</updated> <title>Site</title> <link rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml" href="https://sites.google.com/feeds/site/site"/> <link rel="http://schemas.google.com/g/2005#post" type="application/atom+xml" href="https://sites.google.com/feeds/feeds/site/domainName"/> <link rel="self" type="application/atom+xml" href="https://sites.google.com/feeds/site/domainName"/> <link rel="next" type="application/atom+xml" href="https://sites.google.com/feeds/site/domainName/?start-index=2"/> <generator version="1" uri="http://sites.google.com/">Google Sites</generator> <openSearch:startIndex>1</openSearch:startIndex> <entry gd:etag="W/"CkUAQH4_eil7I2A9WxNaFk4.""> <id>https://sites.google.com/feeds/site/site/myTestSite</id> <updated>2009-12-01T01:17:21.042Z</updated> <app:edited xmlns:app="http://www.w3.org/2007/app">2009-12-01T01:17:21.042Z</app:edited> <title>myTestSite</title> <summary/> <link rel="alternate" type="text/html" href="http://sites.google.com/site/myTestSite/"/> <link rel="http://schemas.google.com/acl/2007#accessControlList" type="application/atom+xml" href="https://sites.google.com/feeds/acl/site/domainName/myTestSite"/> <link rel="self" type="application/atom+xml" href="https://sites.google.com/feeds/site/domainName/myTestSite"/> <link rel="edit" type="application/atom+xml" href="https://sites.google.com/feeds/site/domainName/myTestSite"/> <sites:siteName>myTestSite</sites:siteName> <sites:theme>default</sites:theme> </entry> <entry gd:etag="W/"DkQGQHczfA9WxNaFk4.""> <id>https://sites.google.com/feeds/site/domainName/myOtherTestSite</id> <updated>2009-12-01T02:25:21.987Z</updated> <app:edited xmlns:app="http://www.w3.org/2007/app">2009-12-01T02:25:21.987Z</app:edited> <title>myOtherTestSite</title> <summary>A new site to hold memories</summary> <category scheme="http://schemas.google.com/sites/2008#tag" term="Memories Site"/> <link rel="alternate" type="text/html" href="http://sites.google.com/site/myOtherTestSite"/> <link rel="http://schemas.google.com/acl/2007#accessControlList" type="application/atom+xml" href="https://sites.google.com/feeds/acl/site/domainName/myOtherTestSite"/> <link rel="self" type="application/atom+xml" href="https://sites.google.com/feeds/site/domainName/myOtherTestSite"/> <link rel="edit" type="application/atom+xml" href="https://sites.google.com/feeds/site/domainName/myOtherTestSite"/> <sites:siteName>myOtherTestSite</sites:siteName> <sites:theme>iceberg</sites:theme> </entry> ... </feed>
साइटें, वर्णमाला के क्रम में दिखती हैं.
नई साइटें बनाना
ध्यान दें: यह सुविधा सिर्फ़ G Suite डोमेन के लिए उपलब्ध है.
साइट फ़ीड में एचटीटीपी POST करके, नई साइटें बनाई जा सकती हैं. उदाहरण के लिए:
POST /feeds/site/example.com HTTP/1.1 Host: sites.google.com GData-Version: 1.4 Authorization: <your authorization header here> <entry xmlns="http://www.w3.org/2005/Atom" xmlns:sites="http://schemas.google.com/sites/2008"> <title>Source Site</title> <summary>A new site to hold memories</summary> <sites:theme>slate</sites:theme> </entry>
ऊपर दिए गए अनुरोध से, G Suite डोमेन example.com में 'slate' थीम वाली एक नई Google साइट बन जाएगी.
साइट का यूआरएल http://sites.google.com/a/example.com/source-site/ होगा.
अगर साइट बन जाती है, तो सर्वर 201 Created के साथ जवाब देगा.
जवाब में सर्वर से जोड़े गए एलिमेंट शामिल होंगे. जैसे, साइट का लिंक, साइट के एसीएल फ़ीड का लिंक, साइट का नाम, टाइटल, और खास जानकारी.
<entry xmlns="http://www.w3.org/2005/Atom" xmlns:gAcl="http://schemas.google.com/acl/2007"
xmlns:sites="http://schemas.google.com/sites/2008" xmlns:gs="http://schemas.google.com/spreadsheets/2006"
xmlns:dc="http://purl.org/dc/terms" xmlns:batch="http://schemas.google.com/gdata/batch"
xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0"
gd:etag="W/"DEECR38l7I2A9WxNaF0Q."">
<id>https://sites.google.com/feeds/site/example.com/source-site</id>
<updated>2009-12-02T23:31:06.184Z</updated>
<app:edited xmlns:app="http://www.w3.org/2007/app">2009-12-02T23:31:06.184Z</app:edited>
<title>New Test Site</title>
<summary>A new site to hold memories</summary>
<link rel="alternate" type="text/html" href="http://sites.google.com/a/example.com/source-site/"/>
<link rel="http://schemas.google.com/acl/2007#accessControlList" type="application/atom+xml"
href="https://sites.google.com/feeds/acl/site/example.com/source-site"/>
<link rel="self" type="application/atom+xml" href="https://sites.google.com/feeds/site/example.com/source-site"/>
<link rel="edit" type="application/atom+xml" href="https://sites.google.com/feeds/site/example.com/source-site"/>
<sites:siteName>source-site</sites:siteName>
<sites:theme>slate</sites:theme>
</entry>
किसी साइट को कॉपी करना
ध्यान दें: यह सुविधा सिर्फ़ G Suite डोमेन के लिए उपलब्ध है.
किसी मौजूदा साइट का डुप्लीकेट वर्शन बनाया जा सकता है. इसके लिए, नई साइट बनाने का तरीका अपनाएं. हालांकि, POST अनुरोध की Atom एंट्री में, <link> को rel='source' के साथ शामिल करें. यह उस साइट के साइट फ़ीड पर ले जाएगा जिसे कॉपी करना है. कॉपी की गई हर साइट में यह लिंक होगा. यहां किसी साइट की डुप्लीकेट कॉपी बनाने का उदाहरण दिया गया है:
POST /feeds/site/example.com HTTP/1.1 Host: sites.google.com GData-Version: 1.4 Authorization: <your authorization header here> <entry xmlns="http://www.w3.org/2005/Atom"> <link rel="http://schemas.google.com/sites/2008#source" type="application/atom+xml" href="https://sites.google.com/feeds/site/example.com/source-site"/> <title>Copy of New Test Site</title> <summary>A newer site to hold memories</summary> </entry>
ऊपर दिया गया अनुरोध, http://sites.google.com/a/example.com/source-site/ पर मौजूद साइट को कॉपी कर देगा.
अहम जानकारी:
- सिर्फ़ उन साइटों और साइट टेंप्लेट को कॉपी किया जा सकता है जिनका मालिकाना हक, पुष्टि किए गए उपयोगकर्ता के पास है.
- साइट के टेंप्लेट को भी कॉपी किया जा सकता है. अगर Google Sites के सेटिंग पेज पर, "इस साइट को टेंप्लेट के तौर पर पब्लिश करें" सेटिंग को चुना गया है, तो वह साइट एक टेंप्लेट है.
- किसी दूसरे डोमेन से साइट को कॉपी किया जा सकता है. हालांकि, इसके लिए ज़रूरी है कि आपको सोर्स साइट के मालिक के तौर पर लिस्ट किया गया हो.
किसी साइट का मेटाडेटा अपडेट करना
किसी साइट के टाइटल या खास जानकारी को अपडेट करने के लिए, साइट एंट्री के edit लिंक पर एचटीटीपी PUT भेजें.
उदाहरण के लिए, नीचे दिए गए उदाहरण से पिछली साइट का टाइटल New Test Site2 और उसकी जानकारी Newer description पर अपडेट हो जाएगी.
PUT /feeds/site/example.com/source-site HTTP/1.1 Host: sites.google.com GData-Version: 1.4 Authorization: <your authorization header here> <entry xmlns="http://www.w3.org/2005/Atom" xmlns:gAcl="http://schemas.google.com/acl/2007" xmlns:sites="http://schemas.google.com/sites/2008" xmlns:gs="http://schemas.google.com/spreadsheets/2006" xmlns:dc="http://purl.org/dc/terms" xmlns:batch="http://schemas.google.com/gdata/batch" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" gd:etag="W/"DEECR38l7I2A9WxNaF0Q.""> <id>https://sites.google.com/feeds/site/example.com/source-site</id> <updated>2009-12-02T23:31:06.184Z</updated> <app:edited xmlns:app="http://www.w3.org/2007/app">2009-12-02T23:31:06.184Z</app:edited> <title>New Test Site2</title> <summary>Newer description</summary> <category scheme="http://schemas.google.com/sites/2008#tag" term="Category"/> <link rel="alternate" type="text/html" href="http://sites.google.com/a/example.com/source-site/"/> <link rel="http://schemas.google.com/acl/2007#accessControlList" type="application/atom+xml" href="https://sites.google.com/feeds/acl/site/example.com/source-site"/> <link rel="self" type="application/atom+xml" href="https://sites.google.com/feeds/site/example.com/source-site"/> <link rel="edit" type="application/atom+xml" href="https://sites.google.com/feeds/site/example.com/source-site"/> <sites:siteName>source-site</sites:siteName> </entry>
कैटगरी जोड़ना
ध्यान दें: यह सुविधा सिर्फ़ G Suite डोमेन के लिए उपलब्ध है.
G Suite for your Domain की साइटों में कैटगरी का मेटा डेटा शामिल होता है. यह आपके डोमेन में मौजूद साइटों को कैटगरी में बांटने के लिए काम आता है. कैटगरी का मेटा डेटा जोड़ने या अपडेट करने के लिए, अपनी साइट की एंट्री के edit लिंक पर एचटीटीपी PUT भेजें. इसमें category टैग शामिल होना चाहिए. नीचे दिए गए उदाहरण में बोल्ड लाइन देखें:
PUT /feeds/site/example.com/source-site HTTP/1.1 Host: sites.google.com GData-Version: 1.4 Authorization: <your authorization header here> <entry xmlns="http://www.w3.org/2005/Atom" xmlns:gAcl="http://schemas.google.com/acl/2007" xmlns:sites="http://schemas.google.com/sites/2008" xmlns:gs="http://schemas.google.com/spreadsheets/2006" xmlns:dc="http://purl.org/dc/terms" xmlns:batch="http://schemas.google.com/gdata/batch" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" gd:etag="W/"DEECR38l7I2A9WxNaF0Q.""> <id>https://sites.google.com/feeds/site/example.com/source-site</id> <updated>2009-12-02T23:31:06.184Z</updated> <app:edited xmlns:app="http://www.w3.org/2007/app">2009-12-02T23:31:06.184Z</app:edited> <title>My Team website</title> <summary>This site contains contact information and a summary of major efforts our team owns</summary> <category scheme="http://schemas.google.com/sites/2008#tag" term="Team Site"/> <link rel="alternate" type="text/html" href="http://sites.google.com/a/example.com/my-team-site/"/> <link rel="http://schemas.google.com/acl/2007#accessControlList" type="application/atom+xml" href="https://sites.google.com/feeds/acl/site/example.com/my-team-site"/> <link rel="self" type="application/atom+xml" href="https://sites.google.com/feeds/site/example.com/my-team-site"/> <link rel="edit" type="application/atom+xml" href="https://sites.google.com/feeds/site/example.com/my-team-site"/> <sites:siteName>my-team-site</sites:siteName> </entry>
इस उदाहरण में, किसी मौजूदा साइट में बदलाव किया गया है और "टीम साइट" कैटगरी जोड़ी गई है.
इसके अलावा, अतिरिक्त <category> टैग जोड़कर कई कैटगरी भी जोड़ी जा सकती हैं. नीचे दिए गए उदाहरण में बोल्ड की गई लाइनें देखें:
PUT /feeds/site/example.com/my-team-site HTTP/1.1 Host: sites.google.com GData-Version: 1.4 Authorization: <your authorization header here> <entry xmlns="http://www.w3.org/2005/Atom" xmlns:gAcl="http://schemas.google.com/acl/2007" xmlns:sites="http://schemas.google.com/sites/2008" xmlns:gs="http://schemas.google.com/spreadsheets/2006" xmlns:dc="http://purl.org/dc/terms" xmlns:batch="http://schemas.google.com/gdata/batch" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" gd:etag="W/"DEECR38l7I2A9WxNaF0Q.""> <id>https://sites.google.com/feeds/site/example.com/my-team-site</id> <updated>2009-12-02T23:31:06.184Z</updated> <app:edited xmlns:app="http://www.w3.org/2007/app">2009-12-02T23:31:06.184Z</app:edited> <title>My Team website</title> <summary>This site contains contact information and a summary of major efforts our team owns</summary> <category scheme="http://schemas.google.com/sites/2008#tag" term="Team Site/"> <category scheme="http://schemas.google.com/sites/2008#tag" term="Legal Department/"> <link rel="alternate" type="text/html" href="http://sites.google.com/a/example.com/my-team-site/"/> <link rel="http://schemas.google.com/acl/2007#accessControlList" type="application/atom+xml" href="https://sites.google.com/feeds/acl/site/example.com/my-team-site"/> <link rel="self" type="application/atom+xml" href="https://sites.google.com/feeds/site/example.com/my-team-site"/> <link rel="edit" type="application/atom+xml" href="https://sites.google.com/feeds/site/example.com/my-team-site"/> <sites:siteName>my-team-site</sites:siteName> </entry>
इस उदाहरण में, दो कैटगरी जोड़ी गई हैं: "टीम साइट" और "कानूनी विभाग"
वेब पता मैपिंग
वेब पता मैपिंग की मदद से, Sites के उपयोगकर्ता अपने डोमेन को Google साइट पर मैप कर सकते हैं. उदाहरण के लिए, http://sites.google.com/a/domain.com/mysite के बजाय http://www.mydomainsite.com का इस्तेमाल किया जा सकता है. आपकी साइट को कहां होस्ट किया गया है, इसके आधार पर साइट के वेब पते की मैपिंग में मैन्युअल तरीके से बदलाव किया जा सकता है. ज़्यादा जानकारी के लिए, हमारे सहायता केंद्र में मौजूद लेख देखें.
किसी साइट के वेब पते की मैपिंग फ़ेच करना
किसी साइट के लिए वेब पता मैपिंग वापस करने के लिए, with-mappings=true पैरामीटर के साथ साइट एंट्री/फ़ीड फ़ेच करें:
GET /feeds/site/domainName?with-mappings=true HTTP/1.1 Host: sites.google.com GData-Version: 1.4 Authorization: <your authorization header here> HTTP/1.1 200 OK <feed xmlns="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:gAcl="http://schemas.google.com/acl/2007" xmlns:sites="http://schemas.google.com/sites/2008" xmlns:gs="http://schemas.google.com/spreadsheets/2006" xmlns:dc="http://purl.org/dc/terms" xmlns:batch="http://schemas.google.com/gdata/batch" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0"> ... <entry gd:etag="W/"DkQGQHczfA9WxNaFk4.""> <id>https://sites.google.com/feeds/site/domainName/myOtherTestSite</id> <updated>2009-12-01T02:25:21.987Z</updated> <app:edited xmlns:app="http://www.w3.org/2007/app">2009-12-01T02:25:21.987Z</app:edited> <title>myOtherTestSite</title> <summary>A new site to hold memories</summary> <link rel="alternate" type="text/html" href="http://sites.google.com/site/myOtherTestSite"/> <link rel="http://schemas.google.com/acl/2007#accessControlList" type="application/atom+xml" href="https://sites.google.com/feeds/acl/site/domainName/myOtherTestSite"/> <link rel="self" type="application/atom+xml" href="https://sites.google.com/feeds/site/domainName/myOtherTestSite"/> <link rel="edit" type="application/atom+xml" href="https://sites.google.com/feeds/site/domainName/myOtherTestSite"/> <link rel='webAddressMapping' href='http://www.mysitemapping.com'> <link rel='webAddressMapping' href='http://www.mysitemapping2.com'> <link rel='webAddressMapping' href='http://www.myothermapping.org'> </entry> ... </feed>
मौजूदा मैपिंग, rel='webAddressMapping' के साथ link के तौर पर दिखेंगी. उदाहरण के लिए, ऊपर दिए गए उदाहरण में तीन webAddressMapping हैं, जो http://sites.google.com/site/myOtherTestSite साइट पर ले जाते हैं.
वेब पता मैपिंग में बदलाव करना
ध्यान दें: वेब पता मैपिंग के साथ काम करते समय, सभी GET/POST/PUT कार्रवाइयों में with-mappings=true पैरामीटर की जानकारी देना ज़रूरी है. अगर पैरामीटर मौजूद नहीं है, तो साइट एंट्री (GET) में webAddressMapping नहीं दिखाया जाएगा. इसके अलावा, किसी एंट्री से मैपिंग को अपडेट करने/हटाने (PUT) के दौरान भी इसे ध्यान में नहीं रखा जाएगा.
मैपिंग जोड़ने, अपडेट करने या मिटाने के लिए, नई साइटें बनाते समय या किसी साइट का मेटाडेटा अपडेट करते समय, लिंक की जानकारी दें, उसे बदलें या हटाएं. with-mappings=true पैरामीटर को साइट फ़ीड यूआरआई में शामिल करना ज़रूरी है.
ध्यान दें: पते की मैपिंग अपडेट करने के लिए, आपको साइट एडमिन होना चाहिए. अगर साइट को G Suite होस्ट करता है, तो आपको डोमेन एडमिन होना चाहिए.
उदाहरण के लिए, यहां दिए गए अनुरोध से http://www.mysitemapping.com की मैपिंग को http://www.my-new-sitemapping.com पर अपडेट किया जाता है. साथ ही, एंट्री से लिंक को हटाकर http://www.mysitemapping2.com को हटाया जाता है:
PUT /feeds/site/domainName?with-mappings=true HTTP/1.1 Host: sites.google.com GData-Version: 1.4 Authorization: <your authorization header here> <entry gd:etag="W/"DkQGQHczfA9WxNaFk4.""> <id>https://sites.google.com/feeds/site/domainName/myOtherTestSite</id> <updated>2009-12-01T02:25:21.987Z</updated> <app:edited xmlns:app="http://www.w3.org/2007/app">2009-12-01T02:25:21.987Z</app:edited> <title>myOtherTestSite</title> <summary>A new site to hold memories</summary> <link rel="alternate" type="text/html" href="http://sites.google.com/site/myOtherTestSite"/> <link rel="http://schemas.google.com/acl/2007#accessControlList" type="application/atom+xml" href="https://sites.google.com/feeds/acl/site/domainName/myOtherTestSite"/> <link rel="self" type="application/atom+xml" href="https://sites.google.com/feeds/site/domainName/myOtherTestSite"/> <link rel="edit" type="application/atom+xml" href="https://sites.google.com/feeds/site/domainName/myOtherTestSite"/> <link rel='webAddressMapping' href='www.my-new-sitemapping.com'> <!-- missing mapping2 will be deleted --> <link rel='webAddressMapping' href='http://www.myothermapping.org'> </entry>
ध्यान दें कि वेब पता मैपिंग की जानकारी, साइट बनाते/कॉपी करते समय भी दी जा सकती है.
गतिविधि फ़ीड
गतिविधि फ़ीड को फ़ेच करके, किसी साइट की हाल ही की गतिविधि (बदलावों) को फ़ेच किया जा सकता है. गतिविधि फ़ीड की हर एंट्री में, साइट में किए गए बदलाव की जानकारी होती है.
गतिविधि फ़ीड के बारे में क्वेरी करने के लिए, गतिविधि फ़ीड के यूआरएल पर एचटीटीपी GET भेजें:
https://sites.google.com/feeds/activity/domainName/siteName
| फ़ीड पैरामीटर | ब्यौरा |
|---|---|
domainName | 'site' या G Suite पर होस्ट किए गए आपके डोमेन का डोमेन (उदाहरण के लिए, example.com). |
siteName | आपकी साइट का वेबस्पेस नाम.यह साइट के यूआरएल में मिलता है. उदाहरण के लिए, myCoolSite. |
अनुरोध और जवाब का उदाहरण:
GET /feeds/activity/site/siteName HTTP/1.1 Host: sites.google.com GData-Version: 1.4 Authorization: <your authorization header here> HTTP/1.1 200 OK <?xml version="1.0" encoding="UTF-8"?> <feed xmlns="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/"> <id>https://sites.google.com/feeds/activity/site/siteName</id> <updated>2009-09-10T05:24:23.120Z</updated> <title>Activity</title> <link rel="alternate" type="text/html" href="http://sites.google.com/site/siteName/system/app/pages/recentChanges"/> <link rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml" href="https://sites.google.com/feeds/activity/site/siteName"/> <link rel="self" type="application/atom+xml" href="https://sites.google.com/feeds/activity/site/siteName"/> <generator version="1" uri="http://sites.google.com">Google Sites</generator> <openSearch:startIndex>1</openSearch:startIndex> <entry xmlns:gd="http://schemas.google.com/g/2005" gd:etag="W/"CU4GQ3szfSl7ImA9WxNRFUg.""> <id>https://sites.google.com/feeds/activity/site/siteName/940375996952876062</id> <updated>2009-09-10T03:38:42.585Z</updated> <category scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/sites/2008#deletion" label="deletion"/> <title>home</title> <summary type="xhtml"> <div xmlns="http://www.w3.org/1999/xhtml">User deleted <a href="http://sites.google.com/site/siteName/home">home</a> </div> </summary> <link rel="http://schemas.google.com/sites/2008#revision" type="application/atom+xml" href="https://sites.google.com/feeds/revision/site/siteName/5409745539831916487"/> <link rel="http://schemas.google.com/sites/2008#current" type="application/atom+xml" href="https://sites.google.com/feeds/content/site/siteName/5409745539831916487"/> <link rel="self" type="application/atom+xml" href="https://sites.google.com/feeds/activity/site/siteName/940375996952876062"/> <author> <name>User</name> <email>user@gmail.com</email> </author> </entry> <entry xmlns:gd="http://schemas.google.com/g/2005" gd:etag="W/"CU8DQn45fyl7ImA9WxNRFUg.""> <id>https://sites.google.com/feeds/activity/site/siteName/7165439066235480082</id> <updated>2009-09-10T03:37:53.027Z</updated> <category scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/sites/2008#edit" label="edit"/> <title>home</title> <summary type="xhtml"> <div xmlns="http://www.w3.org/1999/xhtml">User2 edited <a href="http://sites.google.com/site/siteName/home">home</a> </div> </summary> <link rel="http://schemas.google.com/sites/2008#revision" type="application/atom+xml" href="https://sites.google.com/feeds/revision/site/siteName/5409745539831916487"/> <link rel="http://schemas.google.com/sites/2008#current" type="application/atom+xml" href="https://sites.google.com/feeds/content/site/siteName/5409745539831916487"/> <link rel="self" type="application/atom+xml" href="https://sites.google.com/feeds/activity/site/siteName/7165439066235480082"/> <author> <name>User</name> <email>user@gmail.com</email> </author> </entry> <entry xmlns:gd="http://schemas.google.com/g/2005" gd:etag="W/"CU8AR3s4cSl7ImA9WxNRFUg.""> <id>https://sites.google.com/feeds/activity/site/siteName/127448462987345884</id> <updated>2009-09-10T03:37:26.539Z</updated> <category scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/sites/2008#creation" label="creation"/> <title>home</title> <summary type="xhtml"> <div xmlns="http://www.w3.org/1999/xhtml">User3 created <a href="http://sites.google.com/site/siteName/home">home</a> </div> </summary> <link rel="http://schemas.google.com/sites/2008#revision" type="application/atom+xml" href="https://sites.google.com/feeds/revision/site/siteName/5409745539831916487"/> <link rel="http://schemas.google.com/sites/2008#current" type="application/atom+xml" href="https://sites.google.com/feeds/content/site/siteName/5409745539831916487"/> <link rel="self" type="application/atom+xml" href="https://sites.google.com/feeds/activity/site/siteName/127448462987345884"/> <author> <name>User3</name> <email>user3@gmail.com</email> </author> </entry> </feed>
ध्यान दें: इस फ़ीड को ऐक्सेस करने के लिए, यह ज़रूरी है कि आप साइट के मालिक हों या आपके पास साइट पर साथ मिलकर काम करने की अनुमति हो.
आपके क्लाइंट को सही Authorization हेडर भेजना होगा. साथ ही, अनुरोधों को अनुमति देने के दौरान मिले टोकन का रेफ़रंस देना होगा.
रिविज़न फ़ीड
किसी कॉन्टेंट एंट्री के बदलावों का इतिहास फ़ेच करने के लिए, एंट्री के बदलाव वाले लिंक पर एचटीटीपी GET भेजें:
https://sites.google.com/feeds/revision/domainName/siteName/CONTENT_ENTRY_ID
| फ़ीड पैरामीटर | ब्यौरा |
|---|---|
domainName | 'site' या G Suite पर होस्ट किए गए आपके डोमेन का डोमेन (उदाहरण के लिए, example.com). |
siteName | आपकी साइट का वेबस्पेस नाम.यह साइट के यूआरएल में मिलता है. उदाहरण के लिए, myCoolSite. |
किसी पेज/टिप्पणी/अटैचमेंट/सूची के आइटम के लिए बदलावों का लिंक ढूंढने के लिए, पहले कॉन्टेंट फ़ीड से एंट्री को वापस पाएं. इसके लिए, CONTENT_ENTRY_ID का इस्तेमाल करें. वापस लाई गई एंट्री में, बदलाव वाले फ़ीड का <atom:link> शामिल होगा.
उदाहरण के लिए:
<link rel="http://schemas.google.com/sites/2008#revision" type="application/atom+xml"
href="https://sites.google.com/feeds/revision/domainName/siteName/CONTENT_ENTRY_ID"/>
अनुरोध और जवाब का उदाहरण:
GET /feeds/revision/domainName/siteName/CONTENT_ENTRY_ID HTTP/1.1 Host: sites.google.com GData-Version: 1.4 Authorization: <your authorization header here> HTTP/1.1 200 OK <?xml version="1.0" encoding="UTF-8"?> <feed xmlns="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:sites="http://schemas.google.com/sites/2008" xmlns:gs="http://schemas.google.com/spreadsheets/2006" xmlns:dc="http://purl.org/dc/terms" xmlns:batch="http://schemas.google.com/gdata/batch" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0"> <id>https://sites.google.com/feeds/revision/domainName/siteName/CONTENT_ENTRY_ID</id> <updated>2009-09-10T04:33:35.337Z</updated> <title>Revisions</title> <link rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml" href="https://sites.google.com/feeds/revision/domainName/siteName/CONTENT_ENTRY_ID"/> <link rel="self" type="application/atom+xml" href="https://sites.google.com/feeds/revision/domainName/siteName/CONTENT_ENTRY_ID"/> <generator version="1" uri="http://sites.google.com">Google Sites</generator> <openSearch:startIndex>1</openSearch:startIndex> <entry gd:etag="W/"CU4GQmA9WxNRFUg.""> <id>https://sites.google.com/feeds/revision/domainName/siteName/CONTENT_ENTRY_ID/2</id> <updated>2009-09-10T03:38:42.045Z</updated> <category scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/sites/2008#webpage" label="webpage"/> <title>Home</title> <content type="xhtml"> <div xmlns="http://www.w3.org/1999/xhtml">Latest content here</div> </content> <link rel="alternate" type="text/html" href="http://sites.google.com/domainName/siteName/CONTENT_ENTRY_ID/system/app/pages/admin/compare?wuid=wuid%3Agx%3A4f67c7&rev1=2"/> <link rel="self" type="application/atom+xml" href="https://sites.google.com/feeds/revision/domainName/siteName/CONTENT_ENTRY_ID/2"/> <author> <name>User</name> <email>user@gmail.com</email> </author> <sites:pageName>home</sites:pageName> <sites:revision>2</sites:revision> </entry> <entry gd:etag="W/"CU8DQ388eSl7ImA9WxNRFUg.""> <id>https://sites.google.com/feeds/revision/domainName/siteName/CONTENT_ENTRY_ID/1</id> <updated>2009-09-10T03:37:52.171Z</updated> <category scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/sites/2008#webpage" label="webpage"/> <title>Home</title> <content type="xhtml"> <div xmlns="http://www.w3.org/1999/xhtml">Older content here</div> </content> <link rel="alternate" type="text/html" href="http://sites.google.com/domainName/siteName/CONTENT_ENTRY_ID/system/app/pages/admin/compare?wuid=wuid%3Agx%3A4bc7&rev1=1"/> <link rel="self" type="application/atom+xml" href="https://sites.google.com/feeds/revision/domainName/siteName/CONTENT_ENTRY_ID/1"/> <author> <name>User</name> <email>user@gmail.com</email> </author> <sites:pageName>home</sites:pageName> <sites:revision>1</sites:revision> </entry> </feed>
ध्यान दें: इस फ़ीड को ऐक्सेस करने के लिए, यह ज़रूरी है कि आप साइट के मालिक हों या आपके पास साइट पर साथ मिलकर काम करने की अनुमति हो.
आपके क्लाइंट को सही Authorization हेडर भेजना होगा. साथ ही, अनुरोधों को अनुमति देने के दौरान मिले टोकन का रेफ़रंस देना होगा.
कॉन्टेंट फ़ीड
कॉन्टेंट वापस पाना
कॉन्टेंट फ़ीड में, Sites का मौजूदा कॉन्टेंट दिखता है. यहां दिए गए यूआरएल पर, पुष्टि किया गया GET अनुरोध भेजें:
https://sites.google.com/feeds/content/domainName/siteName
| फ़ीड पैरामीटर | ब्यौरा |
|---|---|
domainName | 'site' या G Suite पर होस्ट किए गए आपके डोमेन का डोमेन (उदाहरण के लिए, example.com). |
siteName | आपकी साइट का वेबस्पेस नाम.यह साइट के यूआरएल में मिलता है. उदाहरण के लिए, myCoolSite. |
इससे एक फ़ीड बनता है, जिसमें साइट पर मौजूद कॉन्टेंट एंट्री के पहले पेज की सूची होती है. फ़ीड में मौजूद हर एंट्री, अलग-अलग तरह के कॉन्टेंट को दिखाएगी. जैसे, webpage, filecabinet, attachment, comment वगैरह. <category scheme="http://schemas.google.com/g/2005#kind"> एलिमेंट से, एंट्री के टाइप का पता चलता है. इस्तेमाल की जा सकने वाली kind वैल्यू की सूची देखने के लिए, रेफ़रंस गाइड देखें.
ध्यान दें: इस फ़ीड को ऐक्सेस करने के लिए, पुष्टि करने की ज़रूरत हो भी सकती है और नहीं भी. यह साइट को शेयर करने की अनुमतियों पर निर्भर करता है.
अगर साइट सार्वजनिक नहीं है, तो आपके क्लाइंट को सही Authorization हेडर भेजना होगा (जैसा कि ऊपर दिए गए उदाहरण में दिखाया गया है) और अनुरोधों को अनुमति देने में मिले टोकन का रेफ़रंस देना होगा.
GET /feeds/content/domainName/siteName HTTP/1.1 Host: sites.google.com GData-Version: 1.4 Authorization: <your authorization header here> HTTP/1.1 200 OK <?xml version="1.0" encoding="UTF-8"?> <feed xmlns="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:sites="http://schemas.google.com/sites/2008" xmlns:gs="http://schemas.google.com/spreadsheets/2006" xmlns:dc="http://purl.org/dc/terms" xmlns:batch="http://schemas.google.com/gdata/batch" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0"> <id>https://sites.google.com/feeds/content/domainName/siteName</id> <updated>2009-08-31T01:39:20.286Z</updated> <title>Content</title> <link rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml" href="https://sites.google.com/feeds/content/domainName/siteName"/> <link rel="http://schemas.google.com/g/2005#post" type="application/atom+xml" href="https://sites.google.com/feeds/content/domainName/siteName"/> <link rel="self" type="application/atom+xml" href="https://sites.google.com/feeds/content/domainName/siteName"/> <link rel="http://schemas.google.com/g/2005#batch" type="application/atom+xml" href="https://sites.google.com/feeds/content/domainName/siteName/batch""/> <link rel="next" type="application/atom+xml" href="https://sites.google.com/feeds/content/domainName/siteName/?start-index=2"/> <generator version="1" uri="http://sites.google.com">Google Sites</generator> <openSearch:startIndex>1</openSearch:startIndex> <entry gd:etag="W/"Ck8GQXk7fil7ImA9WxNSFk0.""> <id>https://sites.google.com/feeds/content/domainName/siteName/7322156894</id> <updated>2009-08-30T02:53:40.706Z</updated> <app:edited xmlns:app="http://www.w3.org/2007/app">2009-08-30T02:53:40.706Z</app:edited> <category scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/sites/2008#webpage" label="webpage"/> <title>Subpage</title> <content type="xhtml"> <div xmlns="http://www.w3.org/1999/xhtml">Page html content here</div> </content> <link rel="http://schemas.google.com/sites/2008#parent" type="application/atom+xml" href="https://sites.google.com/feeds/content/domainName/siteName/6492205817"/> <link rel="alternate" type="text" href="http://sites.google.com/site/siteName/subpage"/> <link rel="http://schemas.google.com/sites/2008#revision" type="application/atom+xml" href="https://sites.google.com/feeds/revision/domainName/siteName/7322156894"/> <link rel="self" type="application/atom+xml" href="https://sites.google.com/feeds/content/domainName/siteName/7322156894"/> <link rel="edit" type="application/atom+xml" href="https://sites.google.com/feeds/content/domainName/siteName/7322156894"/> <author> <name>User</name> <email>user@gmail.com</email> </author> <sites:pageName>subpage</sites:pageName> <sites:revision>5</sites:revision> </entry> <entry gd:etag="W/"CkMBQH08fCl7ImA9WxNSFk0.""> <id>https://sites.google.com/feeds/content/domainName/siteName/5930635231</id> <updated>2009-08-30T02:47:31.374Z</updated> <app:edited xmlns:app="http://www.w3.org/2007/app">2009-08-30T02:47:31.374Z</app:edited> <category scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/sites/2008#listitem" label="listpage"/> <title/> <link rel="http://schemas.google.com/sites/2008#parent" type="application/atom+xml" href="https://sites.google.com/feeds/content/domainName/siteName/5930635231"/> <link rel="http://schemas.google.com/sites/2008#revision" type="application/atom+xml" href="https://sites.google.com/feeds/revision/domainName/siteName/5930635231"/> <link rel="self" type="application/atom+xml" href="https://sites.google.com/feeds/content/domainName/siteName/5930635231"/> <link rel="edit" type="application/atom+xml" href="https://sites.google.com/feeds/content/domainName/siteName/5930635231"/> <author> <name>User</name> <email>user@gmail.com</email> </author> <sites:revision>1</sites:revision> <gs:field index="A" name="Issue/Feature">Implement cool feature X</gs:field> <gs:field index="B" name="Priority">P2</gs:field> <gs:field index="C" name="Owner"/> <gs:field index="D" name="Resolved"/> </entry> <entry gd:etag="W/"AkYHQ3ozcCl7ImA9WxJaE08.""> <id>https://sites.google.com/feeds/content/domainName/siteName/1265948545471894517</id> <updated>2009-08-03T19:35:32.488Z</updated> <app:edited xmlns:app="http://www.w3.org/2007/app">2009-08-03T19:35:32.488Z</app:edited> <category scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/sites/2008#filecabinet" label="filecabinet"/> <title>files</title> <content type="xhtml"> <div xmlns="http://www.w3.org/1999/xhtml">Page html content here</div> </content> <link rel="alternate" type="text" href="https://sites.google.com/domainName/siteName/files"/> <link rel="http://schemas.google.com/sites/2008#revision" type="application/atom+xml" href="https://sites.google.com/feeds/revision/domainName/siteName/12671894517"/> <link rel="self" type="application/atom+xml" href="https://sites.google.com/feeds/content/domainName/siteName/12671894517"/> <link rel="edit" type="application/atom+xml" href="https://sites.google.com/feeds/content/domainName/siteName/12671894517"/> <author> <name>User</name> <email>user@gmail.com</email> </author> <gd:feedLink href="httpn://sites.google.com/feeds/content/domainName/siteName?parent=12671894517"/> <sites:pageName>files</sites:pageName> <sites:revision>1</sites:revision> </entry> ... </feed>
ध्यान दें: ये सिर्फ़ शुरुआती कुछ नतीजे हैं. पूरे कॉन्टेंट फ़ीड को पेज के हिसाब से देखने के लिए, फ़ीड के 'अगला' लिंक पर जाएं:
<link rel="next" type="application/atom+xml" href="https://sites.google.com/feeds/content/domainName/siteName/?start-index=2"/>
Atom के सामान्य एलिमेंट के बारे में जानने के लिए, Google डेटा प्रोटोकॉल रेफ़रंस देखें.
Google Sites के पुराने वर्शन के Sites API के लिए खास मायने रखने वाले एलिमेंट के बारे में यहां बताया गया है. कुछ तरह की एंट्री में अतिरिक्त प्रॉपर्टी होंगी (यहां नहीं दी गई हैं), जबकि कुछ में नहीं होंगी. उदाहरण के लिए, listitem एंट्री में <gs:field> एलिमेंट हो सकते हैं, जबकि webpage एंट्री में नहीं.
| एलिमेंट | ब्यौरा |
|---|---|
<content ...> | इनर टेक्स्ट, पेज का एचटीएमएल बॉडी होता है. कुछ एंट्री (जैसे, अटैचमेंट) के लिए, इस एलिमेंट में src एट्रिब्यूट शामिल होगा, जो फ़ाइल की ओर इशारा करेगा. |
<link rel="alternate" ...> | Google Sites में मौजूद पेज या आइटम का लिंक. |
<link rel="http://schemas.google.com/sites/2008#revision" ...> | href एट्रिब्यूट, एंट्री के बदलाव वाले फ़ीड पर ले जाता है. |
<link rel="http://schemas.google.com/sites/2008#parent" ...> | href एट्रिब्यूट, एंट्री की पैरंट एंट्री के बारे में बताता है. |
<link rel="http://schemas.google.com/sites/2008#template" ...> | href एट्रिब्यूट, एंट्री के टेंप्लेट पेज पर ले जाता है. |
<category scheme="http://schemas.google.com/g/2005#kind" ...> | label, एंट्री का टाइप है. |
<category term="http://schemas.google.com/g/2005#template" ...> | label=template, जिससे पता चलता है कि एंट्री एक टेंप्लेट है. |
<gd:feedLink> | href एट्रिब्यूट, एंट्री के पैरंट के चाइल्ड की जानकारी देता है. |
<sites:pageName> | पेज का वेबस्पेस नाम; पेज के यूआरएल में मौजूद नाम के मुताबिक. |
<sites:revision> | मौजूदा बदलाव का नंबर. |
कॉन्टेंट फ़ीड क्वेरी के उदाहरण
Google Data API के कुछ स्टैंडर्ड क्वेरी पैरामीटर और Sites के पुराने वर्शन के एपीआई के लिए खास तौर पर बनाए गए पैरामीटर का इस्तेमाल करके, कॉन्टेंट फ़ीड को खोजा जा सकता है. ज़्यादा जानकारी और इस्तेमाल किए जा सकने वाले पैरामीटर की पूरी सूची के लिए, रेफ़रंस गाइड देखें.
खास तरह की एंट्री वापस लाना
सिर्फ़ किसी खास तरह की एंट्री फ़ेच करने के लिए, kind पैरामीटर का इस्तेमाल करें. इस उदाहरण में, सिर्फ़ webpage एंट्री दिखती हैं:
GET /feeds/content/domainName/siteName?kind=webpage
एक से ज़्यादा एंट्री टाइप दिखाने के लिए, हर kind को ',' से अलग करें. इस उदाहरण में, filecabinet और listpage एंट्री दिखती हैं:
GET /feeds/content/domainName/siteName?kind=filecabinet,listpage
इसके अलावा, kind पैरामीटर के बजाय, Google डेटा /-/category क्वेरी के लिए स्टैंडर्ड फ़ॉर्मैट का इस्तेमाल किया जा सकता है:
GET /feeds/content/domainName/siteName/-/filecabinet|listpage
पेज के टेंप्लेट फ़ेच किए जा रहे हैं
इस उदाहरण में, सिर्फ़ template पेज दिखते हैं:
GET /feeds/content/domainName/siteName/-/template
सभी तरह की एंट्री दिखाने और template पेजों को शामिल करने के लिए, इसका इस्तेमाल करें:
GET /feeds/content/domainName/siteName/-/template|-template
पाथ के हिसाब से पेज को वापस लाना
अगर आपको Google Sites में किसी पेज का रिलेटिव पाथ पता है, तो उस पेज को फ़ेच करने के लिए path पैरामीटर का इस्तेमाल किया जा सकता है.
इस उदाहरण से, http://sites.google.com/site/siteName/path/to/the/page पर मौजूद पेज दिखेगा:
GET /feeds/content/domainName/siteName?path=/path/to/the/page
किसी पैरंट पेज में मौजूद सभी एंट्री वापस पाना
अगर आपको किसी पेज का एंट्री आईडी पता है, तो parent पैरामीटर का इस्तेमाल करके, उसकी सभी चाइल्ड एंट्री फ़ेच की जा सकती हैं (अगर कोई हो):
GET /feeds/content/domainName/siteName?parent=CONTENT_ENTRY_ID
ड्राफ़्ट या मिटाई गई एंट्री शामिल करना
ड्राफ़्ट या मिटाई गई एंट्री शामिल करने के लिए, क्रमशः include-drafts या include-deleted पैरामीटर का इस्तेमाल करें.
इस उदाहरण में, कॉन्टेंट फ़ीड में मौजूद ड्राफ़्ट एंट्री शामिल हैं:
GET /feeds/content/domainName/siteName?include-drafts=true
पूरे टेक्स्ट की खोज
किसी साइट के पूरे कॉन्टेंट में खोजने के लिए, q पैरामीटर का इस्तेमाल करें. इससे पूरे टेक्स्ट की खोज की जा सकती है:
GET /feeds/content/domainName/siteName?q=Text%20I%20am%20looking%20for
कॉन्टेंट बनाना
कॉन्टेंट फ़ीड में एचटीटीपी POST भेजकर, नया कॉन्टेंट (वेबपेज, सूची वाले पेज, फ़ाइल कैबिनेट पेज, घोषणा पेज वगैरह) बनाया जा सकता है:
https://sites.google.com/feeds/content/domainName/siteName
इस्तेमाल किए जा सकने वाले एंट्री टाइप की सूची देखने के लिए, रेफ़रंस गाइड में kind पैरामीटर देखें.
नए आइटम / पेज बनाना
इस उदाहरण में, साइट के टॉप-लेवल में एक नया webpage बनाया गया है. इसमें पेज बॉडी के लिए कुछ एक्सएचटीएमएल शामिल है. साथ ही, हेडिंग के टाइटल को 'New WebPage Title' पर सेट किया गया है:
POST /feeds/content/domainName/siteName HTTP/1.1 Host: sites.google.com GData-Version: 1.4 Authorization: <your authorization header here> Content-Length: 328 Content-Type: application/atom+xml <entry xmlns="http://www.w3.org/2005/Atom"> <category scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/sites/2008#webpage" label="webpage"/> <title>New Webpage Title</title> <content type="xhtml"> <div xmlns="http://www.w3.org/1999/xhtml">HTML body goes here</div> </content> </entry>
अगर अनुरोध सही से काम करता है, तो सर्वर 201 Created और एंट्री की कॉपी के साथ जवाब देता है.
कस्टम यूआरएल पाथ के तहत आइटम/पेज बनाना
डिफ़ॉल्ट रूप से, पिछला उदाहरण यूआरएल http://sites.google.com/domainName/siteName/new-webpage-title के तहत बनाया जाएगा और पेज का शीर्षक 'नया वेबपेज शीर्षक' होगा. इसका मतलब है कि यूआरएल के लिए, <atom:title> को new-webpage-title में बदल दिया जाता है.
किसी पेज के यूआरएल पाथ को पसंद के मुताबिक बनाने के लिए, <sites:pageName> एलिमेंट को सेट किया जा सकता है.
इस उदाहरण में, 'फ़ाइल स्टोरेज' पेज हेडिंग के साथ एक नया filecabinet बनाया गया है. हालांकि, <sites:pageName> एलिमेंट की जानकारी देकर, पेज को http://sites.google.com/domainName/siteName/files यूआरएल के तहत बनाया गया है.
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>
सर्वर, किसी पेज के यूआरएल पाथ का नाम तय करने के लिए, प्राथमिकता के इन नियमों का इस्तेमाल करता है:
<sites:pageName>, अगर मौजूद हो.a-z, A-Z, 0-9, -, _को पूरा करना ज़रूरी है.<atom:title>, अगर pageName मौजूद नहीं है, तो यह वैल्यू शून्य नहीं होनी चाहिए. नॉर्मलाइज़ेशन का मतलब है, खाली जगह को ट्रिम करके '-' में बदलना औरa-z, A-Z, 0-9, -, _से मैच न होने वाले वर्णों को हटाना.
उदाहरण के लिए, सर्वर 'Custom_Page2' को स्वीकार करेगा.
सबपेज बनाना
किसी पैरंट पेज के तहत सबपेज (चाइल्ड पेज) बनाने के लिए, अपनी नई Atom एंट्री में <link rel="http://schemas.google.com/sites/2008#parent"> शामिल करें. लिंक के href एट्रिब्यूट को पैरंट एंट्री के इस पेज के लिंक पर सेट करें.
इस उदाहरण में, एंट्री आईडी PARENT_ENTRY_ID वाले पैरंट घोषणा पेज के तहत, 'घोषणा' हेडिंग वाला एक नया announcement बनाया गया है. पेज के मुख्य हिस्से के लिए, XHTML कॉन्टेंट भी शामिल किया गया है:
POST /feeds/content/domainName/siteName HTTP/1.1 Host: sites.google.com GData-Version: 1.4 Authorization: <your authorization header here> Content-Length: 470 Content-Type: application/atom+xml <entry xmlns="http://www.w3.org/2005/Atom"> <category scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/sites/2008#announcement" label="announcement"/> <link rel="http://schemas.google.com/sites/2008#parent" type="application/atom+xml" href="https://sites.google.com/feeds/content/domainName/siteName/PARENT_ENTRY_ID"/> <title>announcement</title> <content type="xhtml"> <div xmlns="http://www.w3.org/1999/xhtml">This weekend. My place.</div> </content> </entry>
पेज के टेंप्लेट
पेज टेंप्लेट बनाना
पेज टेंप्लेट बनाने की प्रोसेस, नए आइटम/पेज बनाने और सबपेज बनाने की प्रोसेस जैसी ही है. फ़र्क़ सिर्फ़ इतना है कि इसमें category को जोड़ा जाता है. साथ ही, इसमें टर्म और लेबल को क्रमशः 'http://schemas.google.com/g/2005#template' और 'template' पर सेट किया जाता है.
इस उदाहरण में, एक नया webpage टेंप्लेट बनाया गया है.
POST /feeds/content/domainName/siteName HTTP/1.1 Host: sites.google.com GData-Version: 1.4 Authorization: <your authorization header here> Content-Length: 464 Content-Type: application/atom+xml <entry xmlns="http://www.w3.org/2005/Atom" xmlns:sites="http://schemas.google.com/sites/2008"> <category scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/sites/2008#webpage" label="webpage"/> <category scheme="http://schemas.google.com/g/2005#labels" term="http://schemas.google.com/g/2005#template" label="template"/> <title>Webpage Template</title> <content type="xhtml"> <div xmlns="http://www.w3.org/1999/xhtml">This weekend. My place.</div> </content> </entry>
किसी टेंप्लेट का इस्तेमाल करके पेज बनाना
पेज टेंप्लेट बनाने की तरह ही, किसी टेंप्लेट से नया पेज इंस्टैंशिएट किया जा सकता है. इसके लिए, आपको rel='http://schemas.google.com/sites/2008#template' के साथ <link> शामिल करना होगा. यह पेज टेंप्लेट के इस पेज का लिंक पर ले जाता है.
इस उदाहरण में, किसी मौजूदा पेज टेंप्लेट से एक नया filecabinet पेज बनाया गया है. यह टेंप्लेट, फ़ाइल कैबिनेट को तय करता है.
POST /feeds/content/domainName/siteName HTTP/1.1 Host: sites.google.com GData-Version: 1.4 Authorization: <your authorization header here> Content-Length: 464 Content-Type: application/atom+xml <entry xmlns="http://www.w3.org/2005/Atom" xmlns:sites="http://schemas.google.com/sites/2008"> <category scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/sites/2008#filecabinet" label="filecabinet"/> <title>File Cabinet Page From Template</title> <link rel='http://schemas.google.com/sites/2008#template' type='application/atom+xml' href='https://sites.google.com/feeds/content/domainName/siteName/ENTRY_ID'/> </entry>
ध्यान दें: भले ही टेंप्लेट में <category> तय किया गया हो, लेकिन आपको अपनी
एंट्री में एक शामिल करना होगा. यह भी ध्यान रखें कि अगर आपने <content> एलिमेंट शामिल किया है, तो सर्वर उसे अस्वीकार कर देगा.
फ़ाइलें अपलोड की जा रही हैं
Google Sites की तरह ही, इस एपीआई की मदद से फ़ाइल कैबिनेट पेजों और पैरंट पेजों पर अटैचमेंट अपलोड किए जा सकते हैं.
किसी पैरंट में अटैचमेंट अपलोड करने के लिए, कॉन्टेंट फ़ीड के यूआरएल पर एचटीटीपी POST का इस्तेमाल करके अनुरोध भेजें:
https://sites.google.com/feeds/content/domainName/siteName
POST का मुख्य हिस्सा, एमआईएमई मल्टीपार्ट अनुरोध होना चाहिए. इससे फ़ाइल के कॉन्टेंट को अटैचमेंट के मेटाडेटा वाले <atom:entry> के साथ जोड़ा जा सकता है. <atom:entry> में पैरंट एंट्री के लिंक का रेफ़रंस होना चाहिए, ताकि यह तय किया जा सके कि अटैचमेंट कहां बनाया जाएगा.
ज़्यादा जानकारी के लिए, सबपेज बनाना लेख पढ़ें.
अटैचमेंट अपलोड हो रहे हैं
यहां PARENT_ENTRY_ID आईडी वाले फ़ाइल कैबिनेट में PDF फ़ाइल अपलोड करने का उदाहरण दिया गया है. अटैचमेंट, 'PDF File' टाइटल और 'HR packet' ब्यौरे के साथ बनाया जाएगा. ब्यौरा डालना ज़रूरी नहीं है.
POST /feeds/content/domainName/siteName HTTP/1.1 Host: sites.google.com GData-Version: 1.4 Authorization: <your authorization header here> Content-Length: 7221984 Content-Type: multipart/related; boundary=END_OF_PART --END_OF_PART Content-Type: application/atom+xml <entry xmlns="http://www.w3.org/2005/Atom"> <category scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/sites/2008#attachment" label="attachment"/> <link rel="http://schemas.google.com/sites/2008#parent" type="application/atom+xml" href="https://sites.google.com/feeds/content/domainName/siteName/PARENT_ENTRY_ID"/> <title>PDF File</title> <summary>HR packet</summary> </entry> --END_OF_PART Content-Type: application/pdf ... pdf contents here ... --END_OF_PART--
अगर अपलोड हो जाता है, तो सर्वर 201 Created और नए अटैचमेंट की एंट्री की कॉपी के साथ जवाब देगा.
किसी फ़ोल्डर में अटैचमेंट अपलोड करना
filecabinet में मौजूद किसी फ़ोल्डर में अटैचमेंट अपलोड करने के लिए, 'term' एट्रिब्यूट वाली कैटगरी शामिल करें. साथ ही, इस एट्रिब्यूट की वैल्यू के तौर पर फ़ोल्डर का नाम सेट करें:
<category scheme="http://schemas.google.com/sites/2008#folder" term="FolderName">वेब अटैचमेंट
वेब अटैचमेंट, खास तरह के अटैचमेंट होते हैं. ये वेब पर मौजूद अन्य फ़ाइलों के लिंक होते हैं. इन्हें अपनी फ़ाइल कैबिनेट की लिस्टिंग में जोड़ा जा सकता है. यह सुविधा, Google Sites के यूज़र इंटरफ़ेस (यूआई) में 'यूआरएल की मदद से फ़ाइल जोड़ें' अपलोड करने के तरीके से मिलती-जुलती है.
ध्यान दें: वेब अटैचमेंट सिर्फ़ फ़ाइल कैबिनेट में बनाए जा सकते हैं. इन्हें अन्य तरह के पेजों पर अपलोड नहीं किया जा सकता.
इस उदाहरण में, आईडी FILECABINET_ENTRY_ID से रेफ़रंस की गई फ़ाइल कैबिनेट में webattachment बनाया गया है.
इसका टाइटल और ब्यौरा (ज़रूरी नहीं) क्रमशः 'GoogleLogo' और 'nice colors' पर सेट है.
POST /feeds/content/domainName/siteName HTTP/1.1 Host: sites.google.com GData-Version: 1.4 Authorization: <your authorization header here> Content-Type: application/atom+xml Content-Length: 531 <entry xmlns="http://www.w3.org/2005/Atom"> <category scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/sites/2008#webattachment" label="webattachment"/> <link rel="http://schemas.google.com/sites/2008#parent" type="application/atom+xml" href="https://sites.google.com/feeds/content/domainName/siteName/FILECABINET_ENTRY_ID"/> <title>GoogleLogo</title> <summary>nice colors</summary> <content type="image/gif" src="http://www.google.com/images/logo.gif"></content> </entry>
POST, उपयोगकर्ता के फ़ाइल कैबिनेट में एक लिंक बनाता है. यह लिंक, 'http://www.google.com/images/logo.gif' पर मौजूद इमेज पर ले जाता है.
कॉन्टेंट अपडेट करना
किसी भी पेज के मेटाडेटा (टाइटल, pageName वगैरह) और पेज के कॉन्टेंट में बदलाव किया जा सकता है. इसके लिए, edit लिंक पर PUT का अनुरोध करना होगा.
अनुरोध के मुख्य हिस्से में, अपडेट किए गए पेज के बारे में बताने वाली Atom एंट्री होनी चाहिए. इस नियम का अपवाद, अटैचमेंट एंट्री है. इसमें एंट्री का इस्तेमाल, सिर्फ़ अटैचमेंट के मेटाडेटा को अपडेट करने के लिए किया जा सकता है.
अटैच की गई फ़ाइल का कॉन्टेंट बदलने के लिए, रॉ डेटा को अटैचमेंट के edit-media लिंक पर PUT अनुरोध के मुख्य हिस्से के तौर पर शामिल करें. एमआईएमई मल्टीपार्ट अनुरोध का इस्तेमाल करके, मेटाडेटा और अटैच की गई फ़ाइल के कॉन्टेंट, दोनों को एक साथ अपडेट किया जा सकता है.
यह पक्का करने के लिए कि आपका अपडेट किसी दूसरे क्लाइंट के बदलावों को ओवरराइट न करे, ओरिजनल एंट्री की ETag वैल्यू शामिल करें. ऐसा करने के लिए, एचटीटीपी If-Match हेडर में ETag की वैल्यू दें या अपडेट की गई एंट्री में, ओरिजनल एंट्री का gd:etag एट्रिब्यूट शामिल करें. ओरिजनल एंट्री की ई-टैग वैल्यू तय करने के लिए, <entry> एलिमेंट के gd:etag एट्रिब्यूट की जांच करें.
मीडिया एंट्री के लिए, मीडिया का ई-टैग, edit-media लिंक के gd:etag एट्रिब्यूट में उपलब्ध हो सकता है.
अगर आपको एंट्री को अपडेट करना है, भले ही किसी दूसरे व्यक्ति ने उसे वापस पाने के बाद अपडेट किया हो, तो If-Match: * का इस्तेमाल करें और ETag शामिल न करें. ई-टैग के बारे में ज़्यादा जानकारी के लिए, Google डेटा एपीआई की रेफ़रंस गाइड देखें.
किसी आइटम का मेटाडेटा या एचटीएमएल कॉन्टेंट अपडेट करना
किसी एंट्री के मेटाडेटा या एचटीएमएल कॉन्टेंट को अपडेट करने के लिए, एंट्री के edit लिंक पर एचटीटीपी PUT भेजें.
यहां listpage एंट्री (इसके आईडी ENTRY_ID से दिखाया गया है) को अपडेट करने का उदाहरण दिया गया है. इसमें ये बदलाव किए गए हैं:
- टाइटल को बदलकर 'अपडेट किया गया कॉन्टेंट' कर दिया गया है
- अपडेट किया गया एचटीएमएल कॉन्टेंट
- सूची के पहले कॉलम का शीर्षक बदलकर 'मालिक' कर दिया गया है
- पेज के यूआरएल पाथ में
<sites:pageName>एलिमेंट की मदद से बदलाव किया गया है
PUT /feeds/content/domainName/siteName/ENTRY_ID Host: sites.google.com GData-Version: 1.4 Authorization: <your authorization header here> Content-Length: 816 Content-Type: application/atom+xml <entry xmlns="http://www.w3.org/2005/Atom" xmlns:sites="http://schemas.google.com/sites/2008" xmlns:gs="http://schemas.google.com/spreadsheets/2006" xmlns:gd="http://schemas.google.com/g/2005" gd:etag="W/"CEEBRn0ymA9WxJWEUw.""> <category scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/sites/2008#listpage" label="listpage"/> <title>Updated Title</title> <content type="xhtml"> <div xmlns="http://www.w3.org/1999/xhtml">Updated Content</div> </content> <gs:worksheet name="listpage"/> <gs:header row="1"/> <gs:data startRow="2"> <gs:column index="A" name="Owner"/> <gs:column index="B" name="Description"/> <gs:column index="C" name="Completed"/> </gs:data> <sites:pageName>newPagePath</sites:pageName> </entry>
ध्यान दें: सर्वर से मिलने वाली एंट्री में, ऊपर दिए गए उदाहरण से ज़्यादा एलिमेंट होंगे.
अटैचमेंट का कॉन्टेंट बदलना
यहां अटैचमेंट के कॉन्टेंट को बदलने का उदाहरण दिया गया है. हालांकि, इसमें मेटाडेटा में कोई बदलाव नहीं किया गया है. अनुरोध में नया कॉन्टेंट शामिल है, इसलिए अटैचमेंट एंट्री के edit-media लिंक का इस्तेमाल किया जाता है.
PUT /feeds/media/content/domainName/siteName/ATTACHMENT_ENTRY_ID Host: sites.google.com GData-Version: 1.4 Authorization: <your authorization header here> Content-Length: 70581 Content-Type: application/msword ... doc contents here ...
अटैचमेंट का मेटाडेटा और कॉन्टेंट अपडेट करना
यहां एक उदाहरण दिया गया है, जिसमें अटैचमेंट के मेटाडेटा और उसके कॉन्टेंट, दोनों को एक साथ अपडेट करने का तरीका बताया गया है. अटैचमेंट का नाम 'नया टाइटल' पर अपडेट हो जाएगा और इसके कॉन्टेंट को .zip फ़ाइल के कॉन्टेंट से बदल दिया जाएगा. अनुरोध में नई फ़ाइल का कॉन्टेंट शामिल है. इसलिए, अटैचमेंट एंट्री के edit-media लिंक का इस्तेमाल किया जाता है.
ध्यान दें कि मेटाडेटा के लिए ETag शामिल करने से, मीडिया कॉन्टेंट के लिए भी If-Match मिलता है. ऐसा इसलिए, क्योंकि मीडिया कॉन्टेंट में कोई भी अपडेट करने से, मेटाडेटा का ETag बदल जाता है.
PUT /feeds/media/content/domainName/siteName/ATTACHMENT_ENTRY_ID Host: sites.google.com GData-Version: 1.4 Authorization: <your authorization header here> Content-Type: multipart/related; boundary="END_OF_PART" --END_OF_PART Content-Type: application/atom+xml <?xml version='1.0' encoding='UTF-8'?> <entry xmlns="http://www.w3.org/2005/Atom" xmlns:gd="http://schemas.google.com/g/2005" gd:etag="BxAaTxRZAyp7ImBq"> <link rel="http://schemas.google.com/sites/2008#parent" type="application/atom+xml" href="https://sites.google.com/feeds/content/domainName/siteName/ATTACHMENT_ENTRY_ID"/> <title>New Title</title> </entry> --END_OF_PART Content-Type: application/zip ... zip contents here ... --END_OF_PART
कॉन्टेंट मिटाना
Google Sites से किसी आइटम को हटाने के लिए, पहले एंट्री को वापस पाएं. इसके बाद, एंट्री के edit यूआरएल पर DELETE अनुरोध भेजें. यह वही यूआरएल है जिसका इस्तेमाल किसी आइटम के मेटाडेटा या एचटीएमएल कॉन्टेंट को अपडेट करते समय किया जाता है.
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>
अगर एंट्री मिटा दी गई है, तो सर्वर एचटीटीपी 200 OK के साथ जवाब देता है.
अगर आपको यह पक्का करना है कि आपने कोई ऐसी एंट्री न मिटाई हो जिसे किसी दूसरे क्लाइंट ने आपके वापस पाने के बाद बदला हो, तो एचटीटीपी If-Match हेडर शामिल करें. इसमें ओरिजनल एंट्री की ई-टैग वैल्यू शामिल होती है. <entry> एलिमेंट के gd:etag एट्रिब्यूट की जांच करके, ओरिजनल एंट्री की ई-टैग वैल्यू का पता लगाया जा सकता है.
अगर आपको एंट्री मिटानी है, भले ही किसी दूसरे व्यक्ति ने उसे वापस पाने के बाद अपडेट किया हो, तो If-Match: * का इस्तेमाल करें और ई-टैग शामिल न करें. (इस मामले में, एंट्री को मिटाने से पहले उसे वापस पाने की ज़रूरत नहीं है.)
ई-टैग के बारे में ज़्यादा जानने के लिए, Google Data APIs की रेफ़रंस गाइड देखें.
अटैचमेंट डाउनलोड करना
अटैचमेंट की एंट्री होने के बाद, एंट्री के <content> src लिंक पर पुष्टि किया गया एचटीटीपी GET भेजकर फ़ाइल डाउनलोड की जा सकती है. PDF के कॉन्टेंट लिंक का उदाहरण:
<content type="application/pdf" src="http://502377765-a-google-com-s-sites.googlegroups.com/feeds/media/content/domainName/siteName/678942036"/>
एसीएल फ़ीड
शेयर करने की अनुमतियों (एसीएल) के बारे में खास जानकारी
एसीएल फ़ीड में हर एसीएल एंट्री, किसी खास इकाई की ऐक्सेस भूमिका को दिखाती है. यह इकाई कोई उपयोगकर्ता, उपयोगकर्ताओं का ग्रुप, डोमेन या डिफ़ॉल्ट ऐक्सेस (जो कि एक सार्वजनिक साइट है) हो सकती है. एंट्री सिर्फ़ उन इकाइयों के लिए दिखेंगी जिनके पास साफ़ तौर पर ऐक्सेस है. Google Sites के यूज़र इंटरफ़ेस (यूआई) की शेयरिंग स्क्रीन पर, "ऐक्सेस वाले लोग" पैनल में हर ईमेल पते के लिए एक एंट्री दिखेगी. इसलिए, डोमेन एडमिन नहीं दिखेंगे. भले ही, उनके पास किसी साइट का ऐक्सेस हो.
भूमिकाएं
भूमिका एलिमेंट से पता चलता है कि किसी इकाई के पास कौनसा ऐक्सेस लेवल हो सकता है. gAcl:role एलिमेंट की चार वैल्यू हो सकती हैं:
- रीडर — दर्शक (रीड-ओनली ऐक्सेस के बराबर).
- writer — यह सहयोगी के लिए इस्तेमाल किया जाता है. इसके पास पढ़ने/लिखने का ऐक्सेस होता है.
- मालिक — आम तौर पर, साइट का एडमिन (इसके पास पढ़ने/लिखने का ऐक्सेस होता है).
स्कोप
स्कोप एलिमेंट उस इकाई को दिखाता है जिसके पास यह ऐक्सेस लेवल है. gAcl:scope एलिमेंट पांच तरह के हो सकते हैं:
- user — ईमेल पते की वैल्यू, जैसे कि "user@gmail.com".
- group — Google ग्रुप का ईमेल पता, जैसे कि "group@domain.com".
- domain — G Suite डोमेन नेम, जैसे कि "domain.com".
- न्योता — ऐसा उपयोगकर्ता जिसे साइट पर न्योता भेजा गया है, लेकिन उसे अब तक साइट की एसीएल में नहीं जोड़ा गया है. (अगर gdata 1.3 या इससे पहले का वर्शन तय किया गया है, तो यह उपलब्ध नहीं होगा.)
- default — "default" टाइप का सिर्फ़ एक स्कोप हो सकता है, जिसकी कोई वैल्यू नहीं होती (जैसे,
<gAcl:scope type="default">). यह स्कोप, किसी सार्वजनिक साइट पर किसी भी उपयोगकर्ता के पास डिफ़ॉल्ट रूप से मौजूद ऐक्सेस को कंट्रोल करता है.
ध्यान दें: डोमेन के लिए, gAcl:role वैल्यू को "मालिक" ऐक्सेस पर सेट नहीं किया जा सकता. उनके पास सिर्फ़ रीडर या राइटर ऐक्सेस हो सकता है.
"न्योता" स्कोप के बारे में जानकारी.
जब एसीएल में एक या उससे ज़्यादा ऐसे उपयोगकर्ताओं को जोड़ा जाता है जिनके पास पहले से Google खाता नहीं है, तब एपीआई न्योते का स्कोप दिखाता है. एपीआई, एम्बेड किए गए टोकन के साथ एक यूआरएल दिखाता है. आपको यह यूआरएल, न्योता पाने वाले उपयोगकर्ताओं को देना होगा, ताकि वे न्योता स्वीकार कर सकें.
न्योता भेजने के इस तरीके से, Google खाते का इस्तेमाल न करने वाले उपयोगकर्ताओं को न्योता भेजा जा सकता है. इसके लिए, आपको यह जानने की ज़रूरत नहीं है कि वे किस ईमेल पते का इस्तेमाल करना चाहते हैं. जब तक उपयोगकर्ता, एम्बेड किए गए टोकन वाले न्योते के यूआरएल पर क्लिक करते हैं, तब तक वे किसी भी ईमेल पते का इस्तेमाल करके, ऐक्सेस पाने के लिए साइन अप कर सकते हैं. इसके अलावा, कई उपयोगकर्ता इस यूआरएल का इस्तेमाल करके न्योता स्वीकार कर सकते हैं. इसलिए, यह यूआरएल एक उपयोगकर्ता या उपयोगकर्ताओं के ग्रुप को न्योता भेजने के लिए मददगार हो सकता है.
ध्यान दें: "invite" स्कोप, सिर्फ़ gdata के वर्शन 1.4 और इसके बाद के वर्शन में उपलब्ध है. अगर आपने साफ़ तौर पर 1.3 या इससे पहले का वर्शन चुना है, तो यह काम नहीं करेगा.
एसीएल फ़ीड को वापस लाया जा रहा है
एसीएल फ़ीड का इस्तेमाल, किसी साइट को शेयर करने की अनुमतियों को कंट्रोल करने के लिए किया जा सकता है. इसे इस यूआरआई के ज़रिए ऐक्सेस किया जा सकता है:
https://sites.google.com/feeds/acl/site/domainName/siteName
| फ़ीड पैरामीटर | ब्यौरा |
|---|---|
domainName | 'site' या G Suite पर होस्ट किए गए आपके डोमेन का डोमेन (उदाहरण के लिए, example.com). |
siteName | आपकी साइट का वेबस्पेस नाम.यह साइट के यूआरएल में मिलता है. उदाहरण के लिए, myCoolSite. |
ध्यान दें कि साइट फ़ीड की हर एंट्री में, इस फ़ीड का लिंक शामिल होता है:
<link rel="http://schemas.google.com/acl/2007#accessControlList" type="application/atom+xml"
href="https://sites.google.com/feeds/acl/site/domainName/siteName"/>
किसी साइट को शेयर करने की अनुमतियां पाने के लिए, एसीएल फ़ीड यूआरआई पर एचटीटीपी GET भेजें:
GET /feeds/acl/site/domainName/siteName HTTP/1.1 Host: sites.google.com GData-Version: 1.4 Authorization: <your authorization header here>
सर्वर, 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/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>
साइट शेयर करना
एसीएल फ़ीड में GET, POST, और PUT अनुरोध स्वीकार किए जाते हैं. एसीएल फ़ीड में नई भूमिका जोड़ने के लिए, साइट के एसीएल फ़ीड में POST अनुरोध भेजें.
ध्यान दें: शेयर करने के लिए कुछ एसीएल सिर्फ़ तब इस्तेमाल किए जा सकते हैं, जब डोमेन को ऐसी अनुमतियों की अनुमति देने के लिए कॉन्फ़िगर किया गया हो. उदाहरण के लिए, अगर G Suite डोमेन के लिए, डोमेन से बाहर शेयर करने की सुविधा चालू है, तो.
इस उदाहरण में, साइट पर एक नया सहयोगी (लेखक) जोड़ा गया है:
POST /feeds/acl/site/domainName/siteName HTTP/1.1 Host: sites.google.com GData-Version: 1.4 Authorization: <your authorization header here> <entry xmlns="http://www.w3.org/2005/Atom" xmlns:gAcl='http://schemas.google.com/acl/2007'> <category scheme='http://schemas.google.com/g/2005#kind' term='http://schemas.google.com/acl/2007#accessRule'/> <gAcl:role value='writer'/> <gAcl:scope type='user' value='new_writer@example.com'/> </entry>
एंट्री सही तरीके से शामिल होने पर, 201 Created और नई एंट्री दिखती है:
<entry> <id>https://sites.google.com/feeds/acl/site/domainName/siteName/user%3Anew_writer%40example.com</id> <updated>2009-12-03T22:01:05.963Z</updated> <app:edited xmlns:app="http://www.w3.org/2007/app">2009-12-03T22:01:05.963Z</app:edited> <category scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/acl/2007#accessRule"/> <link rel="self" type="application/atom+xml" href="https://sites.google.com/feeds/acl/site/domainName/siteName/user%3Anew_writer%40example.com"/> <link rel="edit" type="application/atom+xml" href="https://sites.google.com/feeds/acl/site/domainName/siteName/user%3Anew_writer%40example.com"/> <gAcl:role value='writer'/> <gAcl:scope type='user' value='new_writer@example.com'/> </entry>
"न्योता" स्कोप का इस्तेमाल करके उपयोगकर्ताओं को न्योता भेजना
अगर आपने ऐसे उपयोगकर्ताओं को जोड़ा है जिनके पास Google खाते नहीं हैं, तो एपीआई एक यूआरएल दिखाता है. आपको यह यूआरएल उन उपयोगकर्ताओं को देना होगा जिन्हें आपको न्योता भेजना है. यूआरएल पर क्लिक करने के बाद, वे अपने मौजूदा खाते से साइन इन करके या नया खाता बनाकर, साइट को ऐक्सेस कर पाएंगे.
न्योता भेजने के बाद, 201 Created और एक नई एंट्री दिखती है. इसमें वह यूआरएल शामिल होता है जिसे आपको उपयोगकर्ता को भेजना होता है:
<entry> <id>https://sites.google.com/feeds/acl/site/domainName/siteName/user%3Anew_invite%40example.com</id> <updated>2009-12-03T22:01:05.963Z</updated> <app:edited xmlns:app="http://www.w3.org/2007/app">2009-12-03T22:01:05.963Z</app:edited> <category scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/acl/2007#accessRule"/> <link rel="http://schemas.google.com/sites/2008#invite" type="text/html"href="domainName/siteName?invite=inviteToken"/> <link rel="self" type="application/atom+xml" href="https://sites.google.com/feeds/acl/site/domainName/siteName/user%3Anew_invite%40example.com"/> <link rel="edit" type="application/atom+xml" href="https://sites.google.com/feeds/acl/site/domainName/siteName/user%3Anew_invite%40example.com"/> <gAcl:role value='writer'/> <gAcl:scope type='invite' value='new_invite%40example.com'/> </entry>
ग्रुप और डोमेन लेवल पर शेयर करना
किसी एक उपयोगकर्ता के साथ साइट शेयर करने की तरह ही, किसी Google ग्रुप या G Suite डोमेन के साथ भी साइट शेयर की जा सकती है. ज़रूरी scope वैल्यू यहां दी गई हैं.
किसी ग्रुप के ईमेल पते पर शेयर करना:
<gAcl:scope type="group" value="group@example.com"/>
पूरे डोमेन के साथ शेयर करना:
<gAcl:scope type="domain" value="example.com"/>
डोमेन लेवल पर शेयर करने की सुविधा, सिर्फ़ G Suite डोमेन के लिए उपलब्ध है. साथ ही, यह सिर्फ़ उस डोमेन के लिए उपलब्ध है जिस पर साइट को होस्ट किया गया है. उदाहरण के लिए, http://sites.google.com/a/domain1.com/siteA, पूरी साइट को सिर्फ़ domain1.com के साथ शेयर कर सकती है, domain2.com के साथ नहीं. G Suite डोमेन पर होस्ट नहीं की गई साइटें, डोमेन को न्योता नहीं भेज सकतीं. जैसे, http://sites.google.com/site/siteB.
शेयर करने की अनुमतियों में बदलाव करना
एसीएल एंट्री को अपडेट करने के लिए, ज़रूरत के मुताबिक एंट्री में बदलाव करें. इसके बाद, एंट्री के edit लिंक पर एचटीटीपी PUT अनुरोध भेजें. यह लिंक, <link> एलिमेंट होता है. इसका 'rel' एट्रिब्यूट, 'edit' पर सेट होता है. पिछले उदाहरण के लिए, यह लिंक है:
<link rel='edit' type='application/atom+xml'
href='https://sites.google.com/feeds/acl/site/domainName/siteName/user%3Anew_writer%40example.com'/>नीचे दिया गया स्निपेट, new_writer@gmail.com की भूमिका को 'रीडर' में बदल देता है:
PUT /feeds/acl/site/domainName/siteName/user%3Anew_writer%40example.com HTTP/1.1 Host: sites.google.com GData-Version: 1.4 Authorization: <your authorization header here> <entry xmlns="http://www.w3.org/2005/Atom" xmlns:gAcl='http://schemas.google.com/acl/2007'> <category scheme='http://schemas.google.com/g/2005#kind' term='http://schemas.google.com/acl/2007#accessRule'/> <gAcl:role value='reader'/> <gAcl:scope type='user' value='new_writer@gmail.com'/> </entry>
शेयर करने की अनुमतियां हटाना
इस उपयोगकर्ता से अनुमतियां हटाने के लिए, उसी edit लिंक पर DELETE अनुरोध भेजें जिसका इस्तेमाल PUT अनुरोध के लिए किया गया था:
DELETE /feeds/acl/site/domainName/siteName/user%3Anew_writer%40example.com HTTP/1.1 Host: sites.google.com GData-Version: 1.4 Authorization: <your authorization header here>
सर्वर, 200 OK के साथ जवाब देगा.
खास विषय
फ़ीड या एंट्री को फिर से वापस पाना
अगर आपको कोई ऐसा फ़ीड या एंट्री वापस लानी है जिसे आपने पहले वापस लाया था, तो बेहतर तरीके से काम करने के लिए, सर्वर को सूची या एंट्री सिर्फ़ तब भेजने के लिए कहें, जब पिछली बार वापस लाने के बाद से उसमें बदलाव हुआ हो.
इस तरह से शर्त के आधार पर डेटा वापस पाने के लिए, एचटीटीपी GET अनुरोध भेजें. इसमें एचटीटीपी If-None-Match हेडर शामिल होना चाहिए. हेडर में, सूची या एंट्री का ई-टैग डालें. इसे <feed> एलिमेंट या <entry> एलिमेंट के gd:etag एट्रिब्यूट में देखा जा सकता है.
साइट फ़ीड का इस्तेमाल करने का उदाहरण:
GET /feeds/site/domainName/myOtherTestSite/ GData-Version: 1.4 If-None-Match: W/"Ck8GQXk7fil7ImA9WxNSFk0."
जब सर्वर को यह अनुरोध मिलता है, तो वह यह जांच करता है कि आपने जिस आइटम का अनुरोध किया है उसका ई-टैग, आपके बताए गए ई-टैग से मेल खाता है या नहीं. अगर ई-टैग मैच होते हैं, तो इसका मतलब है कि आइटम में कोई बदलाव नहीं हुआ है. ऐसे में, सर्वर एचटीटीपी 304 Not Modified स्टेटस कोड या एचटीटीपी 412 Precodition Failed स्टेटस कोड दिखाता है. इन दोनों स्टेटस कोड से पता चलता है कि आपने जो आइटम पहले ही वापस पा लिया है वह अप-टू-डेट है.
अगर ई-टैग मैच नहीं होते हैं, तो इसका मतलब है कि पिछली बार अनुरोध किए जाने के बाद से, आइटम में बदलाव किया गया है. ऐसे में, सर्वर आइटम को दिखाता है.
ई-टैग के बारे में ज़्यादा जानने के लिए, Google Data APIs की रेफ़रंस गाइड देखें.
बैच प्रोसेसिंग
बैच में अनुरोध करने की सुविधा से, आपके क्लाइंट को एक ही अनुरोध में कई कार्रवाइयां करने की सुविधा मिलती है. इसके लिए, हर कार्रवाई को अलग-अलग सबमिट करने की ज़रूरत नहीं पड़ती.
सर्वर, अनुरोध किए गए ज़्यादा से ज़्यादा बदलावों को लागू करेगा और स्टेटस की जानकारी दिखाएगा. इसका इस्तेमाल करके, यह आकलन किया जा सकता है कि हर कार्रवाई सफल हुई या नहीं. Google Data API में बैच प्रोसेसिंग के बारे में ज़्यादा जानने के लिए, Google Data API के साथ बैच प्रोसेसिंग देखें
बैच फ़ीड में मौजूद हर कार्रवाई में <id> एलिमेंट होता है. हालांकि, इंसर्ट करने की कार्रवाइयों में यह एलिमेंट नहीं होता.
यह एलिमेंट, उस अनुरोध यूआरएल की तरह ही होता है जिसका इस्तेमाल आम तौर पर कॉन्टेंट फ़ीड को अपडेट करने, मिटाने या क्वेरी करने के लिए किया जाता है.
उदाहरण के लिए, अगर आपको किसी बदलाव को अपडेट करना है, तो <id> को उस एंट्री के edit लिंक पर सेट करें जिसमें बदलाव करना है.
इसका इस्तेमाल, टारगेट एंट्री की पहचान करने के लिए किया जाता है. नई एंट्री में <id> एलिमेंट नहीं होते, क्योंकि उन्हें अब तक नहीं बनाया गया है. इसके बजाय, <batch:id> में स्ट्रिंग वैल्यू तय की जा सकती है. यह वैल्यू, सर्वर के जवाब में दिखेगी और इसका इस्तेमाल, उससे जुड़ी एंट्री को खोजने के लिए किया जाएगा.
बैच अनुरोध करने के लिए, बैच फ़ीड बनाएं और फ़ीड के बैच लिंक पर एचटीटीपी POST भेजें:
<link rel="http://schemas.google.com/g/2005#batch" type="application/atom+xml"
href="https://sites.google.com/feeds/content/site/siteName/batch"/>
यहां दिए गए उदाहरण में, वेबपेज की एंट्री के बारे में क्वेरी करने, उसे शामिल करने, अपडेट करने, और मिटाने का तरीका बताया गया है:
POST /feeds/content/site/siteName/batch HTTP/1.1 Host: sites.google.com Accept: */* If-Match: * GData-Version: 1.4 Authorization: <your authorization header here> <feed xmlns="http://www.w3.org/2005/Atom" xmlns:sites="http://schemas.google.com/sites/2008" xmlns:gd="http://schemas.google.com/g/2005" xmlns:batch='http://schemas.google.com/gdata/batch'> <entry> <id>https://sites.google.com/feeds/content/site/siteName/ENTRY_ID1</id> <batch:operation type="query"/> </entry> <entry> <batch:id>1</batch:id> <batch:operation type='insert'/> <category scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/sites/2008#webpage" label="webpage"/> <title>New Webpage1</title> <content type="xhtml"> <div xmlns="http://www.w3.org/1999/xhtml">HTML body goes here</div> </content> </entry> <entry gd:etag=""YDgpeyI.""> <id>https://sites.google.com/feeds/content/site/siteName/ENTRY_ID2</id> <batch:operation type='update'/> <category scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/sites/2008#webpage" label="webpage"/> <title>Updated Title for Webpage2</title> ... <batch:operaation type="update"/> </entry> <entry gd:etag=""YassseyI.""> <id>https://sites.google.com/feeds/content/site/siteName/ENTRY_ID3</id> <batch:operation type='delete'/> </entry> </feed>
वापस किए गए फ़ीड में, हर कार्रवाई के लिए एक नतीजा शामिल होगा:
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/"
xmlns:sites="http://schemas.google.com/sites/2008" xmlns:gs="http://schemas.google.com/spreadsheets/2006"
xmlns:dc="http://purl.org/dc/terms" xmlns:batch="http://schemas.google.com/gdata/batch"
xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0">
<id>https://sites.google.com/feeds/content/site/siteName/ENTRY_ID1</id>
<updated>2009-11-10T22:44:08.369Z</updated>
<title>Batch Feed</title>
<entry gd:etag=""YDgpsdfeyI."">
<id>https://sites.google.com/feeds/content/site/siteName/ENTRY_ID1</id>
<published>2009-08-31T04:42:45.251Z</published>
<updated>2009-10-25T22:46:13.729Z</updated>
<app:edited xmlns:app="http://www.w3.org/2007/app">2009-10-25T22:46:13.671Z</app:edited>
<category scheme="http://schemas.google.com/g/2005#kind"
term="http://schemas.google.com/sites/2008#webpage" label="webpage"/>
<title>Page Title</title>
...
<batch:status code="200" reason="Success"/>
<batch:operation type="query"/>
</entry>
<entry gd:etag=""YDsseyI."">
<id>https://sites.google.com/feeds/content/site/siteName/ENTRY_ID4</id>
<published>2009-11-10T22:44:08.531Z</published>
<updated>2009-11-10T22:44:08.560Z</updated>
<app:edited xmlns:app="http://www.w3.org/2007/app">2009-11-10T22:44:08.531Z</app:edited>
<category scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/sites/2008#webpage" label="webpage"/>
<title>New Webpage1</title>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<table cellspacing="0" class="sites-layout-name-one-column sites-layout-hbox">
<tbody>
<tr>
<td class="sites-layout-tile sites-tile-name-content-1">
<div>HTML body goes here</div>
</td>
</tr>
</tbody>
</table>
</div>
</content>
...
<batch:id>1</batch:id>
<batch:status code="201" reason="Created"/>
<batch:operation type="insert"/>
</entry>
<entry gd:etag=""YDkpeyI."">
<id>https://sites.google.com/feeds/content/site/siteName/ENTRY_ID2</id>
<updated>2009-11-10T22:44:09.296Z</updated>
<title>Updated Title for Webpage2</title>
...
<sites:pageName>updated-title-for-webpage2</sites:pageName>
<sites:revision>5</sites:revision>
<batch:status code="200" reason="Success"/>
<batch:operation type="update"/>
</entry>
<entry>
<id>https://sites.google.com/feeds/content/site/siteName/ENTRY_ID3</id>
<title>Deleted</title>
<content>Deleted</content>
<batch:status code="200" reason="Success"/>
<batch:operation type="delete"/>
</entry>
</feed>