Get All Attachments

Purpose

To get all the attached files and links of a contract.

Request Details

Request URL

https://contracts.zoho.com/api/v1/contracts/{contractApiName}/attachments

Authorization

Authorization: Zoho-oauthtoken 1000.67013ab3960787bcf3affae67e649fc0.83a789c859e040bf11e7d05f9c8b5ef6

Scope

contracts.contracts.READ, contracts.contracts.ALL

Possible Operation Types

ALL - Full access to contract information
READ - Get all attachments information

Sample Request

Copiedcurl "https://contracts.zoho.com/api/v1/contracts/msa-with-zenith-dynamics/attachments"
-X GET
-H "Authorization: Zoho-oauthtoken 1000.67013ab3960787bcf3affae67e649fc0.83a789c859e040bf11e7d05f9c8b5ef6"

Response JSON Keys

  • contractattachmentsJSON Array

    Represents the list of files and links attached to the contract.

  • contractAttachmentIdstring

    Represents the unique ID of the attachment.

  • attachmentIdstring

    Represents the unique ID of the attached file, applicable only for the "File" attachment type.

  • sequenceNumberinteger

    Represents the order in which the attachment was added.

  • attachmentTypeinteger

    Represents the type of attachment.

    ValueDescription
    1File
    2Link
  • statusinteger

    Represents the status of the attachment.

    ValueDescription
    0Deleted
    1Active
  • addedByJSON Object

    Represents the details of the user who added the attachment.

  • idnumber

    Represents the unique ID of the user.

  • emailIdstring

    Represents the email address of the user.

  • modifiedByJSON Object

    Represents the details of the user who last modified the attachment.

  • addedTimestring

    Represents the date and time when the file was added in the full format (DD MMM YYYY, h:mm a).

  • addedTimeExtstring

    Represents the date and time when the file was added in the medium format (DD-MMM-YYYY).

  • addedTimeFullstring

    Represents the date and time when the file was added in the long format (EEEE, D MMMM, YYYY h:mm a).

  • modifiedTimestring

    Represents the date and time when the file was modified in the full format (DD MMM YYYY, h:mm a).

  • modifiedTimeExtstring

    Represents the date and time when the file was modified in the medium format (DD-MMM-YYYY).

  • fileJSON Object

    Represents the details of the attached file (such as, File Name, Type, Size).

  • FileIdinteger

    Represents the unique ID of the file.

  • fileVersionIdinteger

    Represents the unique ID of the file version.

  • namestring

    Represents the name of the file.

  • Extensionstring

    Represents the file type(e.g, "pdf").

  • sizeinteger

    Represents the size of the file in bytes.

  • previewURLstring

    Represents the URL to preview the file within the application.

  • viewURLstring

    Represents the URL to directly view the file.

  • linkNamestring

    Represents the display name given to the added link.

  • linkURLstring

    Represents the URL of the added link.

Sample Response

Copied{
  "contractattachments": [
    {
      "contractAttachmentId": "3000000272569",
      "attachmentId": "3000000272567",
      "sequenceNumber": 1,
      "attachmentType": 1,
      "status": 1,
      "source": 1,
      "addedBy": {
        "id": "3000000131411",
        "displayName": "John Smith",
        "emailId": "john.smith@zylker.com"
      },
      "addedTime": "14 Aug 2025, 11:18 PM",
      "addedTimeExt": "14-Aug-2025",
      "addedTimeFull": "Thursday, 14 August, 2025 11:18 PM",
      "modifiedBy": {
        "id": "3000000131411",
        "displayName": "John Smith",
        "emailId": "john.smith@zylker.com"
      },
      "modifiedTime": "14 Aug 2025, 11:18 PM",
      "modifiedTimeExt": "14-Aug-2025",
      "file": {
        "FileId": 3000000272561,
        "fileVersionId": 3000000272563,
        "name": "20240109_174829",
        "Extension": "jpg",
        "size": 994505,
        "Status": 1,
        "previewURL": "https://contracts.zylker.com/preview/contracts/attachments/1234567890002",
        "viewURL": "https://contracts.zylker.com/view/contracts/attachments/1234567890004"
      }
    },
    {
      "contractAttachmentId": "3000000272521",
      "attachmentId": "3000000272519",
      "sequenceNumber": 1,
      "attachmentType": 2,
      "status": 1,
      "addedBy": {
        "id": "3000000131411",
        "displayName": "John Smith",
        "emailId": "john.smith@zylker.com"
      },
      "addedTime": "14 Aug 2025, 11:16 PM",
      "addedTimeExt": "14-Aug-2025",
      "addedTimeFull": "Thursday, 14 August, 2025 11:16 PM",
      "modifiedBy": {
        "id": "3000000131411",
        "displayName": "John Smith",
        "emailId": "john.smith@zylker.com"
      },
      "modifiedTime": "14 Aug 2025, 11:16 PM",
      "modifiedTimeExt": "14-Aug-2025",
      "linkName": "link.com",
      "linkURL": "google.com"
    }
  ]
}

Possible Errors

INVALID_URL_PATTERNHTTP 404

Request URL is incorrect

Resolution: Specify a valid request URL. Refer to the Request URL section above.

OAUTH_SCOPE_MISMATCHHTTP 401

Unauthorized

Resolution: Client does not have contracts.contracts.CREATE scope. Create a new client with valid scope. Refer to the Scope section above.

NO_PERMISSIONHTTP 403

Permission denied to create

Resolution: The user does not have permission to create records. Contact your organization administrator.

INTERNAL_ERRORHTTP 500

Internal Server Error

Resolution: Unexpected and unhandled exception in the server.

INVALID_REQUEST_METHODHTTP 400

The HTTP request method is not a valid one.

Resolution: You have specified an invalid HTTP method to access the API URL. Specify a valid request method. Refer to the Endpoints section above.

AUTHORIZATION_FAILEDHTTP 400

The user does not have sufficient privilege to create module details.

Resolution: The user does not have permission to create module details. Contact your organization administrator.