Method: properties.insert
Thêm thuộc tính vào tệp hoặc cập nhật thuộc tính nếu đã tồn tại.
Yêu cầu HTTP
POST https://www.googleapis.com/drive/v2/files/{fileId}/properties
URL sử dụng cú pháp Chuyển mã gRPC.
Tham số đường dẫn
Các tham số |
fileId |
string
Mã của tệp.
|
Nội dung yêu cầu
Nội dung yêu cầu chứa một bản sao của Property
.
Nội dung phản hồi
Nếu thành công, nội dung phản hồi sẽ chứa một thực thể mới được tạo của Property
.
Phạm vi uỷ quyền
Yêu cầu một trong các phạm vi OAuth sau:
https://www.googleapis.com/auth/docs
https://www.googleapis.com/auth/drive
https://www.googleapis.com/auth/drive.appdata
https://www.googleapis.com/auth/drive.file
https://www.googleapis.com/auth/drive.metadata
Một số phạm vi bị hạn chế và cần phải được đánh giá bảo mật thì ứng dụng của bạn mới có thể sử dụng những phạm vi đó. Để biết thêm thông tin, hãy xem Hướng dẫn uỷ quyền.
Trừ phi có lưu ý khác, nội dung của trang này được cấp phép theo Giấy phép ghi nhận tác giả 4.0 của Creative Commons và các mẫu mã lập trình được cấp phép theo Giấy phép Apache 2.0. Để biết thông tin chi tiết, vui lòng tham khảo Chính sách trang web của Google Developers. Java là nhãn hiệu đã đăng ký của Oracle và/hoặc các đơn vị liên kết với Oracle.
Cập nhật lần gần đây nhất: 2024-09-05 UTC.
[null,null,["Cập nhật lần gần đây nhất: 2024-09-05 UTC."],[[["Adds or updates a property on a Google Drive file using the provided file ID."],["The request body must contain a `Property` object defining the property to add or update."],["Upon success, the API returns the newly created or updated `Property` object."],["Requires authorization using one of the specified OAuth scopes, some of which might require a security assessment."]]],["This document outlines the process of adding or updating a property on a file via a POST request. The request URL, using gRPC Transcoding syntax, targets a specific file ID. The request body contains a `Property` instance. Upon success, the response body returns the newly created `Property`. Access requires specific OAuth scopes, such as `drive`, `drive.file`, or `drive.metadata`; certain scopes might require a security assessment. The fileId will be included in the URL path.\n"]]