Create folder in Zoho Mail
Table of Contents
Note:
- This task is applicable to all Zoho services, except Zoho Creator.
- Each time the zoho.mail.createFolder integration task is executed, it triggers an API request in the back-end. This call is deducted from the external calls limit available for the service from which the task is executed, based on your pricing plan.
- Only actual executions that receive a response (whether success or failure) are counted, not the number of times the task appears in the script. For example, if zoho.mail.createFolder integration task is placed inside a for each task that iterates five times, the number of external calls consumed will be five, even though the task appears only once in the script.
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"
}