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 properly use the Part Studios API's Update Feature endpoint?
ats_nisov
Member, Developers Posts: 1 ✭
I need to update a feature in my model programmatically.
I read https://dev-portal.onshape.com/help for instructions, tried using the
/partstudios/d/:did/w/:wid/e/:eid/features/featureid/:fid endpoint via the API Explorer, but couldn't do it successfully. I get the following response:
What should I do? Are there any examples available? How do I know if my request body has all the required fields? How do I know whether it has bad fields and/or bad values?
Here's my request body: https://gist.github.com/Rubinous/a33eac2eb7aac1cc980ff3c45a98fb47.
I read https://dev-portal.onshape.com/help for instructions, tried using the
/partstudios/d/:did/w/:wid/e/:eid/features/featureid/:fid endpoint via the API Explorer, but couldn't do it successfully. I get the following response:
{ "moreInfoUrl": "", "code": 9999, "message": "Error in input", "status": 400 }The request body is 355 lines, so it's impossible to try to get it right by trial and error. I can't make it any simpler either as the documentation says that it needs to have the same format as what the Get Feature List endpoint gives me, and the
"feature"
field of my request body is exactly copied from what I got from the Get Feature List endpoint, so it should be correct.What should I do? Are there any examples available? How do I know if my request body has all the required fields? How do I know whether it has bad fields and/or bad values?
Here's my request body: https://gist.github.com/Rubinous/a33eac2eb7aac1cc980ff3c45a98fb47.
0
Answers
I have had some success with feature updates but it was simple stuff. Mostly updating an existing parameter. I have had to first get the feature list and find the feature I want to update, then build the json to update that value. You json looks like its trying to create a new sketch.
If you just trying to create a sketch you might have better luck using Feature Script. Its not much more forgiving but its much quicker to iterate on. Start simple and then keep adding in the complexity you need.