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.

where is the JSON returned by the API documented

evan_drumwrightevan_drumwright Member Posts: 4
edited August 26 in Community Support

I'm trying to export from onshape to URDF/SDF for import into a Drake simulation (https://drake.mit.edu). I've been attempting to use this tool (https://github.com/Rhoban/onshape-to-robot) but it has some bugs: when loading in my assembly exported to an SDF, the joints are in the wrong location, and when my loading my assembly exported to a URDF, links have the wrong 3D pose aka 3D transformation. The onshape-to-robot developers do not seem responsive, so I'm attempting to get this working myself but have been unable to locate documentation for the JSON description for the assembly features returned through the onshape API.
Is the documentation describing the JSON returned by the API hiding in plain sight?

Answers

  • Matt_ShieldsMatt_Shields Member, Onshape Employees Posts: 453

    Have you checked out Glassworks and the API docs?

  • evan_drumwrightevan_drumwright Member Posts: 4

    I have. Under the former, I see, for instance (clicking under "Assembly" and then "features", a whole lot of JSON, e.g.:

    {  "btType": "BTAssemblyFeatureListResponse-1174",  "libraryVersion": 0,  "microversionSkew": true,  "rejectMicroversionSkew": true,  "serializationVersion": "string",  "sourceMicroversion": "string",  "featureStates": {    "additionalProp1": {      "btType": "string",      "featureStatus": "OK",      "inactive": true    },    "additionalProp2": {      "btType": "string",      "featureStatus": "OK",      "inactive": true    },    "additionalProp3": {      "btType": "string",      "featureStatus": "OK",      "inactive": true    }  },  "features": [    {      "btType": "BTMAssemblyFeature-887",      "featureId": "string",      "featureType": "string",      "name": "string",      "namespace": "string",      "nodeId": "string",      "parameters": [        {          "nodeId": "string",          "parameterId": "string"        }      ],      "returnAfterSubfeatures": true,      "subFeatures": [        "string"      ],      "suppressed": true,      "suppressionConfigured": true,      "variableStudioReference": true,      "auxiliaryTreeFeature": true,      "featureFolder": true,      "featureListFieldIndex": 0,      "fieldIndexForOwnedMateConnectors": 0,      "occurrenceQueriesFromAllConfigurations": [        {          "btType": "BTMIndividualQueryWithOccurrenceBase-904",          "nodeId": "string",          "deterministicIdList": "string",          "deterministicIds": [            "string"          ],          "generateSectionEntityQuery": true,          "generatedSectionQueryId": "string",          "query": "string",          "queryString": "string",          "fullPathAsString": "string",          "occurrence": {            "fullPathAsString": "string",            "headInstanceId": "string",            "occurrenceWithoutHead": "string",            "occurrenceWithoutTail": "string",            "parent": "string",            "path": [              "string"            ],            "rootOccurrence": true,            "tailInstanceId": "string"          },          "path": [            "string"          ]        }      ],      "parametricInstanceFeature": true,      "version": 0    }  ],  "isComplete": true}
    

    (apologies for the compact representation of this output)

    And in the latter, I see various helpful things like, getting started, intro to the REST API, etc. But I'm not finding the documentation for- in the JSON above- the meaning of "parametricInstanceFeature", "featureListFieldIndex", "deterministicIds", etc. I feel like it must be in an obvious place, but I'm still not seeing it.

  • Paul_J_PremakumarPaul_J_Premakumar Member, Onshape Employees Posts: 220

    @evan_drumwright ,

    The documentation for the response is accessible via the "schema" option. In the responses section → click on Schema → Click on the > to expand

    We are continuously working on improving our API documentation & you may not find all the fields documented.

  • susan_pedicinisusan_pedicini Member, Onshape Employees Posts: 3

    Hi @evan_drumwright ! You can find instructions for viewing response body docs here: https://onshape-public.github.io/docs/api-intro/explorer/#view-response-body-docs

    Let me know if there's anything else regarding Glassworks navigation that would be helpful for that page.

Sign In or Register to comment.