مثال ساده بازیابی فیدهای JSON از API داده های صفحه گسترده
با مجموعهها، منظم بمانید
ذخیره و طبقهبندی محتوا براساس اولویتهای شما.
اخطار : این صفحه درباره APIهای قدیمی Google، Google Data APIها است. فقط مربوط به APIهایی است که در فهرست راهنمای Google Data APIs فهرست شده اند، که بسیاری از آنها با APIهای جدیدتر جایگزین شده اند. برای اطلاعات در مورد یک API جدید خاص، به مستندات API جدید مراجعه کنید. برای اطلاعات در مورد تأیید درخواستها با یک API جدیدتر، به تأیید اعتبار و مجوز حسابهای Google مراجعه کنید.
معرفی
این نمونه نمایش یک لیست یا فید سلولی برای یک کاربرگ خاص را در یک صفحه گسترده با استفاده از فرمت خروجی JSON ارائه شده توسط Spreadsheets Data API نشان می دهد. این به شما امکان میدهد فهرست عمومی صفحهگسترده یا فید سلولی را جستجو کنید و ورودیهای حاصل را بهعنوان اشیاء JSON برگردانید. برای استفاده از فید جدید JSON، یک عنصر اسکریپت ایجاد کنید که مقدار src
آن باشد
http://spreadsheets.google.com/feeds/ feed / key / worksheet /public/basic?alt=json-in-script&callback= myFunc
که در آن feed
نوع فید است، key
کلید صفحهگستردهای است که میخواهید بازیابی کنید، worksheet
شناسه موقعیتی یا منحصربهفرد کاربرگ است، و myFunc
نام تابع تماس شماست که شی JSON ارسال میشود. برای اطلاعات بیشتر در مورد پشتیبانی خروجی JSON برای APIهای Google Data لطفاً به مستندات پشتیبانی خروجی JSON ما مراجعه کنید.
توجه: بازیابی فید بدون احراز هویت فقط برای صفحات گسترده منتشر شده پشتیبانی می شود.
توجه: سایر انواع فید و مقادیر دید و نمایش ممکن است با پشتیبانی از خروجی JSON استفاده شوند. برای اطلاعات بیشتر در مورد سایر انواع فید، و مقادیر قابل مشاهده و طرح ریزی، لطفاً به اسناد API داده های صفحات گسترده مراجعه کنید.
جز در مواردی که غیر از این ذکر شده باشد،محتوای این صفحه تحت مجوز Creative Commons Attribution 4.0 License است. نمونه کدها نیز دارای مجوز Apache 2.0 License است. برای اطلاع از جزئیات، به خطمشیهای سایت Google Developers مراجعه کنید. جاوا علامت تجاری ثبتشده Oracle و/یا شرکتهای وابسته به آن است.
تاریخ آخرین بهروزرسانی 2023-03-01 بهوقت ساعت هماهنگ جهانی.
[null,null,["تاریخ آخرین بهروزرسانی 2023-03-01 بهوقت ساعت هماهنگ جهانی."],[],[],null,["# Simple example of retrieving JSON feeds from Spreadsheets Data API\n\n**Warning** : This page is about Google's older APIs, the Google Data APIs; it's relevant only to the APIs that are listed in the [Google Data APIs directory](/gdata/docs/directory), many of which have been replaced with newer APIs. For information about a specific new API, see the new API's documentation. For information about authorizing requests with a newer API, see [Google Accounts Authentication and Authorization](/accounts).\n| Version v4 of the [Google Sheets API](/sheets) is now available! This [migration guide](/sheets/guides/migration) shows how to update applications to use v4.\n\n### Introduction\n\nThis sample demonstrates displaying a list or cells feed for a particular worksheet in a spreadsheet using the JSON output format provided by the Spreadsheets Data API. This allows you to query a spreadsheet's public list or cell feed and get the resulting entries returned as JSON objects. To use the new JSON feed, create a script element whose `src` value is\n\u003e `http://spreadsheets.google.com/feeds/`**feed** `/`**key** `/`**worksheet** `/public/basic?alt=json-in-script&callback=`**myFunc**\n\nwhere **`feed`** is the type of feed, **`key`** is the key of the spreadsheet you want to retrieve, the **`worksheet`** is the positional or unique identifier of the worksheet, and **`myFunc`** is the name of your callback function that is passed the JSON object. For more information on JSON output support for Google Data APIs please see our [JSON output support documentation](/gdata/json).\n\n**Note:** Retrieving a feed without authentication is only supported for published spreadsheets.\n\n**Note:** Other feed types and visibility and projection values may be used with JSON output support. For more information on other feed types, and visibility and projection values please see the [Spreadsheets Data API](/google-apps/spreadsheets) documentation.\n\n### Demo\n\nSpreadsheet: http://spreadsheets.google.com/feeds/ list cells / / /public/values OK"]]