Associate File/Folder to Data Template

Open in ChatGPT Open in ChatGPT to ask questions about this page
Open in Claude Open in Claude to ask questions about this page
Copy as MarkdownCopy this page as markdown to use with AI assistants
View as Markdown Open this page as markdown in a new tab

This API helps in associating a single file or folder with a specific data template.

Endpoints

OAuth Scope

WorkDrive.datatemplates.CREATECopied!

Request Example

cURL
cURL
Deluge
Copied!
curl --request POST \
  --url https://www.zohoapis.com/workdrive/api/v1/custommetadata \
  --header 'Authorization: Zoho-oauthtoken d92d4xxxxxxxxxxxxx15f52' \
  --header 'content-type: application/vnd.api+json' \
  --data '{"data":{"attributes":{"data_template_id":"nrkroc4c5f3259e2a410da17c3915ea990dde-24000000581001","resource_id":"nrkrocca1fef45ba243319cb8643393b6b52b","custom_data":[{"custom_field_id":"nrkroc4c5f3259e2a410da17c3915ea990dde-MjQwMDAwMDA1ODEwMDEtMjQwMDAwMDA1ODIwMDE","value":"John"},{"custom_field_id":"nrkroc4c5f3259e2a410da17c3915ea990dde-MjQwMDAwMDA1ODEwMDEtMjQwMDAwMDA1ODIwMDI","value":"Developer"}]},"type":"custommetadata"}}'

Request Body

application/vnd.api+json
dataJSON Object(Required)
Hide Sub-Attributes
attributesJSON Object(Required)
Hide Sub-Attributes
data_template_idstring(Required)

A unique ID of the data template.

resource_idstring(Required)

A unique ID of the file or folder.

custom_dataJSON Array(Required)

List of custom fields with value.

Refer to this table for the value formats supported in the custom field types.

Show Sub-Attributes
custom_field_idstring(Optional)

A unique ID of the custom field.

valuestring(Optional)

The value assigned to the custom field.

typestring(Required)

The JSON:API resource type. Always "custommetadata".

Allowed Values :
Show Values
custommetadataCopied!
Copied!Copy all as JSON Array

Body Parameters

Copied!
  {
    "data": {
      "attributes": {
        "data_template_id": "nrkroc4c5f3259e2a410da17c3915ea990dde-24000000581001",
        "resource_id": "nrkrocca1fef45ba243319cb8643393b6b52b",
        "custom_data": [
          {
            "custom_field_id": "nrkroc4c5f3259e2a410da17c3915ea990dde-MjQwMDAwMDA1ODEwMDEtMjQwMDAwMDA1ODIwMDE",
            "value": "John"
          },
          {
            "custom_field_id": "nrkroc4c5f3259e2a410da17c3915ea990dde-MjQwMDAwMDA1ODEwMDEtMjQwMDAwMDA1ODIwMDI",
            "value": "Developer"
          }
        ]
      },
      "type": "custommetadata"
    }
  }
                
Show full

Response Example

CF014

CF014

CF015

CF026

CF005

CF016

CF006

CF017

CF007

CF018

CF029

CF008

CF009

F000

CF021

CF022

CF013

CF024

CF057

200
200
201
207
500
Copied!
  {
    "data": {
      "id": "nrkrocca1fef45ba243319cb8643393b6b52b-24000000581001",
      "type": "custommetadata",
      "attributes": {
        "data_template_id": "nrkroc4c5f3259e2a410da17c3915ea990dde-24000000581001",
        "name": "Recruitment - 2021",
        "description": "Associate files and folders of all candidates registered for recruitment in 2021",
        "resource_id": "nrkrocca1fef45ba243319cb8643393b6b52b",
        "custom_data": [
          {
            "custom_field_id": "nrkrocca1fef45ba243319cb8643393b6b52b-MjQwMDAwMDA1ODEwMDEtMjQwMDAwMDA1ODIwMDE",
            "display_name": "Candidate Name",
            "type": "text",
            "column_name": "CF60",
            "field_properties": {
              "description": "Name of the candidate",
              "is_mandatory": true,
              "default_value": "",
              "max_char_length": "50"
            },
            "value": "John",
            "index": 0
          },
          {
            "custom_field_id": "nrkrocca1fef45ba243319cb8643393b6b52b-MjQwMDAwMDA1ODEwMDEtMjQwMDAwMDA1ODIwMDI",
            "display_name": "Candidate Role",
            "type": "dropdown",
            "column_name": "CF61",
            "field_properties": {
              "description": "Role of the candidate",
              "is_mandatory": false,
              "default_value": ""
            },
            "value": "Developer",
            "index": 1,
            "choices": [
              {
                "key": "Developer"
              },
              {
                "key": "Designer"
              },
              {
                "key": "Marketer"
              }
            ]
          }
        ],
        "is_associated_without_cf": false,
        "status": true
      },
      "links": {
        "self": "https://www.zohoapis.com/workdrive/api/v1/custommetadata/nrkrocca1fef45ba243319cb8643393b6b52b-24000000581001"
      }
    }
  }
                
  {
    "data_template_id": "string",
    "capabilities": {
      "canMove": true,
      "canEditComment": true,
      "canShowActiveWorkflowInstance": true,
      "canTrash": true,
      "canCheckout": true,
      "canFavourite": true,
      "canCreateGroup": true,
      "canDelete": true,
      "canTrashFiles": true,
      "canShowAccessStats": true,
      "canLeave": true,
      "canFavorite": true,
      "canShare": true,
      "canRestore": true,
      "canHaveOrgTemplates": true,
      "canDeleteComment": true,
      "canRemoveShare": true,
      "canCheckin": true,
      "canCreateFiles": true,
      "canUploadFiles": true,
      "canAssociateDataTemplate": true,
      "canCustomize": true,
      "canCreateTask": true,
      "canConfigureWorkflow": true,
      "canAccessMyfolder": true,
      "canEmailattach": true,
      "canDiscardCheckout": true,
      "canRead": true,
      "canReadComment": true,
      "canEdit": true,
      "canRename": true,
      "canZip": true,
      "hasAppPermissionAlone": true,
      "canSnooze": true,
      "canReplytoComment": true,
      "canSync": true,
      "canShareFiles": true,
      "canCancelCheckout": true,
      "canMarkAsFinal": true,
      "canMandateDataTemplate": true,
      "canCreateComment": true,
      "canCopy": true,
      "canPublish": true,
      "canDownload": true,
      "canJoin": true,
      "canDelistFile": true,
      "canPartialRead": true,
      "canShareSupport": true,
      "canShowActivity": true,
      "canLabel": true,
      "canDiassociate": true,
      "canShowWorkflowBlueprint": true,
      "canAbortWorkflow": true,
      "canResolveComment": true,
      "canManage": true,
      "canAddMembers": true,
      "canOpenWithAddons": true
    },
    "cursorLink": {
      "cursor": {
        "next": "string",
        "hasNext": true
      }
    },
    "can_add_or_update": true,
    "custommetadata_id": "string",
    "name": "string",
    "resource_id": "string",
    "description": "string",
    "dataTemplateType": 0,
    "custom_data": [
      {
        "data_template_id": "string",
        "apiName": "string",
        "cursorLink": {
          "cursor": {
            "next": "string",
            "hasNext": true
          }
        },
        "reorder_choices": [
          {
            "value": "string",
            "operation": "string",
            "key": "string"
          }
        ],
        "custom_field_id": "string",
        "column_name": "string",
        "index": 0,
        "display_name": "string",
        "type": "string",
        "field_properties": {
          "min_value": "string",
          "max_char_length": "string",
          "allowedDate": {
            "fromDate": 0,
            "toDate": 0,
            "allowedDateType": "string"
          },
          "description": "string",
          "is_mandatory": true,
          "default_value": "string",
          "isSearchable": true,
          "max_value": "string"
        },
        "multiEmailAdditionalInfo": [
          {
            "avatarUrl": "string",
            "displayName": "string",
            "emailId": "string",
            "userId": "string"
          }
        ],
        "isSearchableFieldUpdateInProgress": true,
        "options": [
          "string"
        ],
        "emailAdditionalInfo": {
          "avatarUrl": "string",
          "displayName": "string",
          "emailId": "string",
          "userId": "string"
        },
        "choices": [
          {
            "value": "string",
            "operation": "string",
            "key": "string"
          }
        ],
        "value": "string"
      }
    ],
    "status": true,
    "is_associated_without_cf": true
  }
                
207 Multi-Status
  {
    "errors": [
      {
        "id": "CF014",
        "title": "Value is not a valid phone_number"
      }
    ]
  }
                
  {
    "errors": [
      {
        "id": "CF015",
        "title": "Value is not a valid format"
      }
    ]
  }
                
  {
    "errors": [
      {
        "id": "CF026",
        "title": "String is not allowed"
      }
    ]
  }
                
  {
    "errors": [
      {
        "id": "CF005",
        "title": "Only custom fields of the same data template can be updated"
      }
    ]
  }
                
  {
    "errors": [
      {
        "id": "CF016",
        "title": "File is not in active state"
      }
    ]
  }
                
  {
    "errors": [
      {
        "id": "CF006",
        "title": "Duplicate or null options are not allowed"
      }
    ]
  }
                
  {
    "errors": [
      {
        "id": "CF017",
        "title": "Value is not present in options"
      }
    ]
  }
                
  {
    "errors": [
      {
        "id": "CF007",
        "title": "Mandatory field should not be empty"
      }
    ]
  }
                
  {
    "errors": [
      {
        "id": "CF018",
        "title": "Properties values for this type is mismatched"
      }
    ]
  }
                
  {
    "errors": [
      {
        "id": "CF029",
        "title": "Paranthesis is not balanced with operator"
      }
    ]
  }
                
  {
    "errors": [
      {
        "id": "CF008",
        "title": "Value is minimum from the given range"
      }
    ]
  }
                
  {
    "errors": [
      {
        "id": "CF009",
        "title": "Value exceeds from the given range"
      }
    ]
  }
                
  {
    "errors": [
      {
        "id": "F000",
        "title": "General Exception"
      }
    ]
  }
                
  {
    "errors": [
      {
        "id": "CF021",
        "title": "Value length exceeds from the maxCharLength"
      }
    ]
  }
                
  {
    "errors": [
      {
        "id": "CF022",
        "title": "Value is not of yes or no type"
      }
    ]
  }
                
  {
    "errors": [
      {
        "id": "CF013",
        "title": "Value is not a valid email address"
      }
    ]
  }
                
  {
    "errors": [
      {
        "id": "CF024",
        "title": "Only custom fields of the same data template can be allowed"
      }
    ]
  }
                
  {
    "errors": [
      {
        "id": "CF057",
        "title": "Max template for a resource reached"
      }
    ]
  }
                
Show full