Method: spreadsheets.sheets.copyTo
یک صفحه را از یک صفحه گسترده به صفحه گسترده دیگر کپی می کند. ویژگی های برگه جدید ایجاد شده را برمی گرداند.
درخواست HTTP
POST https://sheets.googleapis.com/v4/spreadsheets/{spreadsheetId}/sheets/{sheetId}:copyTo
URL از دستور GRPC Transcoding استفاده می کند.
پارامترهای مسیر
پارامترها |
---|
spreadsheetId | string شناسه صفحه گسترده حاوی برگه برای کپی کردن. |
sheetId | integer شناسه برگه برای کپی کردن. |
درخواست بدن
بدنه درخواست حاوی داده هایی با ساختار زیر است:
نمایندگی JSON |
---|
{
"destinationSpreadsheetId": string
} |
فیلدها |
---|
destinationSpreadsheetId | string شناسه صفحه گسترده برای کپی کردن صفحه. |
بدن پاسخگو
در صورت موفقیت آمیز بودن، بدنه پاسخ حاوی نمونه ای از SheetProperties
است.
محدوده مجوز
به یکی از حوزه های OAuth زیر نیاز دارد:
-
https://www.googleapis.com/auth/drive
-
https://www.googleapis.com/auth/drive.file
-
https://www.googleapis.com/auth/spreadsheets
برای اطلاعات بیشتر، به راهنمای مجوز مراجعه کنید.
جز در مواردی که غیر از این ذکر شده باشد،محتوای این صفحه تحت مجوز Creative Commons Attribution 4.0 License است. نمونه کدها نیز دارای مجوز Apache 2.0 License است. برای اطلاع از جزئیات، به خطمشیهای سایت Google Developers مراجعه کنید. جاوا علامت تجاری ثبتشده Oracle و/یا شرکتهای وابسته به آن است.
تاریخ آخرین بهروزرسانی 2024-10-25 بهوقت ساعت هماهنگ جهانی.
[null,null,["تاریخ آخرین بهروزرسانی 2024-10-25 بهوقت ساعت هماهنگ جهانی."],[[["Copies a single sheet from one Google Spreadsheet to another, returning the properties of the new sheet."],["Requires specifying the source spreadsheet and sheet IDs, along with the destination spreadsheet ID."],["Utilizes an HTTP POST request to `https://sheets.googleapis.com/v4/spreadsheets/{spreadsheetId}/sheets/{sheetId}:copyTo`."],["Needs authorization with specific OAuth scopes like `https://www.googleapis.com/auth/drive` or `https://www.googleapis.com/auth/spreadsheets`."]]],["This content describes how to copy a sheet from one spreadsheet to another using an HTTP POST request to the Google Sheets API. The request URL requires the source `spreadsheetId` and `sheetId`. The request body needs a `destinationSpreadsheetId`. Upon success, the API returns the new sheet's properties. Authorization requires one of three specific OAuth scopes: `drive`, `drive.file`, or `spreadsheets`. The `try it!` section is a resource to help understand how the API works.\n"]]