Create folder in Zoho Mail
Table of Contents
Overview
The zoho.mail.createFolder task is used to create a new folder in Zoho Mail.
Syntax
<response> = zoho.mail.createFolder(<folderName>, <parent_folder_id>, <connection>);
where:
Params | Data type | Description |
<response> | KEY-VALUE | The status of the executed task. |
<folderName> | TEXT | The name of the folder that will be created. |
<parent_folder_id> | NUMBER | The ID of the folder within which the new folder will be created. Note:
|
<connection> | TEXT | The link name of the Zoho Mail connection Note:
|
Example 1
The following script creates a new folder with the specified name in Zoho Mail:
response = zoho.mail.createFolder("Folder1", 0, "mail_oauth_connection");
where:
response
"Folder1"
"mail_oauth_connection"
Example 2
The following script creates a sub folder under an existing folder in Zoho Mail:
response = zoho.mail.createFolder("InboxSubFolder", 6729326000000008021, "mail_oauth_connection");
where:
"InboxSubFolder"
6729326000000008021
"mail_oauth_connection"
Response Format
Success Response
- The success response returned is of the following format:{
"message":"Action createFolder is successful",
"status":"success"
}
Failure Response
- The failure response returned is of the following format:{
"message":"Error while processing the request! You are not allowed to create folder with this name.",
"status":"failure"
}