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 do the query parameters in Action URLs work for Onshape Extensions

Hello,
I've been working on getting an Onshape extension working and have now managed to have the auth working. My next question to tackle is how to determine the documentId, workspace/version Id, and element Id of the page from which the extension is launched. The "Create an Extension" Onshape tutorial indicates that this can be done by supplying the query parameters to your action URL, such as https://ourserver.com/bom?documentId=${documentid}&elementId=${elementid}&partId={$partId}&partNumber={$partNumber}
. This does not seem to be working for me, however, with the ${} variables not being filled in. Is this still the correct way to do this, and if so, is there more information on what the other "Context" selections can supply? I notice the image included in the "Create an Extension" tutorial seems to be a bit old, the current selections for "Context" in an extension are provided in the image below.
Best Answer
-
Caden_Armstrong Member Posts: 263 PRO
This is still the correct method for passing context information.
There is a full list of options in the Action URL section of this page:
https://onshape-public.github.io/docs/app-dev/extensions/
I think they might be case sensitive, so ${documentId} and ${documentid} are different, with the first one being what I use in my apps.www.smartbenchsoftware.com --- fs.place --- Renaissance
Custom FeatureScript and Onshape Integrated Applications0
Answers
This is still the correct method for passing context information.
There is a full list of options in the Action URL section of this page:
https://onshape-public.github.io/docs/app-dev/extensions/
I think they might be case sensitive, so ${documentId} and ${documentid} are different, with the first one being what I use in my apps.
Custom FeatureScript and Onshape Integrated Applications
Thank you for the quick response, that worked great! For anyone else that comes across this, at the time of posting, the "Create an Extension" tutorial is partly wrong, as it has
Note that it should be {$NAME}, not ${NAME}, as shown in that tutorial, and that the capatilization is wrong in the example URL as well.
Thank you very much, that works! For anyone that comes across this, note that as of today the "Create an Extension" tutorial is wrong. It has
Which has both wrong capitalization inside the ${} and also the $ should be inside, e.g., {$NAME}.