Create folder in Zoho Mail
Table of Contents
Note: This task is applicable to all Zoho services, except Zoho Creator.
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
The KEY-VALUE response that represents the status of the executed task.
"Folder1"
The TEXT that represents the name of the folder that will be created.
"mail_oauth_connection"
The TEXT that represents the link name of the Zoho Mail 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"
The TEXT that represents the name of the subfolder that will be created.
6729326000000008021
The NUMBER that represents the ID of the parent folder.
"mail_oauth_connection"
The TEXT that represents the link name of the Zoho Mail 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"
}