Delete a File Attachment

Deletes a file attachment.

Note: For more information about this command, including descriptions of any path and request parameters, request body schema, response codes and schemas, and payload examples, refer to the online API reference for this command at the following web page:

Delete a file attachment

URI

https://bartendercloud.com/api/librarian/attachments/{attachmentId}

Note: The bartendercloud.com domain that is referenced in the URI and in the code example that follows must be replaced with the contents of the DataCenterURI claim that is extracted from your access token. For more information, refer to Extracting the DataCenterURI Claim.

Path Parameters

attachmentId

Type: String

Specifies the ID of the file attachment to delete. Required.

Query Parameters

None.

Example

Request body: See AttachmentDeleteRequest.

Response: System.IO.Stream

Copy
// Assume that attachmentId is the ID of the target attachment.
var client = new HttpClient();
var attachmentDeleteRequest = new AttachmentDeleteRequest() {
Comment = "Delete SQL file Sample attachment"
};
HttpRequestMessage request = new HttpRequestMessage(HttpMethod.Delete, new Uri($"https://bartendercloud.com/api/librarian/attachments/{attachmentId}"))
{
Content = new StringContent(JsonConvert.SerializeObject(attachmentDeleteRequest), Encoding.UTF8, "application/json")
};
HttpResponseMessage msg = await client.SendAsync(request);