POST - Add Attachments to Group/Personal Task

Purpose

This API is used to add one or more attachment(s) to a group/personal task. Multiple files can be attached in a single request.

OAuth Scope

Use the scope

ZohoMail.tasks.ALL (or) ZohoMail.tasks.CREATE

to generate the Authtoken.

ALL - Full access to tasks.

CREATE - Add attachment to group/personal task.

Request URL

Method: POST

Group Task:

https://mail.zoho.com/api/tasks/groups/{zgid}/{taskId}/attachments

Personal Task:

https://mail.zoho.com/api/tasks/me/{taskId}/attachments

Path Parameters

  • zgid* long
    • Specifies the unique identifier used for groups in an organization.
    • This parameter can be retrieved from the Get all groups API.
  • taskId* long

Request Body ( JSON Object)

  • attach* File
    • Specifies the file(s) to be attached.
    • Maximum file size must not exceed 10 MB per file.
    • Maximum of 100 files can be uploaded.
    • File name can contain a maximum of 255 characters.

 

* - Mandatory parameter

Response Codes

Refer here for the response codes and their meaning.

Sample Request - Group Task

Copiedcurl "https://mail.zoho.com/api/tasks/groups/5******048/48184******91002/attachments" \
-X POST \
-H "Accept: application/json" \
-H "Content-Type: multipart/form-data" \
-H "Authorization: Zoho-oauthtoken ****************" \
-F "attach=@Task detail.png" \
-F "attach=@Performance details.csv"

Sample Request - Personal Task

Copiedcurl "https://mail.zoho.com/api/tasks/me/34523******67511/attachments" \
-X POST \
-H "Accept: application/json" \
-H "Content-Type: multipart/form-data" \
-H "Authorization: Zoho-oauthtoken ****************" \
-F "attach=@Task detail.png" \
-F "attach=@Performance details.csv"

Sample Response - Group & Personal Tasks

Copied{
  "status": {
    "code": 200,
    "description": "success"
  },
  "data": {
    "attachments": [
      {
        "name": "Task detail.png",
        "id": 139308222824380020
      },
      {
        "name": "Performance details.csv",
        "id": 139308222824380053
      }
    ]
  }
}

Sample Failure Response - Group & Personal Tasks

Copied{
  "status": {
    "code": 0,
    "description": "The input passed is invalid"
  },
  "data": {}
}