Add Attachments to a Note

Purpose

This API is used to add attachments to a note.

OAuth Scope

Use the scope

ZohoMail.notes.ALL (or) ZohoMail.notes.CREATE

to generate the Authtoken.

ALL - Grants full access to notes.

CREATE - Grants access to add attachments to notes.

Request URL

Method: POST

For Group :

https://mail.zoho.com/api/notes/groups/{groupId}/{noteId}/attachments

or

For Personal :

https://mail.zoho.com/api/notes/me/{noteId}/attachments

Path Parameters

  • groupIdlong
    • Specifies the unique ID of the group.
    • This parameter can be retrieved from the Get all groups API.
  • noteIdlong
    • Specifies the unique ID used of the note whose details are to be retrieved.
    • This parameter can be retrieved from the Get all notes API.

 

Multi-Part Form Data

  • attachfile
    • This parameter attaches files as a part of multipart form data.
    • The value of this parameter will be the path to the file which is to be added as attachment to the note.

 

* - Mandatory parameter

Response Codes

Refer here for the response codes and their meaning.

``

Sample Request - For Group Notes

Copiedcurl "https://mail.zoho.com/api/notes/groups/84626808/123456789/attachments" \
-X POST \
-H "Content-Type: multipart/form-data" \
-F "attach=@/path/to/file1.jpg" \
-F "attach=@/path/to/file2.jpg" \
-H "Authorization:Zoho-oauthtoken *****"

Sample Request - For Personal Notes

Copiedcurl "https://mail.zoho.com/api/notes/me/123456789/attachments" \
-X POST \
-H "Content-Type: multipart/form-data" \
-F "attach=@/path/to/file1.jpg" \
-F "attach=@/path/to/file2.jpg" \
-H "Authorization:Zoho-oauthtoken *****"

Sample Success Response

Copied{
  "status": {
    "code": 200,
    "description": "success"
  },
  "data": {
    "attachments": [
      {
        "fileName": "file1.jpeg",
        "attachmentID": "139313445841160050"
      },
      {
        "fileName": "file2.jpg",
        "attachmentID": "139313445841160080"
      }
    ],
    "failedFiles": []
  }
}

Sample Failure Response

Copied[
  2,
  {
    "msg": "Sorry, we are unable to process your request.",
    "status": "400"
  }
]