Geometry Backend - Export Error - Generic jwt validation error

Hello,

I’m using the new Geometry backend API to export documents from ShapeDiver but I’m having Trouble

1/ I managed to get a session ID throw
https://sdeuc1.eu-central-1.shapediver.com/api/v2/ticket/MyBackEndTicket

2/ I managed to get parameters and exports ids

3/ When I PUT the API to get export file, I do get an url, but it says
{“error”:“SdJwtValidationError”,“desc”:“Generic jwt validation error”,“message”:“Invalid token”}

URL : “https://sdeuc1.eu-central-1.shapediver.com/api/v2/session/” + sessionID + “/export”
Body :

{"max_wait_time":3000,"exports":{"id":"71d70e484a4b796a871fd69511ce3b8c"},"parameters":{"f7f219f5-f689-427e-8347-e3a46f9da2e2":true,"fff48e91-f893-4734-95c2-244c33213f16":"1200","c3965391-e3ab-47fc-943e-b395a461b2df":"800","3bc2c306-bd31-4967-b141-8226a813de8b":"20","bd44d071-8f5f-49cd-a0a1-02b778210438":"20","d4620a17-e114-4a42-9a97-218a90aeb779":"20","5101238b-d91f-43cb-805f-459535f48458":"20"}}

Result URL : https://sdeuc1.eu-central-1.shapediver.com/api/v2/session/1791329b-90aa-4153-8855-b3ef8ffd1f1c/export/1ee050411ab02244456f02cd7e4be8ed9bf6dd8e57277aad2377cfa483c311785cdaa6a4a6739342c7edb9b8c8b37b3ca8399efb55cd3c3c173d2ca3832953d62b76752c58e313aba9633a9c7c2b73783897bc4c4e3cb3285d6e7aca0e03f02d5d5ac3da9188ec713ea9cf9ad653f2243259afbae8c0a4aaca66750bcec7b47e803f86e146554b42a22a0488bf50fd65720617decd8b2150eaf2c5d1ca85e55f46-31373931333239622d393061612d3431

ALSO, you have en error in your documentation : Geometry Backend


Should be /export instead of /output

What do I have to do about JWT validation error?
Thanks

Which request is it that fails with this error? Please send an example of the code you are using.

Many thanks for the hint! The fix will be deployed later today.

The error appears when I try to open the URL of the generated document :

https://sdeuc1.eu-central-1.shapediver.com/api/v2/session/1791329b-90aa-4153-8855-b3ef8ffd1f1c/export/1ee050411ab02244456f02cd7e4be8ed9bf6dd8e57277aad2377cfa483c311785cdaa6a4a6739342c7edb9b8c8b37b3ca8399efb55cd3c3c173d2ca3832953d62b76752c58e313aba9633a9c7c2b73783897bc4c4e3cb3285d6e7aca0e03f02d5d5ac3da9188ec713ea9cf9ad653f2243259afbae8c0a4aaca66750bcec7b47e803f86e146554b42a22a0488bf50fd65720617decd8b2150eaf2c5d1ca85e55f46-31373931333239622d393061612d3431

@olivia3 it’s unclear to me why you would get a SdJwtValidationError error when accessing the download link. Please share the code you use to make the request, at least the relevant pieces.

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”}

I just found something very strange.

The export of the document is not working on Chrome but working on Firefox…
I have the same from another ShapeDiver, when I use directly from the platform…
So the problem is not in my code.

On a same ShapeDiver file, my collegue (with same login) can download DXF on Chrome, me not.
Only working on Firefox

That’s very strange !

It was working well before

Olivia

Please let me know whether I understood correctly:

  • The download link is working fine when you use it in Firefox
  • The download link is working fine for your colleague in Chrome
  • It is not working for you in Chrome

Maybe your Chrome is including an Authorization header as part of the request to download the exported file. I am not sure why it would do that, but that would explain the problem. You can debug this using the network tab of Chrome’s developer tools.