How do I export a configured part studio via translations?
I have a configurable part studio. I want to be able to make changes to the configuration and export the configured part studio to different formats through the API, but I keep getting an error from the translations endpoint (https://cad.onshape.com/glassworks/explorer/#/PartStudio/createPartStudioTranslation) when I try to include my configuration string.
// POST body
{
"configuration": "<my_configuration_string>",
"formatName": "STEP" // would like to support a variety of formats
}
// Response body
{
"moreInfoUrl": "",
"message": "An illegal argument was provided, check your request.",
"code": 0,
"status": 400
}
If I take that exact same configuration string and provide it to the part-studio-to-gltf endpoint (https://cad.onshape.com/glassworks/explorer/#/PartStudio/exportPartStudioGltf), the output reflects the configuration as expected, so I am confident that the configuration string is not malformed. Is there something else that I need to provide to the translations endpoint? Does it not support configurations? The documentation about exporting configured parts is… underwhelming; it only shows a single example using the dedicated part-studio-to-parasolid endpoint, and the error message from the API doesn't give a whole lot of clues for what the problem is.
Answers
-
If you open up your console in your browser while initiating an export, you can snoop into exactly how the onshape system structured its url, parameters and body. This doesn't work with all onshape actions as a lot of the calls are being made server side. In the case of the translations endpoint however, the call is being exposed to the console.
0
