REST API endpoints for enterprise access verification
Use the REST API to manage enterprise access verification configuration in your GitHub enterprise.
Disable access restrictions for an enterprise
Disable access restriction by proxy header using the network proxy owned by the enterprise.
“Disable access restrictions for an enterprise”的细粒度访问令牌
此终结点不适用于 GitHub 应用程序用户访问令牌、GitHub 应用程序安装访问令牌或细粒度个人访问令牌。
“Disable access restrictions for an enterprise”的参数
名称, 类型, 说明 |
---|
accept string Setting to |
名称, 类型, 说明 |
---|
enterprise string 必须The slug version of the enterprise name. |
“Disable access restrictions for an enterprise”的 HTTP 响应状态代码
状态代码 | 说明 |
---|---|
200 | OK |
400 | Forbidden |
404 | Resource not found |
500 | Internal Error |
“Disable access restrictions for an enterprise”的示例代码
如果你通过 GHE.com 访问 GitHub,请将 api.github.com
替换为你的企业在 api.SUBDOMAIN.ghe.com
上的专用子域。
请求示例
curl -L \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/enterprises/ENTERPRISE/access-restrictions/disable
Response
Status: 200
{
"message": "Enterprise access restrictions successfully disabled.",
"header_name": "sec-GitHub-allowed-enterprise",
"header_value": "12345"
}
Enable access restrictions for an enterprise
Enable access restriction by proxy header using the network proxy owned by the enterprise.
“Enable access restrictions for an enterprise”的细粒度访问令牌
此终结点不适用于 GitHub 应用程序用户访问令牌、GitHub 应用程序安装访问令牌或细粒度个人访问令牌。
“Enable access restrictions for an enterprise”的参数
名称, 类型, 说明 |
---|
accept string Setting to |
名称, 类型, 说明 |
---|
enterprise string 必须The slug version of the enterprise name. |
“Enable access restrictions for an enterprise”的 HTTP 响应状态代码
状态代码 | 说明 |
---|---|
200 | OK |
400 | Forbidden |
404 | Resource not found |
500 | Internal Error |
“Enable access restrictions for an enterprise”的示例代码
如果你通过 GHE.com 访问 GitHub,请将 api.github.com
替换为你的企业在 api.SUBDOMAIN.ghe.com
上的专用子域。
请求示例
curl -L \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/enterprises/ENTERPRISE/access-restrictions/enable
Response
Status: 200
{
"message": "Enterprise access restrictions successfully enabled.",
"header_name": "sec-GitHub-allowed-enterprise",
"header_value": "12345"
}