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.
App writing help
Lee_Hesketh
Member, Developers Posts: 148 ✭✭✭
Hello, I would like to write an app but I don't know how to use the API. I have tried using the API Explorer but whenever I try to query something, I get the status code 401 and the message
Thanks
Lee Hesketh
"Unauthenticated API request"
How do I start??Thanks
Lee Hesketh
There are 10 types of people in the world. Those who know binary, those who don't and those who didn't expect base 3!
0
Best Answer
-
awk Member, Onshape Employees, Developers Posts: 78You need to fill in the API Key fields in the dialog box that's presented when you make a request.
You create API Keys in the Developer Portal - using the 'API Keys' sidebar option. Create a key for the API Explorer (you can have multiple keys for different purposes) and then copy/paste the values in to the fields in the dialog box presented in the API Explorer. The API explorer will store the key values locally on your browser so you shouldn't have to enter them repeatedly.
When you create the API Key you can choose from a range of permissions - this is so that you can choose to limit a scripts access. For example if your key doesn't have 'write permission' you will be unable to invoke APIs that change documents etc.Director of API, Appstore, and App Partner Technical Support5
Answers
You create API Keys in the Developer Portal - using the 'API Keys' sidebar option. Create a key for the API Explorer (you can have multiple keys for different purposes) and then copy/paste the values in to the fields in the dialog box presented in the API Explorer. The API explorer will store the key values locally on your browser so you shouldn't have to enter them repeatedly.
When you create the API Key you can choose from a range of permissions - this is so that you can choose to limit a scripts access. For example if your key doesn't have 'write permission' you will be unable to invoke APIs that change documents etc.