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 to copy an onshape public document using the api and then get the new url of the document?
md_ferdous_alam
Member Posts: 5 EDU
Hi, I am new to Onshape and need to the following. If I have a public document (such as https://cad.onshape.com/documents/b33a147f86da49879455d286/w/bfdeeceb44a140cfae14fdd1/e/c26b2860c5d143a6a1414663), how can I use the api to make a copy of this and get the new url so I can modify it? I can do this using the UI but I need to do this in a python script using the api. I tried the glasswork explorer but it is giving me bad-request. Any help would be much appreciated.
0
Answers
The sample request in glassworks has some extra fields that aren't required.
To copy that public document you should only need to do:
https://cad.onshape.com/api/documents/b33a147f86da49879455d286/w/bfdeeceb44a140cfae14fdd1/copy
with a body:
{"newName":"my new document name","isPublic":false}