Welcome to the Onshape forum! Ask questions and join in the discussions about everything Onshape.

First time visiting? Here are some places to start:
  1. Looking for a certain topic? Check out the categories filter or use Search (upper right).
  2. Need support? Ask a question to our Community Support category.
  3. Please submit support tickets for bugs but you can request improvements in the Product Feedback category.
  4. 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.

Options

Adding part to assembly via API

johannes_3000johannes_3000 Member Posts: 4

I am trying to add an assembly into another assembly via API. Trying out the REST call in glassworks i get an error saying i am using a microversion even though i am using a version:

This is the document I am pasting:

https://cad.onshape.com/documents/ba1fece8e8480bb1fa5c2089/v/6d2dabf62ee2588360f457fe/e/ab51836df1310fcc7922ea92


Error: response status is 400

Response body

Download

{  "message": "Microversions may not be used with linked document references",  "status": 400,  "code": 9999,  "moreInfoUrl": ""}

I also don't understand how that API call should work since it only specifies one part/assembly. Is it the target or the payload?

I also have tried the same in python wihtout success but thats a different topic. Lets get this glassworks example working first. Any pointers welcome, thank you!

Comments

  • Caden_ArmstrongCaden_Armstrong Member Posts: 287 PRO

    It would help to know the body you are using for your request. Your body is probably the problem.
    I know you can do it with just:

    documentId
    versionId
    elementId
    isWholePartStudio=false
    isAssembly=true
    configuration={config if applicable}

    You might be adding extra parameters that you don't need to add. The API can be a bit fussy if you include unnecessary parameters

    www.smartbenchsoftware.com --- fs.place --- Renaissance
    Custom FeatureScript and Onshape Integrated Applications
Sign In or Register to comment.