Delete Document
Deletes a generated document
Endpoint URL | SDK Method |
---|---|
https://api.inkit.com/v1/document/{documentId} (DELETE) | Document.delete() |
Request properties
Property | Type | Required | Description |
---|---|---|---|
documentId | String | Yes | The ID of a document that was previously generated. |
Response code
204
Example request
# Import the Inkit Python package
import inkit
from inkit.exceptions import InkitResponseException
# Replace the string below with your API key
inkit.api_token = "ENTER YOUR API KEY"
try:
# Delete document
resp = inkit.Document.delete('ENTER YOUR DOCUMENT ID')
# Print the repsonse code of the API call
print(resp.status_code)
except InkitResponseException as err:
# Print any error
print(err.response.data)
// Import the Inkit Node.js package
const Inkit = require("inkit");
// Replace the string below with your API key
Inkit.apiToken = "ENTER YOUR API KEY";
// Call delete document
deleteDocument();
// Delete document
async function deleteDocument() {
try {
const result = await Inkit.Document.delete('ENTER YOUR DOCUMENT ID');
// Print the repsonse code of the API call
console.log(result.status);
} catch (error) {
// Print any error
console.error(error.response.status, error.response.statusText);
}
}
curl --request DELETE \
--url https://api.inkit.com/v1/document/ENTER_YOUR_DOCUMENT_ID \
--header 'X-Inkit-API-Token: ENTER YOUR API KEY'
Updated over 1 year ago