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.

Documentation for btTypes

John_MorrisJohn_Morris Member Posts: 5

I'm looking for documentation on the various btTypes asked for by the Onshape API. Many of the API guides (such as here and here) are explicit that a given feature requires a specific btType, but the only help I've seen in learning the specific types is to make a feature, and then get a list of features from the API (recommended here and here). This seems slow and difficult to me. Can anyone point out a source describing what each btType is?

Tagged:

Best Answer

  • Konst_ShKonst_Sh Member Posts: 54 PRO
    Answer ✓

    the openapi endpoint can return you a schema, it is pretty much the most comprehensive source of api info. If you lucky enough you can try to generate from it the api client for the framework of your choice. Or at least generate api response class library. I was only able to do it with partial success using this online tool: https://editor.swagger.io/

    It was usable after some manual cleanup and had the polymorphic json attributes based on extracted btType discriminators

    https://cad.onshape.com/glassworks/explorer/#/OpenApi/getOpenApi

Answers

  • Konst_ShKonst_Sh Member Posts: 54 PRO
    Answer ✓

    the openapi endpoint can return you a schema, it is pretty much the most comprehensive source of api info. If you lucky enough you can try to generate from it the api client for the framework of your choice. Or at least generate api response class library. I was only able to do it with partial success using this online tool: https://editor.swagger.io/

    It was usable after some manual cleanup and had the polymorphic json attributes based on extracted btType discriminators

    https://cad.onshape.com/glassworks/explorer/#/OpenApi/getOpenApi

  • John_MorrisJohn_Morris Member Posts: 5

    Thanks Konst_Sh, your answer led me to find the schema, so I'll mark it as correct. Just for clarity though, the endpoint is <https://cad.onshape.com/api/openapi>, and the schema is also on glassworks (but unexpanded and at the bottom of the page, I had completely missed it!).

Sign In or Register to comment.