Publicamos atualizações frequentes em nossa documentação, e a tradução desta página ainda pode estar em andamento. Para obter as informações mais recentes, acesse a documentação em inglês. Se houver problemas com a tradução desta página, entre em contato conosco.

Interactions

Neste artigo

Did this doc help you?

Users interact with repositories by commenting, opening issues, and creating pull requests. The Interactions APIs allow people with owner or admin access to temporarily restrict certain users from interacting with public repositories.

organização

The Organization Interactions API allows organization owners to temporarily restrict which users can comment, open issues, or create pull requests in the organization's public repositories. Quando as restrições são ativadas, apenas o grupo especificado de GitHub os usuários serão capazes de participar de interações. As restrições expiram 24 horas a partir do momento que são estabelecidas. Here's more about the groups of GitHub users:

  • Usuários existentes: Quando você limitar as interações para existing_users, novos usuários com contas com menos de 24 horas de idade, que não tenham contribuído anteriormente e que não sejam colaboradores, estarão temporariamente restritos in the organization.

  • Colaboradores apenas: quando você limitar as interações para contributors_only, usuários que não contribuíram anteriormente e não são colaboradores serão temporariamente restritos in the organization.

  • Colaboradores apenas: quando você limitar as interações para collaborators_only, os usuários que não forem colaboradores ficarão temporariamente restritos in the organization.

    Get interaction restrictions for an organization

    Shows which group of GitHub users can interact with this organization and when the restriction expires. If there are no restrictions, you will see an empty response.

    get /orgs/{org}/interaction-limits

    Parâmetros

    Name Type In Description
    accept string header

    This API is under preview and subject to change.

    Ver aviso de pré-visualização.
    org string path

    Amostras de código

    Shell
    curl \
      -H "Accept: application/vnd.github.sombra-preview+json" \
      https://api.github.com/orgs/ORG/interaction-limits
    
    JavaScript (@octokit/core.js)
    await octokit.request('GET /orgs/{org}/interaction-limits', {
      org: 'org',
      mediaType: {
        previews: [
          'sombra'
        ]
      }
    })
    

    Default response

    Status: 200 OK
    {
      "limit": "collaborators_only",
      "origin": "organization",
      "expires_at": "2018-08-17T04:18:39Z"
    }
    

    Notes

    Aviso de pré-visualização

    The Interactions API is currently in public preview. See the blog post preview for more details. To access the API during the preview period, you must provide a custom media type in the Accept header:

    application/vnd.github.sombra-preview
    
    ☝️ Este cabeçalho é obrigatório.

    Set interaction restrictions for an organization

    Temporarily restricts interactions to certain GitHub users in any public repository in the given organization. You must be an organization owner to set these restrictions.

    put /orgs/{org}/interaction-limits

    Parâmetros

    Name Type In Description
    accept string header

    This API is under preview and subject to change.

    Ver aviso de pré-visualização.
    org string path
    limit string body

    Required. Specifies the group of GitHub users who can comment, open issues, or create pull requests in public repositories for the given organization. Must be one of: existing_users, contributors_only, or collaborators_only.

    Amostras de código

    Shell
    curl \
      -X PUT \
      -H "Accept: application/vnd.github.sombra-preview+json" \
      https://api.github.com/orgs/ORG/interaction-limits \
      -d '{"limit":"limit"}'
    
    JavaScript (@octokit/core.js)
    await octokit.request('PUT /orgs/{org}/interaction-limits', {
      org: 'org',
      limit: 'limit',
      mediaType: {
        previews: [
          'sombra'
        ]
      }
    })
    

    Default response

    Status: 200 OK
    {
      "limit": "collaborators_only",
      "origin": "organization",
      "expires_at": "2018-08-17T04:18:39Z"
    }
    

    Notes

    Aviso de pré-visualização

    The Interactions API is currently in public preview. See the blog post preview for more details. To access the API during the preview period, you must provide a custom media type in the Accept header:

    application/vnd.github.sombra-preview
    
    ☝️ Este cabeçalho é obrigatório.

    Remove interaction restrictions for an organization

    Removes all interaction restrictions from public repositories in the given organization. You must be an organization owner to remove restrictions.

    delete /orgs/{org}/interaction-limits

    Parâmetros

    Name Type In Description
    accept string header

    This API is under preview and subject to change.

    Ver aviso de pré-visualização.
    org string path

    Amostras de código

    Shell
    curl \
      -X DELETE \
      -H "Accept: application/vnd.github.sombra-preview+json" \
      https://api.github.com/orgs/ORG/interaction-limits
    
    JavaScript (@octokit/core.js)
    await octokit.request('DELETE /orgs/{org}/interaction-limits', {
      org: 'org',
      mediaType: {
        previews: [
          'sombra'
        ]
      }
    })
    

    Default Response

    Status: 204 No Content

    Notes

    Aviso de pré-visualização

    The Interactions API is currently in public preview. See the blog post preview for more details. To access the API during the preview period, you must provide a custom media type in the Accept header:

    application/vnd.github.sombra-preview
    
    ☝️ Este cabeçalho é obrigatório.

Repositório

The Repository Interactions API allows people with owner or admin access to temporarily restrict which users can comment, open issues, or create pull requests in a public repository. Quando as restrições são ativadas, apenas o grupo especificado de GitHub os usuários serão capazes de participar de interações. As restrições expiram 24 horas a partir do momento que são estabelecidas. Here's more about the groups of GitHub users:

  • Usuários existentes: Quando você limitar as interações para existing_users, novos usuários com contas com menos de 24 horas de idade, que não tenham contribuído anteriormente e que não sejam colaboradores, estarão temporariamente restritos in the respository.
  • Colaboradores apenas: quando você limitar as interações para contributors_only, usuários que não contribuíram anteriormente e não são colaboradores serão temporariamente restritos in the respository.
  • Colaboradores apenas: quando você limitar as interações para collaborators_only, os usuários que não forem colaboradores ficarão temporariamente restritos in the respository.

Get interaction restrictions for a repository

Shows which group of GitHub users can interact with this repository and when the restriction expires. If there are no restrictions, you will see an empty response.

get /repos/{owner}/{repo}/interaction-limits

Parâmetros

Name Type In Description
accept string header

This API is under preview and subject to change.

Ver aviso de pré-visualização.
owner string path
repo string path

Amostras de código

Shell
curl \
  -H "Accept: application/vnd.github.sombra-preview+json" \
  https://api.github.com/repos/octocat/hello-world/interaction-limits
JavaScript (@octokit/core.js)
await octokit.request('GET /repos/{owner}/{repo}/interaction-limits', {
  owner: 'octocat',
  repo: 'hello-world',
  mediaType: {
    previews: [
      'sombra'
    ]
  }
})

Default response

Status: 200 OK
{
  "limit": "collaborators_only",
  "origin": "repository",
  "expires_at": "2018-08-17T04:18:39Z"
}

Notes

Aviso de pré-visualização

The Interactions API is currently in public preview. See the blog post preview for more details. To access the API during the preview period, you must provide a custom media type in the Accept header:

application/vnd.github.sombra-preview
☝️ Este cabeçalho é obrigatório.

Set interaction restrictions for a repository

Temporarily restricts interactions to certain GitHub users within the given repository. You must have owner or admin access to set restrictions.

put /repos/{owner}/{repo}/interaction-limits

Parâmetros

Name Type In Description
accept string header

This API is under preview and subject to change.

Ver aviso de pré-visualização.
owner string path
repo string path
limit string body

Required. Specifies the group of GitHub users who can comment, open issues, or create pull requests for the given repository. Must be one of: existing_users, contributors_only, or collaborators_only.

Amostras de código

Shell
curl \
  -X PUT \
  -H "Accept: application/vnd.github.sombra-preview+json" \
  https://api.github.com/repos/octocat/hello-world/interaction-limits \
  -d '{"limit":"limit"}'
JavaScript (@octokit/core.js)
await octokit.request('PUT /repos/{owner}/{repo}/interaction-limits', {
  owner: 'octocat',
  repo: 'hello-world',
  limit: 'limit',
  mediaType: {
    previews: [
      'sombra'
    ]
  }
})

Default response

Status: 200 OK
{
  "limit": "collaborators_only",
  "origin": "repository",
  "expires_at": "2018-08-17T04:18:39Z"
}

Notes

Aviso de pré-visualização

The Interactions API is currently in public preview. See the blog post preview for more details. To access the API during the preview period, you must provide a custom media type in the Accept header:

application/vnd.github.sombra-preview
☝️ Este cabeçalho é obrigatório.

Remove interaction restrictions for a repository

Removes all interaction restrictions from the given repository. You must have owner or admin access to remove restrictions.

delete /repos/{owner}/{repo}/interaction-limits

Parâmetros

Name Type In Description
accept string header

This API is under preview and subject to change.

Ver aviso de pré-visualização.
owner string path
repo string path

Amostras de código

Shell
curl \
  -X DELETE \
  -H "Accept: application/vnd.github.sombra-preview+json" \
  https://api.github.com/repos/octocat/hello-world/interaction-limits
JavaScript (@octokit/core.js)
await octokit.request('DELETE /repos/{owner}/{repo}/interaction-limits', {
  owner: 'octocat',
  repo: 'hello-world',
  mediaType: {
    previews: [
      'sombra'
    ]
  }
})

Default Response

Status: 204 No Content

Notes

Aviso de pré-visualização

The Interactions API is currently in public preview. See the blog post preview for more details. To access the API during the preview period, you must provide a custom media type in the Accept header:

application/vnd.github.sombra-preview
☝️ Este cabeçalho é obrigatório.

Did this doc help you?

Pergunte a uma pessoa

Não consegue encontrar o que procura?

Entrar em contato