Documents Deletion
There is a possibility to delete documents in draft objects such as plan, tender, bid.
Delete document tutorial
For deletion document in tender we should use an API endpoint with particular document id from tender:
Request
DELETE /api/2.5/tenders/f135bade563d49fc9233e1f1d37fdcf0/documents/292d5babf89340e3b3e16e0635048e96?acc_token=dc92946b9e4b4ea583fcb7d1136d6cc8 HTTP/1.0
Authorization: Bearer broker
Host: lb-api-sandbox.prozorro.gov.ua
Response
HTTP/1.0 200 OK
Content-Type: application/json
{
"data": {
"confidentiality": "public",
"description": "Нова версія документу",
"description_en": "new version of the document",
"hash": "md5:11111111111111111111111111111111",
"title": "TestDoc.pdf",
"format": "application/msword",
"url": "http://public-docs-sandbox.prozorro.gov.ua/get/71a2b13345a846bf980d2a1b67d4239c?Signature=H0TkwyUeTP9GPM01R6%2BBzl1EO7RtatBFpseE2jRyRUKJHZ2TtySZ4pjaEeDdkxc1flRDO02fARq2GtztkbYrBg%3D%3D&KeyID=a8968c46",
"documentOf": "tender",
"language": "uk",
"id": "292d5babf89340e3b3e16e0635048e96",
"datePublished": "2023-10-10T01:00:00+03:00",
"dateModified": "2023-10-10T01:00:00+03:00",
"author": "tender_owner"
}
}
Let’s try to delete document in not draft tender and we will see an error:
Request
DELETE /api/2.5/tenders/f135bade563d49fc9233e1f1d37fdcf0/documents/c8d64dfb8acb418297db4b41a849885f?acc_token=dc92946b9e4b4ea583fcb7d1136d6cc8 HTTP/1.0
Authorization: Bearer broker
Host: lb-api-sandbox.prozorro.gov.ua
Response
HTTP/1.0 403 Forbidden
Content-Type: application/json
{
"status": "error",
"errors": [
{
"location": "body",
"name": "data",
"description": "Can't delete document when tender in current (active.enquiries) status"
}
]
}