مثال بسيط لاسترداد خلاصات JSON من واجهة برمجة التطبيقات لبيانات جداول البيانات
تنظيم صفحاتك في مجموعات
يمكنك حفظ المحتوى وتصنيفه حسب إعداداتك المفضّلة.
تحذير: تتعلق هذه الصفحة بواجهات برمجة التطبيقات القديمة من Google، وهي واجهات برمجة التطبيقات لبيانات Google؛ وهي مرتبطة فقط بواجهات برمجة التطبيقات المدرجة في دليل Google Data APIs، والتي تم استبدال العديد منها بواجهات برمجة تطبيقات أحدث. للحصول على معلومات حول واجهة برمجة تطبيقات جديدة، اطلع على وثائق واجهة برمجة التطبيقات الجديدة. للحصول على معلومات حول تفويض الطلبات باستخدام واجهة برمجة تطبيقات أحدث، اطلع على مصادقة حسابات Google وتفويضها.
المقدمة
يوضح هذا النموذج عرض قائمة أو خلاصة خلايا لورقة عمل معينة في جدول بيانات باستخدام تنسيق مخرجات JSON الذي توفره واجهة برمجة التطبيقات لبيانات جداول البيانات. يتيح لك هذا الاستعلام عن القائمة العامة أو خلاصة الخلايا لجدول البيانات والحصول على الإدخالات الناتجة المعروضة ككائنات 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 لـ Google Data APIs، يُرجى الاطّلاع على مستندات دعم إخراج JSON.
ملاحظة: لا تتوفر إمكانية استرداد خلاصة بدون مصادقة إلا لجداول البيانات المنشورة.
ملاحظة: يمكن استخدام أنواع الخلاصات الأخرى وقيم مستوى الرؤية والإسقاط مع التوافق مع إخراج JSON. لمزيد من المعلومات حول أنواع الخلاصات الأخرى وقيم مستوى الرؤية والإسقاط، يُرجى الاطّلاع على وثائق واجهة برمجة التطبيقات لبيانات جداول البيانات.
إنّ محتوى هذه الصفحة مرخّص بموجب ترخيص Creative Commons Attribution 4.0 ما لم يُنصّ على خلاف ذلك، ونماذج الرموز مرخّصة بموجب ترخيص Apache 2.0. للاطّلاع على التفاصيل، يُرجى مراجعة سياسات موقع Google Developers. إنّ Java هي علامة تجارية مسجَّلة لشركة 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"]]