لتعديل محتوى مشروع النص البرمجي المحدّد يتم تخزين هذا المحتوى كإصدار رئيس، ويتم استخدامه عند تنفيذ النص البرمجي كمشغل في محرر النصوص البرمجية أو في وضع معاينة الإضافة أو كتطبيق ويب أو واجهة برمجة تطبيقات برمجة التطبيقات في وضع التطوير. يؤدي هذا إلى محو جميع الملفات الحالية في المشروع.
طلب HTTP
PUT https://script.googleapis.com/v1/projects/{scriptId}/content
قائمة ملفات مشروع النص البرمجي. أحد الملفات عبارة عن بيان نص برمجي؛ ويجب أن يكون اسمه "appsscript"، وأن يكون من النوع JSON، وأن يتضمّن إعدادات البيان الخاصة بالمشروع.
نص الاستجابة
إذا كانت الاستجابة ناجحة، يحتوي نص الاستجابة على مثال Content.
تاريخ التعديل الأخير: 2025-07-26 (حسب التوقيت العالمي المتفَّق عليه)
[[["يسهُل فهم المحتوى.","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-07-26 (حسب التوقيت العالمي المتفَّق عليه)"],[[["\u003cp\u003eUpdates the content of a specified Apps Script project, replacing all existing files.\u003c/p\u003e\n"],["\u003cp\u003eRequires a \u003ccode\u003ePUT\u003c/code\u003e request to the specified endpoint with the script project's Drive ID.\u003c/p\u003e\n"],["\u003cp\u003eThe request body must contain a list of files, including a JSON manifest named "appsscript".\u003c/p\u003e\n"],["\u003cp\u003eA successful response returns the updated project content.\u003c/p\u003e\n"],["\u003cp\u003eRequires authorization with the \u003ccode\u003ehttps://www.googleapis.com/auth/script.projects\u003c/code\u003e scope.\u003c/p\u003e\n"]]],[],null,["- [HTTP request](#body.HTTP_TEMPLATE)\n- [Path parameters](#body.PATH_PARAMETERS)\n- [Request body](#body.request_body)\n - [JSON representation](#body.request_body.SCHEMA_REPRESENTATION)\n- [Response body](#body.response_body)\n- [Authorization Scopes](#body.aspect)\n- [Try it!](#try-it)\n\nUpdates the content of the specified script project. This content is stored as the HEAD version, and is used when the script is executed as a trigger, in the script editor, in add-on preview mode, or as a web app or Apps Script API in development mode. This clears all the existing files in the project.\n\nHTTP request\n\n`PUT https://script.googleapis.com/v1/projects/{scriptId}/content`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\nPath parameters\n\n| Parameters ||\n|------------|-----------------------------------------|\n| `scriptId` | `string` The script project's Drive ID. |\n\nRequest body\n\nThe request body contains data with the following structure:\n\n| JSON representation |\n|-------------------------------------------------------------------------------|\n| ``` { \"files\": [ { object (/apps-script/api/reference/rest/v1/File) } ] } ``` |\n\n| Fields ||\n|-----------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `files[]` | `object (`[File](/apps-script/api/reference/rest/v1/File)`)` The list of script project files. One of the files is a script manifest; it must be named \"appsscript\", must have type of JSON, and include the manifest configurations for the project. |\n\nResponse body\n\nIf successful, the response body contains an instance of [Content](/apps-script/api/reference/rest/v1/projects/getContent#body.Content).\n\nAuthorization Scopes\n\nRequires the following OAuth scope:\n\n- `https://www.googleapis.com/auth/script.projects`\n\nFor more information, see the [OAuth 2.0 Overview](https://developers.google.com/identity/protocols/OAuth2)."]]