تنظيم صفحاتك في مجموعات
يمكنك حفظ المحتوى وتصنيفه حسب إعداداتك المفضّلة.
تتألف واجهة برمجة التطبيقات "النشاط في Google Drive" من مورد
DriveActivity يمثّل التغييرات التي تم إجراؤها على العناصر داخل حساب Google Drive الخاص بأحد المستخدمين، ومن طريقة
activity.query تتيح لك استرداد معلومات حول هذه التغييرات.
طلب
يطلب تطبيقك بيانات نشاط المستخدم باستخدام طريقة
activity.query. يمكنك طلب سجلّ النشاط
إما لعنصر معيّن في Drive أو لكل المحتوى ضمن مجلد في Drive. بالنسبة إلى طلب معيّن، يمكنك اختيار حصر الردود من خلال قيود مثل النطاق الزمني أو نوع الإجراء، ويمكنك اختيار دمج النشاط في الرد. لمزيد من المعلومات، يُرجى الاطّلاع على تقديم الطلبات في Drive Activity API.
الردّ
الردّ على الطلب هو قائمة بالأنشطة التي تتطابق مع المَعلمات المحدّدة، حيث يمثّل المرجع DriveActivity كل نشاط:
يحتوي مورد DriveActivity أيضًا على معلومات موجزة، مثل كل Actor وTarget من جميع الإجراءات، وTimestamp أو TimeRange موحّدَين، وActionDetail الأكثر أهمية أو تمثيلاً Action.
قد لا يتم تسجيل بعض الأنشطة على Drive عند استخدام واجهة برمجة التطبيقات هذه. تعتمد إمكانية إبلاغ واجهة برمجة التطبيقات Drive Activity API عن تغيير معيّن في أحد العناصر على ما إذا كان التغيير أو المعلومات المتعلقة به مرئية للمستخدم الذي تمّت مصادقته في تطبيقك.
تستند إمكانية الوصول إلى الأذونات التي تم ضبطها للعنصر. هناك عدة سيناريوهات تتم فيها مشاركة الملفات والمجلدات في Drive، وهي:
إذا شارك مؤلف مستندًا، سيكون سجلّ النشاط الخاص بالمستند مرئيًا ليس فقط للمنشئ، بل أيضًا للمستخدمين الذين تم إثبات هويتهم وتمت مشاركة المستند معهم.
إذا تمت مشاركة مستند مع مستخدم ثم تم ضبطه على "خاص"، يمكن للمستخدم الذي تم إثبات هويته الاطّلاع على سجلّ النشاط الكامل أثناء توفّر إذن الوصول، كما يمكنه الاطّلاع على أنّ الأذونات أصبحت الآن محدودة.
إذا لم تتم مشاركة مستند مع مستخدم أبدًا، لن يتمكّن المستخدم من الاطّلاع على أي سجلّ للأنشطة.
تاريخ التعديل الأخير: 2025-08-04 (حسب التوقيت العالمي المتفَّق عليه)
[[["يسهُل فهم المحتوى.","easyToUnderstand","thumb-up"],["ساعَدني المحتوى في حلّ مشكلتي.","solvedMyProblem","thumb-up"],["غير ذلك","otherUp","thumb-up"]],[["لا يحتوي على المعلومات التي أحتاج إليها.","missingTheInformationINeed","thumb-down"],["الخطوات معقدة للغاية / كثيرة جدًا.","tooComplicatedTooManySteps","thumb-down"],["المحتوى قديم.","outOfDate","thumb-down"],["ثمة مشكلة في الترجمة.","translationIssue","thumb-down"],["مشكلة في العيّنات / التعليمات البرمجية","samplesCodeIssue","thumb-down"],["غير ذلك","otherDown","thumb-down"]],["تاريخ التعديل الأخير: 2025-08-04 (حسب التوقيت العالمي المتفَّق عليه)"],[],[],null,["# Introduction to Google Drive Activity API\n\nThe Google Drive Activity API consists of the\n[`DriveActivity`](/workspace/drive/activity/v2/reference/rest/v2/activity/driveactivity) resource, which\nrepresents changes made to objects within a user's Google Drive, and the\n[`activity.query`](/workspace/drive/activity/v2/reference/rest/v2/activity/query) method, which allows you to retrieve\ninformation about those changes.\n\nRequest\n-------\n\nYour app requests a user's activity data using the\n[`activity.query`](/workspace/drive/activity/v2/reference/rest/v2/activity/query) method. You can request activity\neither for a specific Drive item or for everything contained under a Drive\nfolder. For a given request, you can choose to restrict the response by\n[constraints](/workspace/drive/activity/v2/requests#filters) such as time range or action type, and you\ncan choose to have the activity [consolidated](/workspace/drive/activity/v2/requests#consolidation) in the\nresponse. For more information, see [Make requests in the Drive Activity API](/workspace/drive/activity/v2/requests).\n\nResponse\n--------\n\nThe response to a request is a list of activities matching the given parameters,\nwhere a\n[`DriveActivity`](/workspace/drive/activity/v2/reference/rest/v2/activity/driveactivity) resource represents each activity:\n\nA [`DriveActivity`](/workspace/drive/activity/v2/reference/rest/v2/activity/driveactivity) resource is a collection of\n[`Action`](/workspace/drive/activity/v2/reference/rest/v2/activity/action) objects, each of which is\nself-contained like an *event* . An `Action` includes an\n[`ActionDetail`](/workspace/drive/activity/v2/reference/rest/v2/activity/actiondetail) (such as `Create`\nor `Edit`), an [`Actor`](/workspace/drive/activity/v2/reference/rest/v2/activity/actor) (such as `User`\nor `Administrator`), a [`Target`](/workspace/drive/activity/v2/reference/rest/v2/activity/target) (such\nas `DriveItem` or `Drive`), and either a\n[`Timestamp`](/protocol-buffers/docs/reference/google.protobuf#google.protobuf.Timestamp)\nor [`TimeRange`](/workspace/drive/activity/v2/reference/rest/v2/activity/timerange).\n\nA `DriveActivity` resource also contains\nsummary information, such as every\n`Actor` and\n`Target` from all the actions, a unified\n`Timestamp`\nor `TimeRange`, and either the most\nimportant or representative\n`ActionDetail` of the\n`Action`.\n\nFor more information, see the [Drive Activity API data model](/workspace/drive/activity/v2/datamodel).\n\nActivity history visibility\n---------------------------\n\nSome activity on Drive may not be reported when you use this API. Whether the\nDrive Activity API reports a given change to an object depends on whether\nthe change, or information about the change, is visible to the authenticated\nuser in your application.\n\nVisibility is based on the permissions set for the object. There's several\nscenarios when files and folders are shared in Drive:\n\n- If an author shares a document, the activity history for the document is visible to not only the creator, but also to the authenticated users with whom it was shared.\n- If a document was shared with a user and then made private, the authenticated user can see all activity history while they had access and that the permissions are now restricted.\n- If a document was never shared with a user, the user can't see any activity history.\n\nGet started\n-----------\n\nTo get the most out of the Drive Activity API, integrate your app with the\n[Google Drive API](/workspace/drive/api) first. To get started with the Drive Activity API,\nlearn how to [create a project](/workspace/drive/activity/v2/guides/project) and\n[authorize requests](/workspace/guides/configure-oauth-consent). Or, dive right in and read\nabout activities in the\n[API reference](/workspace/drive/activity/v2/reference/rest/v2/activity)."]]