We use essential cookies for the website to function, as well as analytics cookies for analyzing and creating statistics of the website performance. To agree to the use of analytics cookies, click "Accept All". You can manage your preferences at any time by clicking "Cookie Settings" on the footer. More Information.

Only Essential Cookies
Accept All

Files:copy

Creates a copy of a file. 

Request

HTTP Request

POST
https://drive.cloud.hicloud.com/drive/v1/files/{fileId}/copy

Parameters

*Some parameters are mandatory.

Parameter NameType
Description
fileIdstringpathFile ID. (Mandatory)
fieldsstringqueryFields in the request, which are in the partial response format.
formstringqueryMedia format.
prettyPrintbooleanqueryIndicates whether to return a response in a human-readable format.
quotaIdstringqueryUser identifier, consisting of 40 characters at maximum. It is used to restrict the number of API calls of an individual user.
callbackstringqueryCallback function used in JSONP requests.
x-hw-trace-idstringheaderID used for service tracing. 
x-hw-app-idstringheaderApp ID. 
versionstringheaderSDK version number.
x-hw-terminalstringheaderDevice model. 
x-hw-osstringheaderDevice operating system. 
unionIDstringheaderOpen user ID. 
User-AgentstringheaderApp version number or ID. 

Request Body

In the request body, provide data with the following structure:

Parameter NameTypeDescription
appSettings[]stringCustom properties of the requesting app.
writerHasCopyPermissionbooleanIndicates whether the current user (assuming the writer role) has permission to copy this file.
descriptionstringShort description of the file.
mimeTypestringMIME type of the file.
editedTimestringLast time the file was modified.
fileNamestringName of the file.
originalFilenamestringThe original name of the file.
parentFolder[]stringParent folder.
properties[]stringCustom file properties that are universally visible.
favoritebooleanIndicates whether the file has been favorited.
writersHasSharePermissionbooleanIndicates whether the current user (assuming the writer role) has permission to share this file.

Response

If successful, this method returns a response body with the following structure:

  1. {
  2.   "category": "drive#file",
  3.   "id": "string",
  4.   "fileName": "string",
  5.   "mimeType": "string",
  6.   "description": "string",
  7.   "favorite": true,
  8.   "recycled": true,
  9.   "directlyRecycled": true,
  10.   "recyclingUser": {
  11.    "category": "drive#user",
  12.    "displayName": "string",
  13.    "profilePhotoLink": "string",
  14.    "me": true,
  15.    "permissionId": "string",
  16.    "userAccount": "string"
  17.   },
  18.   "recycledTime": "2019-12-10T13:06:04.519Z",
  19.   "parentFolder": ["string"],
  20.   "properties": {
  21.    "additionalProp1": "string",
  22.    "additionalProp2": "string",
  23.    "additionalProp3": "string"
  24.   },
  25.   "appSettings": {
  26.    "additionalProp1": "string",
  27.    "additionalProp2": "string",
  28.    "additionalProp3": "string"
  29.   },
  30.   "containers": ["drive"],
  31.   "version": 0,
  32.   "contentDownloadLink": "string",
  33.   "iconDownloadLink": "string",
  34.   "existThumbnail": true,
  35.   "thumbnailDownloadLink": "string",
  36.   "smallThumbnailDownloadLink": "string",
  37.   "thumbnailVersion": 0,
  38.   "onLineViewLink": "string",
  39.   "createdTime": "2019-12-10T13:06:04.519Z",
  40.   "editedTime": "2019-12-10T13:06:04.519Z",
  41.   "editedByMeTime": "2019-12-10T13:06:04.519Z",
  42.   "editedByMe": true,
  43.   "sharedWithMeTime": "2019-12-10T13:06:04.519Z",
  44.   "sharer": {
  45.    "category": "drive#user",
  46.    "displayName": "string",
  47.    "profilePhotoLink": "string",
  48.    "me": true,
  49.    "permissionId": "string",
  50.    "userAccount": "string"
  51.   },
  52.   "owners": [
  53.    {
  54.     "category": "drive#user",
  55.     "displayName": "string",
  56.     "profilePhotoLink": "string",
  57.     "me": true,
  58.     "permissionId": "string",
  59.     "userAccount": "string"
  60.    }
  61.   ],
  62.   "lastEditor": {
  63.    "category": "drive#user",
  64.    "displayName": "string",
  65.    "profilePhotoLink": "string",
  66.    "me": true,
  67.    "permissionId": "string",
  68.    "userAccount": "string"
  69.   },
  70.   "hasShared": false,
  71.   "ownedByMe": true,
  72.   "capabilities": {
  73.    "addChildNodePermission": true,
  74.    "writerHasChangeCopyPermission": false,
  75.    "commentPermission": true,
  76.    "copyPermission": true,
  77.    "deletePermission": true,
  78.    "deleteChildNodePermission": true,
  79.    "downloadPermission": true,
  80.    "editPermission": true,
  81.    "listChildNodePermission": true,
  82.    "editContentPermission": true,
  83.    "readHistoryVersionPermission": true,
  84.    "removeChildNodePermission": true,
  85.    "renameFilePermission": true,
  86.    "shareFilePermission": false,
  87.    "recyclePermission": true,
  88.    "recycleChildNodePermission": true,
  89.    "unrecyclePermission": true
  90.   },
  91.   "viewersHasCopyContentPermission": false,
  92.   "writerHasCopyPermission": false,
  93.   "writersHasSharePermission": false,
  94.   "permissions": [
  95.   {
  96.     "category": "drive#permission",
  97.     "id": "string",
  98.     "type": "user",
  99.     "role": "owner",
  100.     "userAccount": "string",
  101.     "displayName": "string",
  102.     "expirationTime": "2020-02-24T00:50:54.483Z",
  103.     "deleted": true,
  104.     "canDiscoverFile": true
  105.   }
  106.    ],
  107.    "permissionIds": ["string"],
  108.   "originalFilename": "string",
  109.   "fullFileSuffix": "string",
  110.   "fileSuffix": "string",
  111.   "size": 0,
  112.   "occupiedSpace": 0,
  113.   "pictureMetadata": {
  114.    "width": 0,
  115.    "height": 0,
  116.    "rotation": 0,
  117.    "location": {
  118.     "latitude": 0,
  119.     "longitude": 0,
  120.     "altitude": 0
  121.    },
  122.    "exifTime": "string",
  123.    "cameraMaker": "string",
  124.    "cameraModel": "string",
  125.    "exposureTime": 0,
  126.    "aperture": 0,
  127.    "flashUsed": true,
  128.    "focalLength": 0,
  129.    "isoSpeed": 0,
  130.    "meteringMode": "string",
  131.    "sensor": "string",
  132.    "exposureMode": "string",
  133.    "colorSpace": "string",
  134.    "whiteBalance": "string",
  135.    "exposureBias": 0,
  136.    "maxApertureValue": 0,
  137.    "subjectDistance": 0,
  138.    "lens": "string"
  139.   },
  140.   "videoMetadata": {
  141.    "width": 0,
  142.    "height": 0,
  143.    "durationTime": 0
  144.   },
  145.   "sha256": "string",
  146.   "lastHistoryVersionId": "string",
  147.   "contentVersion": "string"
  148. }
idstringID of the file.
categorystringResource type. The value is always drive#file.
idstringID of the file.
fileNamestringName of the file.
mimeTypestringMIME type of the file.
descriptionstringShort description of the file.
favoritebooleanIndicates whether the file has been favorited.
recycledbooleanIndicates whether the file has been moved to the recycle bin.
directlyRecycledbooleanIndicates whether the file has been explicitly trashed.
recyclingUser.categorystringUser type. The value is always drive#user.
recyclingUser.displayNamestringDisplay name for this user.
recyclingUser.profilePhotoLinkstringLink to the user's profile picture, which is not returned by default.
recyclingUser.mebooleanIndicates whether this user is the requesting user.
recyclingUser.permissionIdstringPermission ID.
recyclingUser.userAccountstringAccount of the user, which is not returned by default.
recycledTimestringTime when the item was moved to the recycle bin.
parentFolder[]stringParent folder.
properties[]stringCustom file properties that are universally visible.
appSettings[]stringCustom properties of the requesting app.
containers[]stringSpaces that contain the file. Values: drive and applicationData
versionintegerVersion number of the file.
contentDownloadLinkstringLink for downloading the file in a browser.
iconDownloadLinkstringLink to the file's icon.
existThumbnailbooleanIndicates whether the file has a thumbnail.
thumbnailDownloadLinkstringLink to the file's large thumbnail.
smallThumbnailDownloadLinkstringLink to the file's small thumbnail.
thumbnailVersionintegerVersion number for the thumbnail.
onLineViewLinkstringLink to view the file online.
createdTimestringTime when the file was created.
editedTimestringLast time the file was modified.
editedByMeTimestringLast time the file was modified by the user.
editedByMebooleanIndicates whether the file was modified by the user.
sharedWithMeTimestringTime at which the file was shared with the user.
sharer.categorystringUser type. The value is always drive#user.
sharer.displayNamestringDisplay name for this user.
sharer.profilePhotoLinkstringLink to the user's profile picture, which is not returned by default.
sharer.mebooleanIndicates whether this user is the requesting user.
sharer.permissionIdstringPermission ID.
sharer.userAccountstringAccount of the user, which is not returned by default.
owners.categorystringUser type. The value is always drive#user.
owners.displayNamestringDisplay name for this user.
owners.profilePhotoLinkstringLink to the user's profile picture, which is not returned by default.
owners.mebooleanIndicates whether this user is the requesting user.
owners.permissionIdstringPermission ID.
owners.userAccountstringAccount of the user, which is not returned by default.
lastEditor.categorystringUser type. The value is always drive#user.
lastEditor.displayNamestringDisplay name for this user.
lastEditor.profilePhotoLinkstringLink to the user's profile picture, which is not returned by default.
lastEditor.mebooleanIndicates whether this user is the requesting user.
lastEditor.permissionIdstringPermission ID.
lastEditor.userAccountstringAccount of the user, which is not returned by default.
hasSharedbooleanIndicates whether the file has been shared.
ownedByMebooleanIndicates whether the user owns the file.
capabilities.addChildNodePermissionbooleanIndicates whether the current user has permission to create subfolders to a particular folder.
capabilities.writerHasChangeCopyPermissionbooleanIndicates whether the current user (assuming the writer role) has permission to change the content of this file.
capabilities.commentPermissionbooleanIndicates whether the current user has permission to comment on this file.
capabilities.copyPermissionbooleanIndicates whether the current user has permission to copy this file.
capabilities.deletePermissionbooleanIndicates whether the current user has permission to delete this file.
capabilities.deleteChildNodePermissionbooleanIndicates whether the current user has permission to delete subfolders from this folder.
capabilities.downloadPermissionbooleanIndicates whether the current user has permission to download this file.
capabilities.editPermissionbooleanIndicates whether the current has permission to edit this file.
capabilities.listChildNodePermissionbooleanIndicates whether the current user has permission to list subfolders in this folder.
capabilities.editContentPermissionbooleanIndicates whether the current user has permission to modify the content of this file.
capabilities.readHistoryVersionPermissionbooleanIndicates whether the current user has permission to read revisions of this file.
capabilities.removeChildNodePermissionbooleanIndicates whether the current user has permission to remove subfolders from this folder.
capabilities.renameFilePermissionbooleanIndicates whether the current user has permission to rename this file.
capabilities.shareFilePermissionbooleanIndicates whether the current user has permission to share this file.
capabilities.recyclePermissionbooleanIndicates whether the current user has permission to move this file to the recycle bin.
capabilities.recycleChildNodePermissionbooleanIndicates whether the current user has permission to move the subfolders in this folder to the recycle bin.
capabilities.unrecyclePermissionbooleanIndicates whether the current user has permission to restore this file from the recycle bin.
viewersHasCopyContentPermissionbooleanIndicates whether the current user has permission to copy the content of this file.
writerHasCopyPermissionbooleanIndicates whether the current user (assuming the writer role) has permission to copy this file.
writersHasSharePermissionbooleanIndicates whether the current user (assuming the writer role) has permission to share this file.
permissions[]
stringList of permissions for the file.
permissions.categorystringPermission type. The value is always drive#permission.
permissions.idstringPermission ID.
permissions.typestringGrantee type. Values: user and anyone.
permissions.rolestringRole granted by the permission. Values: owner, writer, commenter, and reader.
permissions.userAccountstringUser account.
permissions.displayNamestringDisplay name for the permission.
permissions.expirationTimestringTime when the permission will expire.
permissions.deletedbooleanIndicates whether the permission is deleted.
permissions.canDiscoverFilebooleanIndicates whether the permission allows the file to be searched. It is applicable only to permissions of the anyone type.
originalFilenamestringOriginal name of the file.
fullFileSuffixstringFull file extension extracted from the name field. It is the substring that comes immediately after the dot character in the filename.
fileSuffixstringFinal component offullFileSuffix.
sizeintegerSize of file content.
occupiedSpaceintegerActual storage used by the file.
pictureMetadata.widthintegerImage width.
pictureMetadata.heightintegerImage height.
pictureMetadata.rotationintegerImage rotation angle.
pictureMetadata.location.latitudenumberLatitude stored in the image.
pictureMetadata.location.longitudenumberLongitude stored in the image.
pictureMetadata.location.altitudenumberAltitude stored in the image.
pictureMetadata.exifTimestringDate and time the image was created (EXIF DateTime).
pictureMetadata.cameraMakerstringMaker of the camera that was used to create the image.
pictureMetadata.cameraModelstringModel of the camera that was used to create the image.
pictureMetadata.exposureTimenumberLength of the exposure, in seconds.
pictureMetadata.aperturenumberAperture (f-number) used when creating the image.
pictureMetadata.flashUsedbooleanIndicates whether a flash was used to create the image.
pictureMetadata.focalLengthnumberFocal length used when creating the image, in millimeters.
pictureMetadata.isoSpeedintegerISO speed used when creating the image.
pictureMetadata.meteringModestringMetering mode used when creating the image.
pictureMetadata.sensorstringType of sensor used when creating the image.
pictureMetadata.exposureModestringExposure mode used when creating the image.
pictureMetadata.colorSpacestringColor space of the image.
pictureMetadata.whiteBalancestringWhite balance mode used when creating the image.
pictureMetadata.exposureBiasnumberExposure bias of the image (APEX value).
pictureMetadata.maxApertureValuenumberMaximum aperture used when creating the image (APEX value).
pictureMetadata.subjectDistanceintegerDistance to the subject of the image, in meters.
pictureMetadata.lensstringLens used for creating the image.
videoMetadata.widthintegerWidth of the video.
videoMetadata.heightintegerHeight of the video.
videoMetadata.durationTimeintegerDuration of the video in milliseconds.
sha256stringSHA-256 value for the file.
lastHistoryVersionIdstringID of the latest version.
contentVersionstringContent version number.
Search
Enter a keyword.