I want to be able to delete files from the Autodesk Viewer. When I delete them - I want them to disappear from my dropdown and not appear as "Model not translated".
I was using the code from this tutorial - /.
For context, I tried to download models and the solution I found was:
service.downloadObject = async (urn) => {
const { access_token } = await service.getInternalToken();
let decodedUrn = Buffer.from(urn, "base64").toString("utf8");
let urnParts = decodedUrn
.replace("urn:adsk.objects:os.object:", "")
.split("/");
let bucketKey = urnParts[0];
let objectKey = urnParts[1];
try {
const response = await fetch(
`/${bucketKey}/objects/${objectKey}/signeds3download`,
{
method: "GET",
headers: {
Authorization: `Bearer ${access_token}`,
},
}
);
const data = await response.json();
return data.url;
} catch (err) {
console.error("Error fetching download URL:", err);
throw new Error("Failed to retrieve download URL.");
}
};
Initially, I tried with let response = await ossClient.signedS3Download(bucketKey, objectKey, { accessToken });
for downloading models which gave me a 401 Unauthorized
Error.
Could I please get some help creating a similar method to completely delete models?
Thank you!