Here is the code in Zoho Deluge Script
1/ Get the session ID : Working
backEndTicket = "1111111111";
shapeDiverUrl = 'https://sdeuc1.eu-central-1.shapediver.com/';
header_data = Map();
header_data.put("Content-Type","application/json");
//Get a Session ID
session = invokeurl
[
url :shapeDiverUrl + "api/v2/ticket/" + backEndTicket
type :POST
headers:header_data
];
sessionID = session.get("sessionId");
2/ Get Parameters and Exports ID : Working
parametres = session.get("parameters");
for each param in parametres
{
if(param.get("name") == "SHEET_WIDTH")
{
idParamLargeur = param.get("id");
}
if(param.get("name") == "SHEET_HEIGHT")
{
idParamHauteur = param.get("id");
}
if(param.get("name") == "GENERATE_DXF_FILE")
{
idParamGenerateDXFFile = param.get("id");
}
if(param.get("name") == "BOUNDARIE_TOP")
{
idParamBordureHaut = param.get("id");
}
if(param.get("name") == "BOUNDARIE_BOTTOM")
{
idParamBordureBas = param.get("id");
}
if(param.get("name") == "BOUNDARIE_LEFT")
{
idParamBordureGauche = param.get("id");
}
if(param.get("name") == "BOUNDARIE_RIGHT")
{
idParamBordureDroite = param.get("id");
}
}
exports = session.get("exports");
//info exports;
for each export in exports
{
if(export.get("name") == "export_dxf")
{
idExportDXF = export.get("id");
}
if(export.get("name") == "export_pdf")
{
idExportPDF = export.get("id");
}
}
3/ Call the API to generate DXF Export
parameters = Map();
parameters.put(idParamGenerateDXFFile,true);
parameters.put(idParamLargeur,"1200");
parameters.put(idParamHauteur,"800");
parameters.put(idParamBordureHaut,"20");
parameters.put(idParamBordureDroite,"20");
parameters.put(idParamBordureBas,"20");
parameters.put(idParamBordureGauche,"20");
body = Map();
body.put("max_wait_time",3000);
body.put("exports",{"id":idExportDXF});
body.put("parameters",parameters);
generateFile = invokeurl
[
url :shapeDiverUrl + "api/v2/session/" + sessionID + "/export"
type :PUT
parameters:body.toText()
headers:header_data
];
Result of the call
{"version":"2.2.1","actions":[{"name":"default","title":"Default model","href":"https://sdeuc1.eu-central-1.shapediver.com/api/v2/session/f6623fab-c5e9-4831-a953-5edd277ab60d/default","method":"GET"},{"name":"close","title":"Close session","href":"https://sdeuc1.eu-central-1.shapediver.com/api/v2/session/f6623fab-c5e9-4831-a953-5edd277ab60d/close","method":"POST"},{"name":"export-cache","title":"Get cached export","href":"https://sdeuc1.eu-central-1.shapediver.com/api/v2/session/f6623fab-c5e9-4831-a953-5edd277ab60d/export/cache","template":"export-cache-request","method":"PUT"}],"exports":{"71d70e484a4b796a871fd69511ce3b8c":{"id":"71d70e484a4b796a871fd69511ce3b8c","name":"export_dxf","type":"download","uid":"53ec9f8684f03f3ad78f909ef8e9a4fe","version":"e056c66e466d86dc09d3e1e67dc5349a","order":0,"tooltip":"","displayname":"","hidden":false,"status_computation":"success","status_collect":"success","filename":"SPM20028-AGREGA-1200x800","content":[{"href":"https://sdeuc1.eu-central-1.shapediver.com/api/v2/session/f6623fab-c5e9-4831-a953-5edd277ab60d/export/2cdbeee73db9f9935ce2d80f8860be3d5efe41f3aa0bf29e1e7ff8fad7ab3b9769a02f46f7382cf84cf3547b7d57233d19a8e2b084b49c92d9823a0b716f26f19fba542cd2ee25155b2f21d8aa93f659c43082c79b743c66a15b01d219514c4321c94a4ea257856fa8c14549cc2257034ffafeda6696ede8fb6d0201c673cf759564a6ebc88a1592db0a12c05df31cd16168cd3c2d30db02c0647502f1f7929147-66363632336661622d633565392d3438","size":408536,"format":"dxf"}]}}}
The document is well generated, but when I open the given href in a window, it says
{“error”:“SdJwtValidationError”,“desc”:“Generic jwt validation error”,“message”:“Invalid token”}