Remove an Asset from a Collection

delete

/documents/api/1.1/collections/{collectionId}/files/{fileId}

Remove the specified asset from the specified collection. If the asset is not a member of the collection, an error is returned.

Request

Supported Media Types
  • application/json
  • application/xml
Path Parameters
collectionId
Type: string
Required: true

Globally unique identifier (GUID) for the collection.

fileId
Type: string
Required: true

Globally unique identifier (GUID) of the asset to be removed from the collection.

Response

Supported Media Types
  • application/json
  • application/xml
200 Response

The request was fulfilled.

Body
Root Schema : CollectionDeleteSingleFileResponse
Example application/json

{
    "errorCode":"0",
    "id":"F072ECEAE8DFE10499D8C160T0000DEFAULT00000000",
    "type":"collection"
}
400 Response

Request parameters are not formatted correctly.

403 Response

User does not have rights to the specified collection.

404 Response

Collection is in the trash or is not found.

Examples

The following example removes 1 asset from a collection.

DELETE .../collections/F5E88D06A5AEC588BDB96A2045B3E9DD649055F5640B/files/D76EE391B7B098777666CBFF45B3E9DD649055F5640B

Request Header

None.

Request Body

None.

HTTP Status Code

HTTP_STATUS = 200

JSON Response

{
    "errorCode": "0",
    "id": "F5E88D06A5AEC588BDB96A2045B3E9DD649055F5640B",
    "type": "collection"
}

Example 2

The following example removes one asset from a collection, but the asset isn't present in the collection.

DELETE .../collections/F5E88D06A5AEC588BDB96A2045B3E9DD649055F5640B/files/D76EE391B7B098777666CBFF45B3E9DD649055F5640B

Request Header

None.

Request Body

None.

HTTP Status Code

HTTP_STATUS = 400

JSON Response

{
    "errorCode": "-96",
    "errorKey": "!csDAMItemNotInCollection,fFileGUID:D76EE391B7B098777666CBFF45B3E9DD649055F5640B,fFolderGUID:F5E88D06A5AEC588BDB96A2045B3E9DD649055F5640B",
    "errorMessage": "Item fFileGUID:D76EE391B7B098777666CBFF45B3E9DD649055F5640B is not a member of collection fFolderGUID:F5E88D06A5AEC588BDB96A2045B3E9DD649055F5640B.",
    "errorType": "collection",
    "id": "F5E88D06A5AEC588BDB96A2045B3E9DD649055F5640B",
    "title": "Item fFileGUID:D76EE391B7B098777666CBFF45B3E9DD649055F5640B is not a member of collection fFolderGUID:F5E88D06A5AEC588BDB96A2045B3E9DD649055F5640B.",
    "type": "https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}

Example 3

In the following example, no items are removed from the collection because the collection is not owned by or shared with the user.

DELETE ..collections/F5D88A8F6F68BB240E3826DA45B3E9DD649052373471/files/F5D88A8F6F68BB240E3826DA45B3E9DD649052373471

Request Header

None.

Request Body

None.

HTTP Status Code

HTTP_STATUS = 404

JSON Response

{
    "errorCode": "-16",
    "errorKey": "!csFldDoesNotExist,fFileGUID:F5D88A8F6F68BB240E3826DA45B3E9DD649052373471",
    "errorMessage": "'fFileGUID:F5D88A8F6F68BB240E3826DA45B3E9DD649052373471' does not exist.",
    "errorType": "collection",
    "id": "F5D88A8F6F68BB240E3826DA45B3E9DD649052373471",
    "title": "'fFileGUID:F5D88A8F6F68BB240E3826DA45B3E9DD649052373471' does not exist.",
    "type": "https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}