PUT: Update an attachment

An attachment instance has both entity and binary data. The properties of an attachment instance are represented by data in JSON format.

Attachment instances are members of attachment collections. See Attachments.

To update the attachment resource for an attachment entity, use the URI for the attachment collection with the attachment entity ID appended.

Note: To update the binary content of the attachment, use DELETE existing and POST new.

Example: /attachments/50, where 50 is the attachment ID.

Example of updating an attachment entity instance

The PUT request on attachments updates only the entity data of the attachment, without the binary content of the attachment.

*** Request ***
PUT .../api/shared_spaces/<shared_space_id>/workspaces/1002/attachments
{
    "data": [
        {
            "type": "attachment",
            "description": “This is the new description for the attachment.”,
            "id": ​"1001"
        }
    ]
 
}
*** Response ***
{
  "total_count": 1,
  "data": [
    {
      "type": "attachment",
      "creation_time": "2016-10-30T08:09:21Z",
      "version_stamp": 2,
      "author": {
        "type": "workspace_user",
        "full_name": "TheUser@TheCompany",
        "name": "TheUser@TheCompany",
        "id": "1001"
      },
      "name": "TheFile.zip",
      "description": "This is the new description for the attachment.",
      "id": "1001",
      "last_modified": "2016-10-30T11:47:16Z"
    }
  ],
  "exceeds_total_count": false
}

Back to top

See also: