Onshape Windows Sample is a collection of sample projects which demonstrate Onshape OAuth authentication and Onshape REST API workflow on Windows platform.
Sample Onshape App registration parameters:
Base URL, Client Id, and Client Secret used by the sample are extracted from the environment variables.
Environment variables can be set in developer command prompt before launching Visual Studio:
>SET ONSHAPE_BASE_URI=https://partner.dev.onshape.com
>SET ONSHAPE_CLIENT_SECRET=TLLFGK56YJSL2...
>SET ONSHAPE_CLIENT_ID=K5SUPTJ3NX3LUA2...
or set globally in the configuration panel:
Open OnshapeWindowsSample.sln solution in Windows UI, or in developper command prompt:
>cd c:\dev\OnshapeWindowsSample
>devenv OnshapeWindowsSample.sln
Select "Debug > Start Debugging" in Visual Studio menue to start the sample.
Onshape authentication page in a browser should appear:
List of the user's document should be printed in JSON format, and interactive prompt should appear:
-
OnshapeClient - a .NET library, skeleton project which encapsulates Onshape REST API interface;
-
OnshapeConsoleApp - .NET executable, a skeleton console application whch wraps some of the REST API entry points into commands exposed through the command line interface.