Create Folder In Zoho WorkDrive
Table of Contents
Description
The zoho.workdrive.createFolder task creates a folder within the specified folder under my folders.
Syntax
<response> = zoho.workdrive.createFolder(<folder_name>, <parent_id>, <connection>);
Params | Data type | Description |
<response> | KEY-VALUE | The details of the new folder that will be created. |
<folder_name> | TEXT | The name of the folder that will be created. |
<parent_id> | TEXT | The ID of the parent folder within which the new folder will be created. Note: You can get the folder ID from the Zoho WorkDrive URL. The URL will be in the following format: https://workdrive.zoho.com/home/teams/<team_id>/privatespace/folders/<parent_folder_id> |
<connection> | TEXT | The link name of the connection. Note:
|
Example
The following script creates a new folder within the folder of ID - o5cfkXXXXXXXXXXXXXXXXXXXXXXXXXXX7e30c.
response = zoho.workdrive.createFolder("Subfolder", "o5cfkXXXXXXXXXXXXXXXXXXXXXXXXXXX7e30c", "workdrive_oauth_connection");
where:
response
"Subfolder"
"o5cfkXXXXXXXXXXXXXXXXXXXXXXXXXXX7e30c"
"workdrive_oauth_connection"
Response Format
Success Response
The success response will be returned in the following format:
{
{
"data": {
"id": "o5cfkXXXXXXXXXXXXXXXXXXXXXXXXXXX0756a",
"type": "files",
"attributes": {
"is_locked": false,
"conv_engine_type": 0,
"type": "folder",
"created_time_i18": "Aug 26, 4:46 PM",
"modified_time_in_millisecond": 1566818185150,
"opened_time": "Aug 26, 4:46 PM",
"download_url": "https://workdrive.zoho.com/download/o5cfkXXXXXXXXXXXXXXXXXXXXXXXXXXX0756a",
"comment_badge_count": 0,
"created_time": "Aug 26, 4:46 PM",
"lock_status": 2,
"is_folder": true,
"resource_type": 1001,
"display_attr_name": "Folder 2",
"created_by": "Shawn",
"display_html_name": "Subfolder",
"org_id": "af0u7XXXXXXXXXXXXXXXXXXXXXXXXXXXee228",
"parent_id": "o5cfkXXXXXXXXXXXXXXXXXXXXXXXXXXX7e30c",
"name": "Subfolder",
"permalink": "https://workdrive.zoho.com/folder/o5cfkXXXXXXXXXXXXXXXXXXXXXXXXXXX0756a",
"favorite": false,
"new_badge_count": 0,
"status": 1,
"modified_time_i18": "Aug 26, 4:46 PM",
"opened_time_i18": "Aug 26, 4:46 PM",
"extn": "",
"description": "",
"uploaded_time_in_millisecond": 1566818185156,
"thumbnail_url": "",
"title": "",
"files_view_pref": {
"sort_by": "last_modified",
"sort_order": "desc",
"filtered_by": "all",
"layout": "list"
},
"modified_time": "Aug 26, 4:46 PM",
"library_id": "o5cfkXXXXXXXXXXXXXXXXXXXXXXXXXXXe5187",
"icon_class": "folder",
"created_time_in_millisecond": 1566818185150,
"owner": "54750609",
"creator": "58131170",
"capabilities": {
"can_read": true,
"can_share": true,
"can_remove_share": false,
"can_delete": false,
"can_edit": true,
"can_create_files": true,
"can_upload_files": true,
"can_trash": true,
"can_rename": true,
"can_restore": false,
"can_copy": true,
"can_move": true,
"can_zip": true,
"can_download": true,
"can_emailattach": true,
"can_publish": true,
"can_trash_files": true
},
"uploaded_time_i18": "Aug 26, 4:46 PM",
"is_external_upload": false,
"opened_time_in_millisecond": 1566818185150,
"edit_badge_count": 0,
"share_data": [
],
"uploaded_time": "Aug 26, 4:46 PM",
"has_folders": false,
"service_type": "upload",
"display_url_name": "Folder+2",
"is_unread": false,
"modified_by": "Shawn",
"is_part_of_joined_workspace": false
},
"relationships": {
"folders": {
"links": {
"self": "https://workdrive.zoho.com/api/v1/files/o5cfkXXXXXXXXXXXXXXXXXXXXXXXXXXX0756a/relationships/folders",
"related": "https://workdrive.zoho.com/api/v1/files/o5cfkXXXXXXXXXXXXXXXXXXXXXXXXXXX0756a/folders"
}
},
"comments": {
"links": {
"self": "https://workdrive.zoho.com/api/v1/files/o5cfkXXXXXXXXXXXXXXXXXXXXXXXXXXX0756a/relationships/comments",
"related": "https://workdrive.zoho.com/api/v1/files/o5cfkXXXXXXXXXXXXXXXXXXXXXXXXXXX0756a/comments"
}
},
"previewinfo": {
"links": {
"self": "https://workdrive.zoho.com/api/v1/files/o5cfkXXXXXXXXXXXXXXXXXXXXXXXXXXX0756a/relationships/previewinfo",
"related": "https://workdrive.zoho.com/api/v1/files/o5cfkXXXXXXXXXXXXXXXXXXXXXXXXXXX0756a/previewinfo"
}
},
"unzip": {
"links": {
"self": "https://workdrive.zoho.com/api/v1/files/o5cfkXXXXXXXXXXXXXXXXXXXXXXXXXXX0756a/relationships/unzip",
"related": "https://workdrive.zoho.com/api/v1/files/o5cfkXXXXXXXXXXXXXXXXXXXXXXXXXXX0756a/unzip"
}
},
"publiclink": {
"links": {
"self": "https://workdrive.zoho.com/api/v1/files/o5cfkXXXXXXXXXXXXXXXXXXXXXXXXXXX0756a/relationships/publiclink",
"related": "https://workdrive.zoho.com/api/v1/files/o5cfkXXXXXXXXXXXXXXXXXXXXXXXXXXX0756a/publiclink"
}
},
"accesschartdata": {
"links": {
"self": "https://workdrive.zoho.com/api/v1/files/o5cfkXXXXXXXXXXXXXXXXXXXXXXXXXXX0756a/relationships/accesschartdata",
"related": "https://workdrive.zoho.com/api/v1/files/o5cfkXXXXXXXXXXXXXXXXXXXXXXXXXXX0756a/accesschartdata"
}
},
"resourceproperty": {
"links": {
"self": "https://workdrive.zoho.com/api/v1/files/o5cfkXXXXXXXXXXXXXXXXXXXXXXXXXXX0756a/relationships/resourceproperty",
"related": "https://workdrive.zoho.com/api/v1/files/o5cfkXXXXXXXXXXXXXXXXXXXXXXXXXXX0756a/resourceproperty"
}
},
"parentfolders": {
"links": {
"self": "https://workdrive.zoho.com/api/v1/files/o5cfkXXXXXXXXXXXXXXXXXXXXXXXXXXX0756a/relationships/parentfolders",
"related": "https://workdrive.zoho.com/api/v1/files/o5cfkXXXXXXXXXXXXXXXXXXXXXXXXXXX0756a/parentfolders"
}
},
"importfile": {
"links": {
"self": "https://workdrive.zoho.com/api/v1/files/o5cfkXXXXXXXXXXXXXXXXXXXXXXXXXXX0756a/relationships/importfile",
"related": "https://workdrive.zoho.com/api/v1/files/o5cfkXXXXXXXXXXXXXXXXXXXXXXXXXXX0756a/importfile"
}
},
"versions": {
"links": {
"self": "https://workdrive.zoho.com/api/v1/files/o5cfkXXXXXXXXXXXXXXXXXXXXXXXXXXX0756a/relationships/versions",
"related": "https://workdrive.zoho.com/api/v1/files/o5cfkXXXXXXXXXXXXXXXXXXXXXXXXXXX0756a/versions"
}
},
"permissions": {
"links": {
"self": "https://workdrive.zoho.com/api/v1/files/o5cfkXXXXXXXXXXXXXXXXXXXXXXXXXXX0756a/relationships/permissions",
"related": "https://workdrive.zoho.com/api/v1/files/o5cfkXXXXXXXXXXXXXXXXXXXXXXXXXXX0756a/permissions"
}
},
"timeline": {
"links": {
"self": "https://workdrive.zoho.com/api/v1/files/o5cfkXXXXXXXXXXXXXXXXXXXXXXXXXXX0756a/relationships/timeline",
"related": "https://workdrive.zoho.com/api/v1/files/o5cfkXXXXXXXXXXXXXXXXXXXXXXXXXXX0756a/timeline"
}
},
"files": {
"links": {
"self": "https://workdrive.zoho.com/api/v1/files/o5cfkXXXXXXXXXXXXXXXXXXXXXXXXXXX0756a/relationships/files",
"related": "https://workdrive.zoho.com/api/v1/files/o5cfkXXXXXXXXXXXXXXXXXXXXXXXXXXX0756a/files"
}
},
"links": {
"links": {
"self": "https://workdrive.zoho.com/api/v1/files/o5cfkXXXXXXXXXXXXXXXXXXXXXXXXXXX0756a/relationships/links",
"related": "https://workdrive.zoho.com/api/v1/files/o5cfkXXXXXXXXXXXXXXXXXXXXXXXXXXX0756a/links"
}
},
"copy": {
"links": {
"self": "https://workdrive.zoho.com/api/v1/files/o5cfkXXXXXXXXXXXXXXXXXXXXXXXXXXX0756a/relationships/copy",
"related": "https://workdrive.zoho.com/api/v1/files/o5cfkXXXXXXXXXXXXXXXXXXXXXXXXXXX0756a/copy"
}
},
"accessdata": {
"links": {
"self": "https://workdrive.zoho.com/api/v1/files/o5cfkXXXXXXXXXXXXXXXXXXXXXXXXXXX0756a/relationships/accessdata",
"related": "https://workdrive.zoho.com/api/v1/files/o5cfkXXXXXXXXXXXXXXXXXXXXXXXXXXX0756a/accessdata"
}
},
"previewzip": {
"links": {
"self": "https://workdrive.zoho.com/api/v1/files/o5cfkXXXXXXXXXXXXXXXXXXXXXXXXXXX0756a/relationships/previewzip",
"related": "https://workdrive.zoho.com/api/v1/files/o5cfkXXXXXXXXXXXXXXXXXXXXXXXXXXX0756a/previewzip"
}
},
"breadcrumbs": {
"links": {
"self": "https://workdrive.zoho.com/api/v1/files/o5cfkXXXXXXXXXXXXXXXXXXXXXXXXXXX0756a/relationships/breadcrumbs",
"related": "https://workdrive.zoho.com/api/v1/files/o5cfkXXXXXXXXXXXXXXXXXXXXXXXXXXX0756a/breadcrumbs"
}
},
"custommetadata": {
"links": {
"self": "https://workdrive.zoho.com/api/v1/files/o5cfkXXXXXXXXXXXXXXXXXXXXXXXXXXX0756a/relationships/custommetadata",
"related": "https://workdrive.zoho.com/api/v1/files/o5cfkXXXXXXXXXXXXXXXXXXXXXXXXXXX0756a/custommetadata"
}
},
"statistics": {
"links": {
"self": "https://workdrive.zoho.com/api/v1/files/o5cfkXXXXXXXXXXXXXXXXXXXXXXXXXXX0756a/relationships/statistics",
"related": "https://workdrive.zoho.com/api/v1/files/o5cfkXXXXXXXXXXXXXXXXXXXXXXXXXXX0756a/statistics"
}
}
},
"links": {
"self": "https://workdrive.zoho.com/api/v1/files/o5cfkXXXXXXXXXXXXXXXXXXXXXXXXXXX0756a"
}
}
}
Failure Response
The failure response for an incorrect parent ID will be returned in the following format:
{
"errors": [
{
"id": "R008",
"title": "Unauthorized access"
}
]
}