الحدود والحصص
تنظيم صفحاتك في مجموعات
يمكنك حفظ المحتوى وتصنيفه حسب إعداداتك المفضّلة.
تعمل الحدود والحصص على حماية بنية Google الأساسية من عملية تلقائية تستخدم Reports API بطريقة غير ملائمة. وقد تنتج الطلبات المفرطة من واجهة برمجة التطبيقات عن خطأ إملائي غير مؤذٍ، أو قد تنتج عن نظام مصمّم بشكل غير فعال يجعل طلبات البيانات من واجهة برمجة التطبيقات غير ضرورية. وبغض النظر عن السبب، من الضروري حظر الزيارات من مصدر معيَّن بمجرد وصوله إلى مستوى معيَّن لكي نحافظ على سلامة نظام Google Workspace بشكل عام. ويضمن هذا الإجراء عدم إمكانية تأثير إجراءات أحد مطوّري البرامج سلبًا في المنتدى الأكبر.
في حال فشل طلب واجهة برمجة التطبيقات، وهو أمر مستبعد، ستتلقى استجابة رمز حالة HTTP. يحتوي رمز الحالة 403 على معلومات خطأ حول الإدخال غير الصحيح، ورمز حالة HTTP 503 يتضمن معلومات خطأ تشير إلى حصص واجهة برمجة التطبيقات التي تم تجاوزها. تتيح هذه الاستجابات للتطبيق المخصّص رصد هذه الأخطاء واتّخاذ الإجراء المناسب.
إذا كانت هناك حاجة إلى إكمال طلباتك خلال فترة زمنية محددة، أرسِل طلباتك بالتوازي أو استخدِم سلاسل محادثات متعددة في تطبيق Java أو C#. من أمثلة الطلبات الموازية طلب دفعات صغيرة من رسائل البريد الإلكتروني من مستخدمين مختلفين بدلاً من إضافة الكثير من رسائل البريد الإلكتروني أو إزالتها من مستخدم واحد في وقت واحد. بالنسبة إلى سلاسل المحادثات، جرِّب البدء بـ 10 سلاسل محادثات، مع سلسلة محادثات واحدة لكل عنوان بريد إلكتروني للمستخدم. يُرجى العلم أنّ اقتراح سلسلة المحادثات ينطوي على حلول وسط، وهو ليس مفيدًا في جميع حالات واجهات برمجة التطبيقات. وفي حال كان عدد الطلبات مرتفعًا جدًا، ستحدث أخطاء في الحصة.
بالنسبة إلى جميع الأخطاء التي تستند إلى الوقت (الحد الأقصى N من الأشياء لمدة N ثانية لكل سلسلة محادثات)، وخاصةً أخطاء رمز الحالة 503، ننصح بالرمز الذي يتضمّن استثناءً، وباستخدام خوارزمية التراجع الأسّي، يجب الانتظار قليلاً قبل إعادة محاولة الاتصال الذي تعذّر إكماله. من أمثلة Reports API لسلسلة محادثات واحدة، ما عليك سوى الانتظار لمدة 5 ثوانٍ ثم إعادة محاولة إجراء الاتصال الذي تعذّر تنفيذه. إذا نجح الطلب، كرِّر هذا النمط لسلاسل المحادثات الأخرى. وإذا لم ينجح الطلب الثاني، فينبغي لتطبيقك تقليل معدل تكرار الطلب حتى يتم الاستدعاء بنجاح. على سبيل المثال، يمكنك زيادة التأخير الأولي الذي يبلغ 5 ثوانٍ إلى 10 ثوانٍ، ثم أعِد محاولة إجراء المكالمة التي تعذّر إجراؤها مرة أخرى. كما يمكنك تحديد حد إعادة المحاولة. على سبيل المثال، يمكنك إعادة محاولة تقديم طلب من 5 إلى 7 مرات بأوقات تأخير مختلفة قبل أن يعرض التطبيق خطأ للمستخدم.
فئات الحد الأقصى المسموح به من واجهة برمجة التطبيقات |
الحدود القصوى المسموح بها |
إعداد تقارير عن معدّلات QPS وQPD |
تفرض واجهة برمجة التطبيقات قيودًا على عدد الطلبات الخاصة بمشروعك على Google Cloud.
القيمة التلقائية التي تم ضبطها في Google Cloud Console هي 2,400 طلب بحث في الدقيقة لكل مستخدم لكل مشروع على Google Cloud.
يمكنك زيادة هذا الحد من صفحة حصص واجهة برمجة التطبيقات لـ SDK للمشرف في مشروعك على Google Cloud.
وإذا تم تجاوز هذه الحدود، يعرض الخادم رمز الحالة HTTP 503. يمكنك استخدام خوارزمية التراجع الأسي عند إعادة محاولة تنفيذ طلباتك.
|
فئات حصص واجهة برمجة التطبيقات |
الحصص |
الحد الأقصى للنتائج |
يتراوح عدد السجلات المعروضة في كل صفحة من استجابة واجهة برمجة التطبيقات من حدث واحد إلى 1000 حدث. القيمة التلقائية هي 1000 سجلّ.
|
أنواع أخرى من الحدود |
القيود والإرشادات |
تنسيق البيانات، تلقائي |
تنسيق البيانات التلقائي هو JSON. تدعم واجهة برمجة التطبيقات أيضًا تنسيق Atom.
|
الطلبات غير المصرّح بها |
ولا تسمح Google بالطلبات غير المصرّح بها لواجهة برمجة التطبيقات. يُعتبَر الطلب غير مُصرَّح به في حال عدم تقديم رمز مميّز للتفويض. وللحصول على مزيد من المعلومات، يُرجى الاطّلاع على قسم السماح بالطلبات.
|
رسائل التحذير |
- البيانات غير متوفرة: إنّ البيانات الخاصة بهذا التطبيق وذلك لهذا التاريخ غير متاحة، ولن تكون متاحة في المستقبل.
- تتوفّر بيانات جزئية: قد تتوفّر بيانات هذا التطبيق وهذا التاريخ في المستقبل.
للتعرّف على بنية التحذير في Reports API، يمكنك الاطّلاع على مرجع واجهة برمجة التطبيقات الخاص بالعملاء والمستخدمين.
|
إنّ محتوى هذه الصفحة مرخّص بموجب ترخيص Creative Commons Attribution 4.0 ما لم يُنصّ على خلاف ذلك، ونماذج الرموز مرخّصة بموجب ترخيص Apache 2.0. للاطّلاع على التفاصيل، يُرجى مراجعة سياسات موقع Google Developers. إنّ Java هي علامة تجارية مسجَّلة لشركة Oracle و/أو شركائها التابعين.
تاريخ التعديل الأخير: 2025-03-25 (حسب التوقيت العالمي المتفَّق عليه)
[null,null,["تاريخ التعديل الأخير: 2025-03-25 (حسب التوقيت العالمي المتفَّق عليه)"],[],[],null,["# Limits and Quotas\n\nLimits and quotas protect the Google infrastructure from an automated process that uses the Reports API in an inappropriate way. Excessive requests from an API might result from a harmless typo, or might result from an inefficiently designed system that makes needless API calls. Regardless of the cause, blocking traffic from a specific source once it reaches a certain level is necessary for the overall health of the Google Workspace system. It ensures that one developer's actions cannot negatively impact the larger community.\n\nIn the unlikely event that your API request fails, you'll receive an HTTP status code response. A status code of 403 has error information about incorrect input and an HTTP status code of 503 has error information indicating which API quotas have been exceeded. These responses allow your custom application to detect these errors and take appropriate action.\n\nIf your requests need to be completed in a fixed period of time, send your requests in parallel or use multiple threads in your Java or C# application. An example of parallel requests is requesting small batches of emails from different users rather than adding or removing lots of emails from one user simultaneously. In the case of threads, try starting with 10 threads, one thread per user email. Note, the thread recommendation has trade-offs and is not useful for all API situations. If the number of requests gets too high, quota errors will occur.\n\nFor all errors that are time based (maximum of \u003cvar translate=\"no\"\u003eN\u003c/var\u003e things for \u003cvar translate=\"no\"\u003eN\u003c/var\u003e seconds per thread), especially the 503 status code errors, we recommend your code catch the exception and, using an [exponential backoff](http://wikipedia.org/wiki/Truncated_binary_exponential_backoff) algorithm, wait for a small delay before retrying the failed call. A Reports API example for one thread is to wait 5 seconds and retry the failed call. If the request is successful, repeat this pattern for the other threads. If the second request is not successful, your application should scale back on the frequency of the request until a call is successful. For example, increase the initial 5 second delay to 10 seconds and retry your failed call again. Also, decide on a retry limit. For example retry a request 5 to 7 times with different delay times before your application returns an error to the user.\n\n| API Limit Categories | Limits |\n|--------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Report QPS and QPD rates | The API limits the number of requests for your Google Cloud project. The default value set in the Google Cloud console is 2,400 queries per minute per user per Google Cloud project. You can increase this limit from the [Admin SDK API Quotas page](https://console.cloud.google.com/apis/api/admin.googleapis.com/quotas) of your Google Cloud project. If these limits are exceeded, the server returns an HTTP 503 status code. Use the [exponential backoff](http://wikipedia.org/wiki/Truncated_binary_exponential_backoff) algorithm when retrying your requests. |\n| maxResults | The number of records listed in each page of an API's response is from 1 to 1000 events. The default is 1000 records. |\n\n\n| Other Types of Limits | Limitations and Guidelines |\n|-----------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Data format, default | The default data format is JSON. The API also supports the Atom format. |\n| Unauthorized requests | Google does not allow unauthorized requests to the API. A request is considered unauthorized if no authorization token is provided. For more information, see [Authorizing requests](/workspace/admin/reports/v1/guides/authorizing). |\n| Warning messages | - Data not available: The data for this application and for this date is not available and will not be available in the future. - Partial data available: The data for this application and for this date may be available in the future. For the Reports API's warning syntax, see the API Reference for [customers](/workspace/admin/reports/v1/reference/customerUsageReports/get) and for [users](/workspace/admin/reports/v1/reference/userUsageReport/get). |"]]