Puntos de conexión de la API de REST para grupos externos
Usa la API REST para ver los grupos de proveedores de identidades externos que están disponibles para tu organización, así como administrar la conexión entre los grupos externos y los equipos de la organización.
About external groups
To use these endpoints, the authenticated user must be a team maintainer or an owner of the organization associated with the team.
Notes:
- These endpoints are only available for organizations that are part of an enterprise using Enterprise Managed Users. For more information, see "About Enterprise Managed Users."
- If your organization uses team synchronization, you can use the API to manage team synchronization. For more information, see "REST API endpoints for team synchronization."
Get an external group
Displays information about the specific group's usage. Provides a list of the group's external members as well as a list of teams that this group is connected to.
You can manage team membership with your identity provider using Enterprise Managed Users for GitHub Enterprise Cloud. For more information, see "GitHub's products" in the GitHub Help documentation.
Tokens de acceso específicos para "Get an external group"
Este punto de conexión funciona con los siguientes tipos de token pormenorizados:
- Tokens de acceso de usuario de la aplicación de GitHub
- Token de acceso a la instalación de la aplicación de GitHub
- Tokens de acceso personal específico
El token pormenorizado debe tener el siguiente conjunto de permisos:
- "Members" organization permissions (write)
Parámetros para "Get an external group"
Nombre, Tipo, Descripción |
---|
accept string Setting to |
Nombre, Tipo, Descripción |
---|
org string RequeridoThe organization name. The name is not case sensitive. |
group_id integer RequeridoThe unique identifier of the group. |
Nombre, Tipo, Descripción |
---|
per_page integer The number of results per page for the "members" array (max 100). For more information, see "Using pagination in the REST API." Valor predeterminado: |
page integer The page number of the "members" array results to fetch. For more information, see "Using pagination in the REST API." Valor predeterminado: |
Códigos de estado de respuesta HTTP para "Get an external group"
status code | Descripción |
---|---|
200 | OK |
Ejemplos de código para "Get an external group"
If you access GitHub at GHE.com, replace api.github.com
with your enterprise's dedicated subdomain at api.SUBDOMAIN.ghe.com
.
Ejemplo de solicitud
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/orgs/ORG/external-group/GROUP_ID
Response
Status: 200
{
"group_id": "123",
"group_name": "Octocat admins",
"updated_at": "2021-01-24T11:31:04-06:00",
"teams": [
{
"team_id": 1,
"team_name": "team-test"
},
{
"team_id": 2,
"team_name": "team-test2"
}
],
"members": [
{
"member_id": 1,
"member_login": "mona-lisa_eocsaxrs",
"member_name": "Mona Lisa",
"member_email": "mona_lisa@github.com"
},
{
"member_id": 2,
"member_login": "octo-lisa_eocsaxrs",
"member_name": "Octo Lisa",
"member_email": "octo_lisa@github.com"
}
]
}
List external groups in an organization
Lists external groups available in an organization. You can query the groups using the display_name
parameter, only groups with a group_name
containing the text provided in the display_name
parameter will be returned. You can also limit your page results using the per_page
parameter. GitHub Enterprise Cloud generates a url-encoded page
token using a cursor value for where the next page begins. For more information on cursor pagination, see "Offset and Cursor Pagination explained."
You can manage team membership with your identity provider using Enterprise Managed Users for GitHub Enterprise Cloud. For more information, see "GitHub's products" in the GitHub Help documentation.
Tokens de acceso específicos para "List external groups in an organization"
Este punto de conexión funciona con los siguientes tipos de token pormenorizados:
- Tokens de acceso de usuario de la aplicación de GitHub
- Token de acceso a la instalación de la aplicación de GitHub
- Tokens de acceso personal específico
El token pormenorizado debe tener el siguiente conjunto de permisos:
- "Members" organization permissions (write)
Parámetros para "List external groups in an organization"
Nombre, Tipo, Descripción |
---|
accept string Setting to |
Nombre, Tipo, Descripción |
---|
org string RequeridoThe organization name. The name is not case sensitive. |
Nombre, Tipo, Descripción |
---|
per_page integer The number of results per page (max 100). For more information, see "Using pagination in the REST API." Valor predeterminado: |
page integer Page token |
display_name string Limits the list to groups containing the text in the group name |
Códigos de estado de respuesta HTTP para "List external groups in an organization"
status code | Descripción |
---|---|
200 | OK |
Ejemplos de código para "List external groups in an organization"
If you access GitHub at GHE.com, replace api.github.com
with your enterprise's dedicated subdomain at api.SUBDOMAIN.ghe.com
.
Ejemplo de solicitud
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/orgs/ORG/external-groups
Response
Status: 200
{
"groups": [
{
"group_id": "123",
"group_name": "Octocat admins",
"updated_at": "2021-01-24T11:31:04-06:00"
},
{
"group_id": "456",
"group_name": "Octocat docs members",
"updated_at": "2021-03-24T11:31:04-06:00"
}
]
}
List a connection between an external group and a team
Lists a connection between a team and an external group.
You can manage team membership with your identity provider using Enterprise Managed Users for GitHub Enterprise Cloud. For more information, see "GitHub's products" in the GitHub Help documentation.
Tokens de acceso específicos para "List a connection between an external group and a team"
Este punto de conexión funciona con los siguientes tipos de token pormenorizados:
- Tokens de acceso de usuario de la aplicación de GitHub
- Token de acceso a la instalación de la aplicación de GitHub
- Tokens de acceso personal específico
El token pormenorizado debe tener el siguiente conjunto de permisos:
- "Members" organization permissions (write)
Parámetros para "List a connection between an external group and a team"
Nombre, Tipo, Descripción |
---|
accept string Setting to |
Nombre, Tipo, Descripción |
---|
org string RequeridoThe organization name. The name is not case sensitive. |
team_slug string RequeridoThe slug of the team name. |
Códigos de estado de respuesta HTTP para "List a connection between an external group and a team"
status code | Descripción |
---|---|
200 | OK |
Ejemplos de código para "List a connection between an external group and a team"
If you access GitHub at GHE.com, replace api.github.com
with your enterprise's dedicated subdomain at api.SUBDOMAIN.ghe.com
.
Ejemplo de solicitud
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/orgs/ORG/teams/TEAM_SLUG/external-groups
Response
Status: 200
{
"groups": [
{
"group_id": "123",
"group_name": "Octocat admins",
"updated_at": "2021-01-24T11:31:04-06:00"
},
{
"group_id": "456",
"group_name": "Octocat docs members",
"updated_at": "2021-03-24T11:31:04-06:00"
}
]
}
Update the connection between an external group and a team
Creates a connection between a team and an external group. Only one external group can be linked to a team.
You can manage team membership with your identity provider using Enterprise Managed Users for GitHub Enterprise Cloud. For more information, see "GitHub's products" in the GitHub Help documentation.
Tokens de acceso específicos para "Update the connection between an external group and a team"
Este punto de conexión funciona con los siguientes tipos de token pormenorizados:
- Tokens de acceso de usuario de la aplicación de GitHub
- Token de acceso a la instalación de la aplicación de GitHub
- Tokens de acceso personal específico
El token pormenorizado debe tener el siguiente conjunto de permisos:
- "Members" organization permissions (write)
Parámetros para "Update the connection between an external group and a team"
Nombre, Tipo, Descripción |
---|
accept string Setting to |
Nombre, Tipo, Descripción |
---|
org string RequeridoThe organization name. The name is not case sensitive. |
team_slug string RequeridoThe slug of the team name. |
Nombre, Tipo, Descripción |
---|
group_id integer RequeridoExternal Group Id |
Códigos de estado de respuesta HTTP para "Update the connection between an external group and a team"
status code | Descripción |
---|---|
200 | OK |
Ejemplos de código para "Update the connection between an external group and a team"
If you access GitHub at GHE.com, replace api.github.com
with your enterprise's dedicated subdomain at api.SUBDOMAIN.ghe.com
.
Ejemplo de solicitud
curl -L \
-X PATCH \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/orgs/ORG/teams/TEAM_SLUG/external-groups \
-d '{"group_id":123}'
Response
Status: 200
{
"group_id": "123",
"group_name": "Octocat admins",
"updated_at": "2021-01-24T11:31:04-06:00",
"teams": [
{
"team_id": 1,
"team_name": "team-test"
},
{
"team_id": 2,
"team_name": "team-test2"
}
],
"members": [
{
"member_id": 1,
"member_login": "mona-lisa_eocsaxrs",
"member_name": "Mona Lisa",
"member_email": "mona_lisa@github.com"
},
{
"member_id": 2,
"member_login": "octo-lisa_eocsaxrs",
"member_name": "Octo Lisa",
"member_email": "octo_lisa@github.com"
}
]
}
Remove the connection between an external group and a team
Deletes a connection between a team and an external group.
You can manage team membership with your IdP using Enterprise Managed Users for GitHub Enterprise Cloud. For more information, see GitHub's products in the GitHub Help documentation.
Tokens de acceso específicos para "Remove the connection between an external group and a team"
Este punto de conexión funciona con los siguientes tipos de token pormenorizados:
- Tokens de acceso de usuario de la aplicación de GitHub
- Token de acceso a la instalación de la aplicación de GitHub
- Tokens de acceso personal específico
El token pormenorizado debe tener el siguiente conjunto de permisos:
- "Members" organization permissions (write)
Parámetros para "Remove the connection between an external group and a team"
Nombre, Tipo, Descripción |
---|
accept string Setting to |
Nombre, Tipo, Descripción |
---|
org string RequeridoThe organization name. The name is not case sensitive. |
team_slug string RequeridoThe slug of the team name. |
Códigos de estado de respuesta HTTP para "Remove the connection between an external group and a team"
status code | Descripción |
---|---|
204 | No Content |
Ejemplos de código para "Remove the connection between an external group and a team"
If you access GitHub at GHE.com, replace api.github.com
with your enterprise's dedicated subdomain at api.SUBDOMAIN.ghe.com
.
Ejemplo de solicitud
curl -L \
-X DELETE \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/orgs/ORG/teams/TEAM_SLUG/external-groups
Response
Status: 204