Summary
Allows for deleting an asset from the collection.
URI
https://api.unroole.com/collections/[collection-id]/delete_item
HTTP Method
DELETE / POST
Required Paramaters
Paramater
|
Default
|
Maximum Length
|
Accepted Values
|
Description
|
token
|
|
|
|
API Persistence Token that identifies this user and its permissions.
|
collection_item_id
|
|
|
|
This is the id of the collection item, not the id of the item itself. Refer to API_Collection_Fields for the id of each item in the collection.
|
Response
Examples
these example require jQuery
Delete an item in the collection
Paramater
|
Value
|
token
|
1f0qpLwoV5oIcfnU2yvO
|
collection_item_id
|
20
|
jQuery ajax call
|
$.ajax('http://api.win-tommy.com:3000/collections/1/delete_item?token=1f0qpLwoV5oIcfnU2yvO', {
headers: {
// use below for json request
//Accept : "application/json, text/javascript"
// use below for xml request
Accept : "text/html,application/xhtml+xml,application/xml"
},
type: 'POST',
data: {
collection_item_id: 20
}
});
|
XML
|
<?xml version="1.0" encoding="UTF-8"?>
<hash>
<http-status type="integer">200</http-status>
</hash>
|
Delete an item that is not in the collection
Paramater
|
Value
|
token
|
1f0qpLwoV5oIcfnU2yvO
|
collection_item_id
|
99
|
jQuery ajax call
|
$.ajax('http://api.unroole.com/collections/1/delete_item?token=1f0qpLwoV5oIcfnU2yvO', {
headers: {
// use below for json request
//Accept : "application/json, text/javascript"
// use below for xml request
Accept : "text/html,application/xhtml+xml,application/xml"
},
type: 'POST',
data: {
collection_item_id: 99
}
});
|
JSON
|
{"error":"No such resource","http_status":412}
|
XML
|
<?xml version="1.0" encoding="UTF-8"?>
<hash>
<error>No such resource</error>
<http-status type="integer">412</http-status>
</hash>
|