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 开发者文档。
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) - 选中此选项可允许应用程序共享和取消共享您的文档。