My Account - Developer
All applications submitted to the Onshape App Store (Onshape Apps) must follow the instructions on the API Guide: OAuth2 page and use OAuth2 for authorization. Automation scripts (or applications not meant for the Onshape App Store) may use either OAuth2 or API Keys for authentication. OAuth2 allows applications to call Onshape APIs on behalf of the users of the application; API keys will only perform operations on behalf of the Onshape user who generated the API keys.
關於操作 Onshape 應用程式的詳細資訊,請參考 Onshape API Developer Documentation。
To navigate to your Developer settings in Onshape, click on your Account user icon () in the top right corner of your Onshape window. This opens a dropdown menu. Click My account.
按一下頁面左側清單中的開發人員:

API keys are a useful way create small applications meant for personal use, allowing developers to avoid the overhead of the OAuth workflow.
API keys are used to authenticate an application, not its users. (OAuth2 authenticates an application and users of the application by ensuring the users are authorized to access Onshape.)
Once you create an API key, it is valid only in the stack on which it was created. An API key created on your company stack (i.e., companyName.onshape.com) will not function on the production stack (cad.onshape.com). Administrators can also manage API keys for users in their company: see Company/Classroom/Enterprise settings - Developer.
檢視 API 金鑰
- Click API keys on the Developer page.
- View all your previously-created API keys.
建立 API 金鑰
- 按一下 建立新 API 金鑰。
- 在名稱欄位中提供 API 金鑰的名稱。
- 選擇金鑰的權限。請參考下方的權限範圍。
- 按一下 建立 API 金鑰按鈕。
-
在彈出視窗中,複製顯示的 API 金鑰與金鑰秘密,將其儲存於某處,然後按一下 關閉 按鈕。
您將不會再看到金鑰秘密,因此請將其儲存在安全之處。
刪除 API 金鑰
- 按一下您要刪除 API 金鑰右側的 "X" 圖示。
- Confirm that you want to delete this API key. This action cannot be undone. Click Delete to confirm.

在建立 OAuth 應用程式時,會有下列的權限範圍:
-
應用程式可以讀取您的個人檔案 (OAuth2ReadPII) - 核取以允許應用程式存取您個人檔案中的資訊。
-
應用程式可以讀取您的文件 (OAuth2Read) - 核取以允許應用程式讀取您的文件。
-
應用程式可以寫入您的文件 (OAuth2Write) - 核取以允許應用程式寫入您的文件。
-
應用程式可以刪除您的文件與工作區 (OAuth2Delete) - 核取以允許應用程式刪除您文件與工作區的存取權限。
-
應用程式可以代表您要求購買 (OAuth2Purchase) - 核取以允許應用程式為您做出訂購。
-
應用程式可以代表您共享與取消文件共享 (OAuth2Share) - 核取以允許應用程式共享與取消共享您的文件。