POST - Add a New Group/Personal Task
Purpose
This API is used to add a new group/personal task.
OAuth Scope
Use the scope
ZohoMail.tasks.ALL (or) ZohoMail.tasks.CREATE
to generate the Authtoken.
ALL - Full access to tasks.
CREATE - Create a new group/personal task.
Request URL
Method: POST
Group Task:
https://mail.zoho.com/api/tasks/groups/{zgid}
Personal Task:
https://mail.zoho.com/api/tasks/me
Request Body ( JSON Object)
- title* string
- Provide a title for the task that is being added.
- description string
- Provide a short description of the task being added.
- status string
- Provide the status of the completion of this task.
- Possible values :
- inprogress
- completed
- priority string
- Provide the priority to be given for this task.
- Possible values :
- high
- medium
- low
- projectId long
- Specifies the unique identifier assigned to each project created for group tasks.
- This parameter can be retrieved from Get All Projects In a Group API.
- parentTaskId long
- Specifies the unique identifier given for the parent task.
- dueDate string
- Specifies the due date that you want to set for the task.
- Format: "DD/MM/YYYY" (e.g.: 23/01/2024).
- reminderDate string
- Specifies the date and time when you want to be reminded about the task.
- Format: ISO 8601 (e.g.:2024-01-23T12:34:56+05:30).
- emailReminder boolean
- Specifies whether the reminders need to be sent via email.
- Possible values :
- true (enable reminder via email).
- false (disable reminder via email).
- popupReminder boolean
- Specifies whether reminder notifications need be sent.
- Possible values :
- true (enable reminder notification).
- false (disable reminder notification).
- assignee long
- Specifies the zuid of the member/user to whom the task is assigned.
- This parameter can be retrieved from the User Account Details API.
- In the case of adding a new personal task, default value will be zuid of the user itself.
- subtask JSON Object
- Provide the details of the subtask that has to be added as a task.
- The parameters of this JSON Object are the same as the task.
- accountId long
- Specifies the account identifier for a specific account of a particular user.
- This parameter can be retrieved from the User Account Details API.
- messageId long
- Specifies the unique key used to identify a specific email.
- This parameter can be retrieved from the List of emails in a folder API.
- recurringType string
- Specifies the recurrence pattern for the task.
- Possible values :
- Daily
- Weekly
- Monthly
- Yearly
- recurringFrequency integer
- Specifies the frequency at which the task has to recur.
- Acceptable values: Any positive number.
- recurFrom string
- Specifies the date from which recurrence has to start.
- Format: "DD/MM/YYYY" (e.g.: 23/01/2024).
- recurUntil string
- Specifies the date until which the task has to recur.
- Format: "DD/MM/YYYY" (e.g.: 23/01/2024).
- recurFor integer
- Specifies the number of times the task has to recur.
- Acceptable values: Any positive number.
- recurDailyOnlyOnWeekdays boolean
- Specifies whether the task has to recur every day on the weekdays.
- Possible values :
- true
- false
- recurWeeklyOn integer
- Specifies the day of the week when the task has to recur every week.
- Possible values : (1 - 7), where 1 denotes Sunday and 7 denotes Saturday.
- recurMonthlyOnDayOfWeekInMonth integer
- Specifies the week number in a particular month when the task has to recur every month.
- Possible values : (1 - 4). For example: 3 denotes 3rd week of the month.
- recurMonthlyOnDayOfMonth integer
- Specifies the day of the month when the task has to recur every month.
- Possible values : Any date of the month.
- recurMonthlyOnDayOfWeek integer
- Specifies the day of the week when the task has to recur every month.
- Possible values : (1 - 7), where 1 denotes Sunday and 7 denotes Saturday.
- recurYearlyOnDayOfWeekInMonth integer
- Specifies the week number in a particular month when the task has to recur every year
- Possible values : (1 - 4). For example: 3 denotes 3rd week of the month.
- recurYearlyOnDayOfMonth integer
- Specifies the date of the month when the task has to recur every year.
- Possible values : Any date of the month.
- recurYearlyOnDayOfWeek integer
- Specifies the day of the week when the task has to recur every year.
- Possible values : (1 -7), where 1 denotes Sunday - 7 denotes Saturday.
- recurYearlyOnMonth integer
- Specifies the month when the task has to recur for that year.
- Possible values : (0 - 11), where 0 denotes January and 11 denotes December.
- attachStoreName JSON array of string
- This parameter should be passed as an array of names for the uploaded attachments.
- This parameter can be retrieved from the To Upload Attachments API.
- attachPath JSON array of string
- This parameter should be passed as an array of paths for the uploaded attachments.
- This parameter can be retrieved from the To Upload Attachments API.
* - Mandatory parameter
Note:
- The recurMonthlyOnDayOfWeekInMonth and recurMonthlyOnDayOfWeek parameters should be used together.
- Similarly, the recurYearlyOnDayOfMonth and the recurYearlyOnMonth parameters should be used together.
- Similarly, the recurYearlyOnDayOfWeek and the recurYearlyOnMonth parameters should be used together.
- Either emailReminder or popupReminder should be set to true. Both can be true if the user wants, but at least one should be true for the reminder to be set.
Response Codes
Refer here for the response codes and their meaning.
Sample Request - Group Task
Copiedcurl "https://mail.zoho.com/api/tasks/groups/5365*****" \
-X POST \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization:Zoho-oauthtoken *****" \
-d '{
"title" : “Blog Updates”,
"description" : “Revamp update blog and announcements”,
"priority" : "high",
"reminderDate" : "2018-03-28T17:47:40+05:30",
"emailReminder" : "true",
"assignee" : "54161899",
"recurringType" : "Monthly",
"dueDate" : "29/08/2018",
"recurMonthlyOnDayOfMonth" : "1",
"recurringFrequency" : "2",
"followers" : ["54938724"],
"lockInvites" : "true",
"allowComments" : "false",
"projectId" : "48184000000005003",
"accountId" : "48019000000005001",
"messageId" : "48019000000032001"
}'
Sample Request - Personal Task
Copiedcurl "https://mail.zoho.com/api/tasks/me" \
-X POST \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization:Zoho-oauthtoken *****"
-d '{
"title": “Blog Updates”,
"description": “Announcement blog for recent revamp“,
"priority":"low"
}
Sample Response - Group Tasks
Copied{
"status": {
"code": 200,
"description": "success"
},
"data": {
"owner": {
"name": "Rebecca",
"id": 54136518
},
"numberOfSubtasks": 0,
"modifiedTime": "2018-03-28T17:13:40+05:30",
"attachments": [],
"reminder": {
"dateTime": "2018-03-28T17:47:40+05:30",
"emailReminder": true,
"popupReminder": false
},
"subtasks": [],
"recurring": {
"recurMonthlyOnDayOfMonth": 1,
"type": "Monthly",
"frequency": 2
},
"dueDate": "29/08/2018",
"description": "Make the announcement ready for the recent revamp",
"project": {
"name": "Blogging",
"id": "48184000000005003"
},
"title": "Blog Updates",
"priority": "High",
"tags": [],
"createdAt": "2018-03-28T17:13:40+05:30",
"followers": [
{
"name": "Justin Case",
"id": 54224987,
"group": true
},
{
"name": "Marketing",
"id": 54938724
}
],
"namespaceId": "54224987",
"id": "48184000000093001",
"assignee": {
"name": "Paula M",
"id": 54161899
},
"status": "In Progress"
}
}
Sample Response - Personal Tasks
Copied{
"status":
{
"code":200,"description":"success"
},
"data":
{
"owner":
{
"name":"Rebecca",
"id":4650081
},
"numberOfSubtasks":0,
"modifiedTime":"2017-07-07T01:20:39+05:30",
"attachments":[],
"subtasks":[],
"description":"Announcement blog for recent revamp",
"project":
{
"name":"Blogging",
"id":"7000000006001"
},
"title":"Blog Updates",
"priority":"low",
"tags":[],
"createdAt":"2017-07-07T01:20:39+05:30",
"followers":[],
"namespaceId":"4650081",
"id":"7000000089009",
"assignee":
{
"name":"Rebecca",
"id":4650081
},
"status":"In Progress"
}
}