REST-API-Endpunkte für die Überprüfung des Unternehmenszugriffs
Verwende die REST-API, um die Konfiguration der Überprüfung des Unternehmenszugriffs in deinem GitHub-Unternehmen zu verwalten.
Disable access restrictions for an enterprise
Disable access restriction by proxy header using the network proxy owned by the enterprise.
Differenzierte Zugriffstoken für "Disable access restrictions for an enterprise"
Dieser Endpunkt funktioniert nicht mit GitHub-App-Benutzerzugriffstoken, GitHub-App-Installationszugriffstoken oder differenzierten persönlichen Zugriffstoken.
Parameter für „Disable access restrictions for an enterprise“
| Name, type, BESCHREIBUNG |
|---|
accept string Setting to |
| Name, type, BESCHREIBUNG |
|---|
enterprise string ErforderlichThe slug version of the enterprise name. |
HTTP-Antwortstatuscodes für „Disable access restrictions for an enterprise“
| Statuscode | BESCHREIBUNG |
|---|---|
200 | OK |
400 | Forbidden |
404 | Resource not found |
500 | Internal Error |
Codebeispiele für „Disable access restrictions for an enterprise“
Wenn du unter GHE.com auf GitHub zugreifst, ersetze api.github.com unter api.SUBDOMAIN.ghe.com mit der dedizierten Unterdomäne deines Unternehmens.
Anforderungsbeispiel
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/disableResponse
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.
Differenzierte Zugriffstoken für "Enable access restrictions for an enterprise"
Dieser Endpunkt funktioniert nicht mit GitHub-App-Benutzerzugriffstoken, GitHub-App-Installationszugriffstoken oder differenzierten persönlichen Zugriffstoken.
Parameter für „Enable access restrictions for an enterprise“
| Name, type, BESCHREIBUNG |
|---|
accept string Setting to |
| Name, type, BESCHREIBUNG |
|---|
enterprise string ErforderlichThe slug version of the enterprise name. |
HTTP-Antwortstatuscodes für „Enable access restrictions for an enterprise“
| Statuscode | BESCHREIBUNG |
|---|---|
200 | OK |
400 | Forbidden |
404 | Resource not found |
500 | Internal Error |
Codebeispiele für „Enable access restrictions for an enterprise“
Wenn du unter GHE.com auf GitHub zugreifst, ersetze api.github.com unter api.SUBDOMAIN.ghe.com mit der dedizierten Unterdomäne deines Unternehmens.
Anforderungsbeispiel
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/enableResponse
Status: 200{
"message": "Enterprise access restrictions successfully enabled.",
"header_name": "sec-GitHub-allowed-enterprise",
"header_value": "12345"
}