Remove an Asset from a Collection
/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
- application/json
- application/xml
- collectionId
-
Type:
stringRequired:trueGlobally unique identifier (GUID) for the collection.
- fileId
-
Type:
stringRequired:trueGlobally unique identifier (GUID) of the asset to be removed from the collection.
Response
- application/json
- application/xml
The request was fulfilled.
- errorCode
-
Type:
stringAn error code of zero (0) indicates no errors. - id
-
Type:
stringThe collection ID. - type
-
Type:
stringItem typecollection.
Example application/json
{
"errorCode":"0",
"id":"F072ECEAE8DFE10499D8C160T0000DEFAULT00000000",
"type":"collection"
}
Request parameters are not formatted correctly.
User does not have rights to the specified collection.
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"
}