Welcome to the Onshape forum! Ask questions and join in the discussions about everything Onshape.
First time visiting? Here are some places to start:- Looking for a certain topic? Check out the categories filter or use Search (upper right).
- Need support? Ask a question to our Community Support category.
- Please submit support tickets for bugs but you can request improvements in the Product Feedback category.
- Be respectful, on topic and if you see a problem, Flag it.
If you would like to contact our Community Manager personally, feel free to send a private message or an email.
How does the createTranslation API work?
md_al_mamun316
Member Posts: 13 EDU
Hi, I'm trying to execute an API call to create a translation for my .step file to create a Single Part Studio in a new a tab of the document from Django backend. Unfortunately there is not much documentation for this call, the only thing explaining how to do it I've found here and it says the following:
"The file is uploaded as multipart form data. Each of the API parameters is a separate field in the multipart upload.
The two required fields are “file” and “formatName”. The file part must contain the upload and should normally have
a filename attribute set. The filename attribute can be omitted if the form data also has an encodedFilename field
that contains the filename in URL-encoded form."
I am trying to do so, but in Django I get "Bad request" message and even in Glassworks I get
{
"message": "Untranslatable format",
"moreInfoUrl": "",
"status": 400,
"code": 0
}
"message": "Untranslatable format",
"moreInfoUrl": "",
"status": 400,
"code": 0
}
I'm sure that the file is correct and it can be successfully translated in a single part studio manually.
How should I create a request body or is there any better way to solve the problem? I also tried with '?storeInDocument=True&formatName=STEP&translate=True', but the response is the same..
Thanks in advance.
Tagged:
0
Best Answer
-
caden_armstrong2 Member, User Group Leader Posts: 127 ✭✭✭I've never had luck getting the /translation endpoint to work for uploading files.
I always use the /api/blobelements to upload files and do translation
0
Answers
I always use the /api/blobelements to upload files and do translation