/files
Heads Up!
This page documents the Advance Access version (think "beta" but with fewer bugs) of the folders functionality.
This call creates a new folder.
Every project on the Platform is represented by a root folder which contains all the files associated with a particular project. You can create nesting folders and subfolders within this root folder by using this API request.
Once you've created a folder, you can copy or move files between folders to populate your newly created folder.
To list the contents of the main project folder, first make the API request to get project details which will return the ID of the main folder (key: root_folder
). Next, use the list folder contents call and specify this ID.
https://api.sb.biodatacatalyst.nhlbi.nih.gov/v2/files
Request
Example request
POST /v2/files HTTP/1.1
Host: api.sb.biodatacatalyst.nhlbi.nih.gov
X-SBG-Auth-Token: 3259c50e1ac5426ea8f1273259740f74
Content-Type: application/json
X-SBG-advance-access: advance
curl -X POST -H "X-SBG-Auth-Token: c2e05946fb9a494ab5c19c72a94cb4ac" -H "x-sbg-advance-access: advance" -H "Content-Type: application/json" -d '{
"name" : "my new folder",
"type" : "folder",
"parent": "57fb98c51c94d72f08ba0544"
}
Header Fields
Name | Description |
---|---|
X-SBG-Auth-Token required | Your authentication token. |
Content-Type required | application/json |
X-SBG-Advance-Access required | advance |
Request body
In the request body, you should enter the following list of key-value pairs:
Name | Data type | Description |
---|---|---|
name required | String | The name of the folder. It shouldn't begin with "__". |
type required | Enum | folder |
parent | String | Specifies the ID of the parent folder for the new folder. You should either specify a parent folder or the project name (see List folder contents for instructions on how to find the folder ID). |
project | String | Project ID (username/project_name ).You should either specify a project name or the parent folder ID. |
Example request body
{
"name": "my new folder",
"parent": "57fba0611c94d72f08ba0550",
"type": "FOLDER"
}
Response
See a list of response codes that may be contained in the body of the response.
Example response body
{
"href": "https://api.sb.biodatacatalyst.nhlbi.nih.gov/v2/files/57fba0611c94d72f08ba0550",
"id": "5800b406e4b07ecb1445de83",
"name": "my new folder",
"parent": "57fba0611c94d72f08ba0550",
"type": "FOLDER",
"created_on": "2016-10-10T14:06:25Z",
"modified_on": "2016-10-10T14:06:25Z"
}