Delete Collections

4. DELETE COLLECTIONS

URL: https://app.detrack.com/api/v1/collections/delete.json
Limit: 100 collections per request (send separate requests if you are deleting more than 100 collections)
HTTP POST REQUEST

Note: the request structure below is for Method #1: Name/Value Pair (NVP) + JSON String . For Method #2: Custom Header + JSON Body , please refer to the json parameter only.

Parameter Description
key Your API key. You can obtain this from your dashboard.
json The JSON string containing the collections you wish to delete. It should contain an array with the the following fields:

Field Description
date The collection date. Format: YYYY-MM-DD e.g. 2014-02-28. Required field.
do The D.O. #. The D.O. # of the collection to delete. Required field.
HTTP POST RESPONSE (JSON)
Field Description
info Contains information on the status of the request.

Field Description
status The status of the request. The value will be “ok” if request is processed successfully or “failed” if the key or json parameter is missing.
failed The number of collections that are not deleted due to error.
error Contains the error details if the request failed. Note: this field is set only if the request failed.

Field Description
code The error code. Please refer to Collection Error Codes
message The corresponding error message.
results Contains an array of statuses with the following fields:

Field Description
date The date of the collection. Format: YYYY-MM-DD e.g. 2014-02-28
do The D.O. # of the collection.
status The status of the collection delete request. The value will be “ok” if the collection is successfully deleted or “failed” if the collection is not deleted.
errors Contains an array of error messages if the collection delete request failed. Note: this field is set only if the collection delete request failed.

Field Description
code The error code. Please refer to Collection Error Codes
message The corresponding error message.
SAMPLE REQUEST JSON
[
{
"date":"2014-02-13",
"do":"DO140213001"
},
{
"date":"2014-02-13",
"do":"DO140213002"
}
]
SAMPLE RESPONSE JSON #1
{
"info":{
"status":"ok",
"failed":0
},
"results":[
{
"date":"2014-02-13",
"do":"DO140213001",
"status":"ok"
},
{
"date":"2014-02-13",
"do":"DO140213002",
"status":"ok"
}
]
}
SAMPLE RESPONSE JSON #2
{
"info":{
"status":"ok",
"failed":2
},
"results":[
{
"date":"2014-02-13",
"do":"DO140213001",
"status":"failed",
"errors":[
{
"code":1003,
"message":"Collection with D.O. # DO140213001 not found on 2014-02-13."
}
]
},
{
"date":"2014-02-13",
"do":"DO140213002",
"status":"failed",
"errors":[
{
"code":1003,
"message":"Collection with D.O. # DO140213002 not found on 2014-02-13."
}
]
}
]
}