I am able to accomplish all steps to upload Revit files and translate and load in viewer. I am now trying to download the translated SVG/SVF for offline viewing. I found reference to the following endpoint and tested it out with this:
function download(){
var uri = 'https://developer.api.autodesk.com/derivativeservice/v2/derivatives/<<urn>>' ;
var authorizationHeader = 'Bearer <<token>>'
request.get(
{
url: uri,
headers:
{
'Authorization': authorizationHeader,
'Accept-Encoding': 'gzip, deflate'
},
},
function(error, response, body){
if(!error){
console.log(body);
}else{
console.log(error);
}
});
}
API returns:
{"diagnostic":"Derivative api only supports adsk.viewing & adsk.objects urn"}
The urn should be url-encoded, not base64 encoded.
There are several steps if you desire to grab all the required files for offline viewing. Start by checking the downloadBubble method (node.js) in extract project:
Test it live at https://extract.autodesk.io