post https://cgc-api.sbgenomics.com/v2
/files/{file_id}/actions/copy
This call copies the specified file to another folder within the same project. Files retain their metadata when copied, but may be assigned new names in their target project.
https://cgc-api.sbgenomics.com/v2/files/{file_id}/actions/copy
Request
Example request
POST /v2/files/{file_id}/actions/copy HTTP/1.1
Host: cgc-api.sbgenomics.com
X-SBG-Auth-Token: 3210a98c1db9318fa9d9273156740f74
Content-Type: application/json
curl --data '{"project": "RFranklin/my-project", "name": "new-file", "parent: "57fb98d31c94d72f08ba0544"}' -s -H "X-SBG-Auth-Token: 3210a98c1db9318fa9d9273156740f74" -H "content-type: application/json" -X POST "https://cgc-api.sbgenomics.com/v2/files/568e69abe9b0307bc0414164/actions/copy"
Header Fields
Name | Description |
---|---|
X-SBG-Auth-Token required | Your CGC authentication token. |
Content-Type required | application/json |
Request body
In the request body, you should enter the following list of key-value pairs:
Name | Data type | Description |
---|---|---|
parent required | String | Specifies the target folder by using its ID. To find out the folder ID, use the List folder contents call for its parent folder. |
name | String | Specifies a new name for a file in case you want to rename it. If you want to use the same name, omit this key. |
###Example request body
{
"parent": "57fb98d31c94d72f08ba0544",
"name": "1000G_omni2.5.hg38.vcf"
}
Response
See a list of CGC-specific response codes that may be contained in the body of the response.
Example response body
{
"href": "https://cgc-api.sbgenomics.com/v2/files/57fba0611c94d72f08ba0550",
"id": "57fba0611c94d72f08ba0550",
"name": "1000G_omni2.5.hg38.vcf",
"size": 208485995,
"project": "rfranklin/my-project-3",
"parent": "57fb98d31c94d72f08ba0544",
"type": "FILE",
"created_on": "2016-10-13T11:36:39Z",
"modified_on": "2016-10-13T11:36:39Z",
"storage": {
"type": "PLATFORM"
},
"origin": {},
"tags": [
"WGS",
"hg38"
],
"metadata": {}
}