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.
Performing a search query through the API
shawn_crocker
Member, OS Professional Posts: 865 PRO
When I do this, I have been able to get this end point to work.
https://cad.onshape.com/api/v5/documents?nodeId=1&q=_all:P0803&resourceType=filter
This seems to search through all of onshape and not just in my company or "my onshape". Also, I cannot seem to get any other q parameters to work. I try using state, or when and I get no items returned. Is there a better endpoint to be using for this. I'm also finding that the returned items do not really contain useful information like id's to construct a url or a premade url. Anyone able to enlighten me on this. I am not seeing anything about this in the glassworks browser.
https://cad.onshape.com/api/v5/documents?nodeId=1&q=_all:P0803&resourceType=filter
This seems to search through all of onshape and not just in my company or "my onshape". Also, I cannot seem to get any other q parameters to work. I try using state, or when and I get no items returned. Is there a better endpoint to be using for this. I'm also finding that the returned items do not really contain useful information like id's to construct a url or a premade url. Anyone able to enlighten me on this. I am not seeing anything about this in the glassworks browser.
0
Best Answer
-
pmd Member, Developers Posts: 63 PROI looked at some python code I wrote a few years ago using the old (pre-v5) API and it did:
dest = f"/api/documents?q={searchterm}&filter=7&owner={company_id}"
The old API Explorer explained that filter=7 meant restrict to company docs but the new glassworks browser does not seem to show this info.0
Answers
The old API Explorer explained that filter=7 meant restrict to company docs but the new glassworks browser does not seem to show this info.
I haven't had time yet to experiment but I am getting strong feelings "ownerId": "string", is where the companies ID is to go.