Skip to main content

Esta versão do GitHub Enterprise foi descontinuada em 2022-10-12. Nenhum lançamento de patch será feito, mesmo para questões críticas de segurança. Para obter melhor desempenho, segurança aprimorada e novos recursos, atualize para a última versão do GitHub Enterprise. Para obter ajuda com a atualização, entre em contato com o suporte do GitHub Enterprise.

Discussões em equipe

A API Discussões da equipe permite que você obtenha, crie, edite e exclua postagens de discussão na página de uma equipe.

Sobre a API de Discussões de equipe

Você pode usar discussões da equipe para ter conversas que não são específicas para um repositório ou projeto. Qualquer membro da organização da equipe pode criar e ler postagens de discussão pública. Para obter mais detalhes, confira "Sobre as discussões em equipe". Para saber mais sobre como adicionar um comentário a uma postagem de discussão, confira a API de comentários de discussão em equipe.

Esta API só está disponível para os membros autenticados da organização da equipe. Os tokens de acesso OAuth exigem o read:orgescopo . O GitHub gera o slug da equipe com base na name da equipe.

List discussions

Funciona com o GitHub Apps

List all discussions on a team's page. OAuth access tokens require the read:discussion scope.

Note: You can also specify a team by org_id and team_id using the route GET /organizations/{org_id}/team/{team_id}/discussions.

Parâmetros

Headers
Name, Type, Description
acceptstring

Setting to application/vnd.github+json is recommended.

See preview notice
Path parameters
Name, Type, Description
orgstringRequired

The organization name. The name is not case sensitive.

team_slugstringRequired

The slug of the team name.

Query parameters
Name, Type, Description
directionstring

The direction to sort the results by.

Default: desc

Can be one of: asc, desc

per_pageinteger

The number of results per page (max 100).

Default: 30

pageinteger

Page number of the results to fetch.

Default: 1

pinnedstring

Pinned discussions only filter

Códigos de status de resposta HTTP

Código de statusDescrição
200

OK

Exemplos de código

get/orgs/{org}/teams/{team_slug}/discussions
curl \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ http(s)://HOSTNAME/api/v3/orgs/ORG/teams/TEAM_SLUG/discussions

Response

Status: 200
[ { "author": { "login": "octocat", "id": 1, "node_id": "MDQ6VXNlcjE=", "avatar_url": "https://github.com/images/error/octocat_happy.gif", "gravatar_id": "", "url": "https://api.github.com/users/octocat", "html_url": "https://github.com/octocat", "followers_url": "https://api.github.com/users/octocat/followers", "following_url": "https://api.github.com/users/octocat/following{/other_user}", "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}", "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/octocat/subscriptions", "organizations_url": "https://api.github.com/users/octocat/orgs", "repos_url": "https://api.github.com/users/octocat/repos", "events_url": "https://api.github.com/users/octocat/events{/privacy}", "received_events_url": "https://api.github.com/users/octocat/received_events", "type": "User", "site_admin": false }, "body": "Hi! This is an area for us to collaborate as a team.", "body_html": "<p>Hi! This is an area for us to collaborate as a team</p>", "body_version": "0d495416a700fb06133c612575d92bfb", "comments_count": 0, "comments_url": "https://api.github.com/teams/2343027/discussions/1/comments", "created_at": "2018-01-25T18:56:31Z", "last_edited_at": null, "html_url": "https://github.com/orgs/github/teams/justice-league/discussions/1", "node_id": "MDE0OlRlYW1EaXNjdXNzaW9uMQ==", "number": 1, "pinned": false, "private": false, "team_url": "https://api.github.com/teams/2343027", "title": "Our first team post", "updated_at": "2018-01-25T18:56:31Z", "url": "https://api.github.com/teams/2343027/discussions/1", "reactions": { "url": "https://api.github.com/teams/2343027/discussions/1/reactions", "total_count": 5, "+1": 3, "-1": 1, "laugh": 0, "confused": 0, "heart": 1, "hooray": 0, "eyes": 1, "rocket": 1 } } ]

Aviso de pré-visualização

An additional reactions object in the issue comment payload is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the blog post for full details.

To access the API you must provide a custom media type in the Accept header:

application/vnd.github.squirrel-girl-preview

The reactions key will have the following payload where url can be used to construct the API location for listing and creating reactions.

Create a discussion

Funciona com o GitHub Apps

Creates a new discussion post on a team's page. OAuth access tokens require the write:discussion scope.

This endpoint triggers notifications. Creating content too quickly using this endpoint may result in secondary rate limiting. See "Secondary rate limits" and "Dealing with secondary rate limits" for details.

Note: You can also specify a team by org_id and team_id using the route POST /organizations/{org_id}/team/{team_id}/discussions.

Parâmetros

Headers
Name, Type, Description
acceptstring

Setting to application/vnd.github+json is recommended.

See preview notice
Path parameters
Name, Type, Description
orgstringRequired

The organization name. The name is not case sensitive.

team_slugstringRequired

The slug of the team name.

Body parameters
Name, Type, Description
titlestringRequired

The discussion post's title.

bodystringRequired

The discussion post's body text.

privateboolean

Private posts are only visible to team members, organization owners, and team maintainers. Public posts are visible to all members of the organization. Set to true to create a private post.

Default: false

Códigos de status de resposta HTTP

Código de statusDescrição
201

Created

Exemplos de código

post/orgs/{org}/teams/{team_slug}/discussions
curl \ -X POST \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ http(s)://HOSTNAME/api/v3/orgs/ORG/teams/TEAM_SLUG/discussions \ -d '{"title":"Our first team post","body":"Hi! This is an area for us to collaborate as a team."}'

Response

Status: 201
{ "author": { "login": "octocat", "id": 1, "node_id": "MDQ6VXNlcjE=", "avatar_url": "https://github.com/images/error/octocat_happy.gif", "gravatar_id": "", "url": "https://api.github.com/users/octocat", "html_url": "https://github.com/octocat", "followers_url": "https://api.github.com/users/octocat/followers", "following_url": "https://api.github.com/users/octocat/following{/other_user}", "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}", "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/octocat/subscriptions", "organizations_url": "https://api.github.com/users/octocat/orgs", "repos_url": "https://api.github.com/users/octocat/repos", "events_url": "https://api.github.com/users/octocat/events{/privacy}", "received_events_url": "https://api.github.com/users/octocat/received_events", "type": "User", "site_admin": false }, "body": "Hi! This is an area for us to collaborate as a team.", "body_html": "<p>Hi! This is an area for us to collaborate as a team</p>", "body_version": "0d495416a700fb06133c612575d92bfb", "comments_count": 0, "comments_url": "https://api.github.com/teams/2343027/discussions/1/comments", "created_at": "2018-01-25T18:56:31Z", "last_edited_at": null, "html_url": "https://github.com/orgs/github/teams/justice-league/discussions/1", "node_id": "MDE0OlRlYW1EaXNjdXNzaW9uMQ==", "number": 1, "pinned": false, "private": false, "team_url": "https://api.github.com/teams/2343027", "title": "Our first team post", "updated_at": "2018-01-25T18:56:31Z", "url": "https://api.github.com/teams/2343027/discussions/1", "reactions": { "url": "https://api.github.com/teams/2343027/discussions/1/reactions", "total_count": 5, "+1": 3, "-1": 1, "laugh": 0, "confused": 0, "heart": 1, "hooray": 0, "eyes": 1, "rocket": 1 } }

Aviso de pré-visualização

An additional reactions object in the issue comment payload is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the blog post for full details.

To access the API you must provide a custom media type in the Accept header:

application/vnd.github.squirrel-girl-preview

The reactions key will have the following payload where url can be used to construct the API location for listing and creating reactions.

Get a discussion

Funciona com o GitHub Apps

Get a specific discussion on a team's page. OAuth access tokens require the read:discussion scope.

Note: You can also specify a team by org_id and team_id using the route GET /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}.

Parâmetros

Headers
Name, Type, Description
acceptstring

Setting to application/vnd.github+json is recommended.

See preview notice
Path parameters
Name, Type, Description
orgstringRequired

The organization name. The name is not case sensitive.

team_slugstringRequired

The slug of the team name.

discussion_numberintegerRequired

The number that identifies the discussion.

Códigos de status de resposta HTTP

Código de statusDescrição
200

OK

Exemplos de código

get/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}
curl \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ http(s)://HOSTNAME/api/v3/orgs/ORG/teams/TEAM_SLUG/discussions/DISCUSSION_NUMBER

Response

Status: 200
{ "author": { "login": "octocat", "id": 1, "node_id": "MDQ6VXNlcjE=", "avatar_url": "https://github.com/images/error/octocat_happy.gif", "gravatar_id": "", "url": "https://api.github.com/users/octocat", "html_url": "https://github.com/octocat", "followers_url": "https://api.github.com/users/octocat/followers", "following_url": "https://api.github.com/users/octocat/following{/other_user}", "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}", "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/octocat/subscriptions", "organizations_url": "https://api.github.com/users/octocat/orgs", "repos_url": "https://api.github.com/users/octocat/repos", "events_url": "https://api.github.com/users/octocat/events{/privacy}", "received_events_url": "https://api.github.com/users/octocat/received_events", "type": "User", "site_admin": false }, "body": "Hi! This is an area for us to collaborate as a team.", "body_html": "<p>Hi! This is an area for us to collaborate as a team</p>", "body_version": "0d495416a700fb06133c612575d92bfb", "comments_count": 0, "comments_url": "https://api.github.com/teams/2343027/discussions/1/comments", "created_at": "2018-01-25T18:56:31Z", "last_edited_at": null, "html_url": "https://github.com/orgs/github/teams/justice-league/discussions/1", "node_id": "MDE0OlRlYW1EaXNjdXNzaW9uMQ==", "number": 1, "pinned": false, "private": false, "team_url": "https://api.github.com/teams/2343027", "title": "Our first team post", "updated_at": "2018-01-25T18:56:31Z", "url": "https://api.github.com/teams/2343027/discussions/1", "reactions": { "url": "https://api.github.com/teams/2343027/discussions/1/reactions", "total_count": 5, "+1": 3, "-1": 1, "laugh": 0, "confused": 0, "heart": 1, "hooray": 0, "eyes": 1, "rocket": 1 } }

Aviso de pré-visualização

An additional reactions object in the issue comment payload is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the blog post for full details.

To access the API you must provide a custom media type in the Accept header:

application/vnd.github.squirrel-girl-preview

The reactions key will have the following payload where url can be used to construct the API location for listing and creating reactions.

Update a discussion

Funciona com o GitHub Apps

Edits the title and body text of a discussion post. Only the parameters you provide are updated. OAuth access tokens require the write:discussion scope.

Note: You can also specify a team by org_id and team_id using the route PATCH /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}.

Parâmetros

Headers
Name, Type, Description
acceptstring

Setting to application/vnd.github+json is recommended.

See preview notice
Path parameters
Name, Type, Description
orgstringRequired

The organization name. The name is not case sensitive.

team_slugstringRequired

The slug of the team name.

discussion_numberintegerRequired

The number that identifies the discussion.

Body parameters
Name, Type, Description
titlestring

The discussion post's title.

bodystring

The discussion post's body text.

Códigos de status de resposta HTTP

Código de statusDescrição
200

OK

Exemplos de código

patch/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}
curl \ -X PATCH \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ http(s)://HOSTNAME/api/v3/orgs/ORG/teams/TEAM_SLUG/discussions/DISCUSSION_NUMBER \ -d '{"title":"Welcome to our first team post"}'

Response

Status: 200
{ "author": { "login": "octocat", "id": 1, "node_id": "MDQ6VXNlcjE=", "avatar_url": "https://github.com/images/error/octocat_happy.gif", "gravatar_id": "", "url": "https://api.github.com/users/octocat", "html_url": "https://github.com/octocat", "followers_url": "https://api.github.com/users/octocat/followers", "following_url": "https://api.github.com/users/octocat/following{/other_user}", "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}", "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/octocat/subscriptions", "organizations_url": "https://api.github.com/users/octocat/orgs", "repos_url": "https://api.github.com/users/octocat/repos", "events_url": "https://api.github.com/users/octocat/events{/privacy}", "received_events_url": "https://api.github.com/users/octocat/received_events", "type": "User", "site_admin": false }, "body": "Hi! This is an area for us to collaborate as a team.", "body_html": "<p>Hi! This is an area for us to collaborate as a team</p>", "body_version": "0d495416a700fb06133c612575d92bfb", "comments_count": 1, "comments_url": "https://api.github.com/teams/2343027/discussions/1/comments", "created_at": "2018-01-25T18:56:31Z", "last_edited_at": "2018-01-26T18:22:20Z", "html_url": "https://github.com/orgs/github/teams/justice-league/discussions/1", "node_id": "MDE0OlRlYW1EaXNjdXNzaW9uMQ==", "number": 1, "pinned": false, "private": false, "team_url": "https://api.github.com/teams/2343027", "title": "Welcome to our first team post", "updated_at": "2018-01-26T18:22:20Z", "url": "https://api.github.com/teams/2343027/discussions/1", "reactions": { "url": "https://api.github.com/teams/2343027/discussions/1/reactions", "total_count": 5, "+1": 3, "-1": 1, "laugh": 0, "confused": 0, "heart": 1, "hooray": 0, "eyes": 1, "rocket": 1 } }

Aviso de pré-visualização

An additional reactions object in the issue comment payload is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the blog post for full details.

To access the API you must provide a custom media type in the Accept header:

application/vnd.github.squirrel-girl-preview

The reactions key will have the following payload where url can be used to construct the API location for listing and creating reactions.

Delete a discussion

Funciona com o GitHub Apps

Delete a discussion from a team's page. OAuth access tokens require the write:discussion scope.

Note: You can also specify a team by org_id and team_id using the route DELETE /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}.

Parâmetros

Headers
Name, Type, Description
acceptstring

Setting to application/vnd.github+json is recommended.

Path parameters
Name, Type, Description
orgstringRequired

The organization name. The name is not case sensitive.

team_slugstringRequired

The slug of the team name.

discussion_numberintegerRequired

The number that identifies the discussion.

Códigos de status de resposta HTTP

Código de statusDescrição
204

No Content

Exemplos de código

delete/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}
curl \ -X DELETE \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ http(s)://HOSTNAME/api/v3/orgs/ORG/teams/TEAM_SLUG/discussions/DISCUSSION_NUMBER

Response

Status: 204

List discussions (Legacy)

Funciona com o GitHub Apps

Deprecation Notice: This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new List discussions endpoint.

List all discussions on a team's page. OAuth access tokens require the read:discussion scope.

Parâmetros

Headers
Name, Type, Description
acceptstring

Setting to application/vnd.github+json is recommended.

See preview notice
Path parameters
Name, Type, Description
team_idintegerRequired

The unique identifier of the team.

Query parameters
Name, Type, Description
directionstring

The direction to sort the results by.

Default: desc

Can be one of: asc, desc

per_pageinteger

The number of results per page (max 100).

Default: 30

pageinteger

Page number of the results to fetch.

Default: 1

Códigos de status de resposta HTTP

Código de statusDescrição
200

OK

Exemplos de código

get/teams/{team_id}/discussions
curl \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ http(s)://HOSTNAME/api/v3/teams/TEAM_ID/discussions

Response

Status: 200
[ { "author": { "login": "octocat", "id": 1, "node_id": "MDQ6VXNlcjE=", "avatar_url": "https://github.com/images/error/octocat_happy.gif", "gravatar_id": "", "url": "https://api.github.com/users/octocat", "html_url": "https://github.com/octocat", "followers_url": "https://api.github.com/users/octocat/followers", "following_url": "https://api.github.com/users/octocat/following{/other_user}", "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}", "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/octocat/subscriptions", "organizations_url": "https://api.github.com/users/octocat/orgs", "repos_url": "https://api.github.com/users/octocat/repos", "events_url": "https://api.github.com/users/octocat/events{/privacy}", "received_events_url": "https://api.github.com/users/octocat/received_events", "type": "User", "site_admin": false }, "body": "Hi! This is an area for us to collaborate as a team.", "body_html": "<p>Hi! This is an area for us to collaborate as a team</p>", "body_version": "0d495416a700fb06133c612575d92bfb", "comments_count": 0, "comments_url": "https://api.github.com/teams/2343027/discussions/1/comments", "created_at": "2018-01-25T18:56:31Z", "last_edited_at": null, "html_url": "https://github.com/orgs/github/teams/justice-league/discussions/1", "node_id": "MDE0OlRlYW1EaXNjdXNzaW9uMQ==", "number": 1, "pinned": false, "private": false, "team_url": "https://api.github.com/teams/2343027", "title": "Our first team post", "updated_at": "2018-01-25T18:56:31Z", "url": "https://api.github.com/teams/2343027/discussions/1", "reactions": { "url": "https://api.github.com/teams/2343027/discussions/1/reactions", "total_count": 5, "+1": 3, "-1": 1, "laugh": 0, "confused": 0, "heart": 1, "hooray": 0, "eyes": 1, "rocket": 1 } } ]

Aviso de pré-visualização

An additional reactions object in the issue comment payload is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the blog post for full details.

To access the API you must provide a custom media type in the Accept header:

application/vnd.github.squirrel-girl-preview

The reactions key will have the following payload where url can be used to construct the API location for listing and creating reactions.

Create a discussion (Legacy)

Funciona com o GitHub Apps

Deprecation Notice: This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new Create a discussion endpoint.

Creates a new discussion post on a team's page. OAuth access tokens require the write:discussion scope.

This endpoint triggers notifications. Creating content too quickly using this endpoint may result in secondary rate limiting. See "Secondary rate limits" and "Dealing with secondary rate limits" for details.

Parâmetros

Headers
Name, Type, Description
acceptstring

Setting to application/vnd.github+json is recommended.

See preview notice
Path parameters
Name, Type, Description
team_idintegerRequired

The unique identifier of the team.

Body parameters
Name, Type, Description
titlestringRequired

The discussion post's title.

bodystringRequired

The discussion post's body text.

privateboolean

Private posts are only visible to team members, organization owners, and team maintainers. Public posts are visible to all members of the organization. Set to true to create a private post.

Default: false

Códigos de status de resposta HTTP

Código de statusDescrição
201

Created

Exemplos de código

post/teams/{team_id}/discussions
curl \ -X POST \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ http(s)://HOSTNAME/api/v3/teams/TEAM_ID/discussions \ -d '{"title":"Our first team post","body":"Hi! This is an area for us to collaborate as a team."}'

Response

Status: 201
{ "author": { "login": "octocat", "id": 1, "node_id": "MDQ6VXNlcjE=", "avatar_url": "https://github.com/images/error/octocat_happy.gif", "gravatar_id": "", "url": "https://api.github.com/users/octocat", "html_url": "https://github.com/octocat", "followers_url": "https://api.github.com/users/octocat/followers", "following_url": "https://api.github.com/users/octocat/following{/other_user}", "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}", "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/octocat/subscriptions", "organizations_url": "https://api.github.com/users/octocat/orgs", "repos_url": "https://api.github.com/users/octocat/repos", "events_url": "https://api.github.com/users/octocat/events{/privacy}", "received_events_url": "https://api.github.com/users/octocat/received_events", "type": "User", "site_admin": false }, "body": "Hi! This is an area for us to collaborate as a team.", "body_html": "<p>Hi! This is an area for us to collaborate as a team</p>", "body_version": "0d495416a700fb06133c612575d92bfb", "comments_count": 0, "comments_url": "https://api.github.com/teams/2343027/discussions/1/comments", "created_at": "2018-01-25T18:56:31Z", "last_edited_at": null, "html_url": "https://github.com/orgs/github/teams/justice-league/discussions/1", "node_id": "MDE0OlRlYW1EaXNjdXNzaW9uMQ==", "number": 1, "pinned": false, "private": false, "team_url": "https://api.github.com/teams/2343027", "title": "Our first team post", "updated_at": "2018-01-25T18:56:31Z", "url": "https://api.github.com/teams/2343027/discussions/1", "reactions": { "url": "https://api.github.com/teams/2343027/discussions/1/reactions", "total_count": 5, "+1": 3, "-1": 1, "laugh": 0, "confused": 0, "heart": 1, "hooray": 0, "eyes": 1, "rocket": 1 } }

Aviso de pré-visualização

An additional reactions object in the issue comment payload is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the blog post for full details.

To access the API you must provide a custom media type in the Accept header:

application/vnd.github.squirrel-girl-preview

The reactions key will have the following payload where url can be used to construct the API location for listing and creating reactions.

Get a discussion (Legacy)

Funciona com o GitHub Apps

Deprecation Notice: This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new Get a discussion endpoint.

Get a specific discussion on a team's page. OAuth access tokens require the read:discussion scope.

Parâmetros

Headers
Name, Type, Description
acceptstring

Setting to application/vnd.github+json is recommended.

See preview notice
Path parameters
Name, Type, Description
team_idintegerRequired

The unique identifier of the team.

discussion_numberintegerRequired

The number that identifies the discussion.

Códigos de status de resposta HTTP

Código de statusDescrição
200

OK

Exemplos de código

get/teams/{team_id}/discussions/{discussion_number}
curl \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ http(s)://HOSTNAME/api/v3/teams/TEAM_ID/discussions/DISCUSSION_NUMBER

Response

Status: 200
{ "author": { "login": "octocat", "id": 1, "node_id": "MDQ6VXNlcjE=", "avatar_url": "https://github.com/images/error/octocat_happy.gif", "gravatar_id": "", "url": "https://api.github.com/users/octocat", "html_url": "https://github.com/octocat", "followers_url": "https://api.github.com/users/octocat/followers", "following_url": "https://api.github.com/users/octocat/following{/other_user}", "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}", "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/octocat/subscriptions", "organizations_url": "https://api.github.com/users/octocat/orgs", "repos_url": "https://api.github.com/users/octocat/repos", "events_url": "https://api.github.com/users/octocat/events{/privacy}", "received_events_url": "https://api.github.com/users/octocat/received_events", "type": "User", "site_admin": false }, "body": "Hi! This is an area for us to collaborate as a team.", "body_html": "<p>Hi! This is an area for us to collaborate as a team</p>", "body_version": "0d495416a700fb06133c612575d92bfb", "comments_count": 0, "comments_url": "https://api.github.com/teams/2343027/discussions/1/comments", "created_at": "2018-01-25T18:56:31Z", "last_edited_at": null, "html_url": "https://github.com/orgs/github/teams/justice-league/discussions/1", "node_id": "MDE0OlRlYW1EaXNjdXNzaW9uMQ==", "number": 1, "pinned": false, "private": false, "team_url": "https://api.github.com/teams/2343027", "title": "Our first team post", "updated_at": "2018-01-25T18:56:31Z", "url": "https://api.github.com/teams/2343027/discussions/1", "reactions": { "url": "https://api.github.com/teams/2343027/discussions/1/reactions", "total_count": 5, "+1": 3, "-1": 1, "laugh": 0, "confused": 0, "heart": 1, "hooray": 0, "eyes": 1, "rocket": 1 } }

Aviso de pré-visualização

An additional reactions object in the issue comment payload is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the blog post for full details.

To access the API you must provide a custom media type in the Accept header:

application/vnd.github.squirrel-girl-preview

The reactions key will have the following payload where url can be used to construct the API location for listing and creating reactions.

Update a discussion (Legacy)

Funciona com o GitHub Apps

Deprecation Notice: This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new Update a discussion endpoint.

Edits the title and body text of a discussion post. Only the parameters you provide are updated. OAuth access tokens require the write:discussion scope.

Parâmetros

Headers
Name, Type, Description
acceptstring

Setting to application/vnd.github+json is recommended.

See preview notice
Path parameters
Name, Type, Description
team_idintegerRequired

The unique identifier of the team.

discussion_numberintegerRequired

The number that identifies the discussion.

Body parameters
Name, Type, Description
titlestring

The discussion post's title.

bodystring

The discussion post's body text.

Códigos de status de resposta HTTP

Código de statusDescrição
200

OK

Exemplos de código

patch/teams/{team_id}/discussions/{discussion_number}
curl \ -X PATCH \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ http(s)://HOSTNAME/api/v3/teams/TEAM_ID/discussions/DISCUSSION_NUMBER \ -d '{"title":"Welcome to our first team post"}'

Response

Status: 200
{ "author": { "login": "octocat", "id": 1, "node_id": "MDQ6VXNlcjE=", "avatar_url": "https://github.com/images/error/octocat_happy.gif", "gravatar_id": "", "url": "https://api.github.com/users/octocat", "html_url": "https://github.com/octocat", "followers_url": "https://api.github.com/users/octocat/followers", "following_url": "https://api.github.com/users/octocat/following{/other_user}", "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}", "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/octocat/subscriptions", "organizations_url": "https://api.github.com/users/octocat/orgs", "repos_url": "https://api.github.com/users/octocat/repos", "events_url": "https://api.github.com/users/octocat/events{/privacy}", "received_events_url": "https://api.github.com/users/octocat/received_events", "type": "User", "site_admin": false }, "body": "Hi! This is an area for us to collaborate as a team.", "body_html": "<p>Hi! This is an area for us to collaborate as a team</p>", "body_version": "0d495416a700fb06133c612575d92bfb", "comments_count": 1, "comments_url": "https://api.github.com/teams/2343027/discussions/1/comments", "created_at": "2018-01-25T18:56:31Z", "last_edited_at": "2018-01-26T18:22:20Z", "html_url": "https://github.com/orgs/github/teams/justice-league/discussions/1", "node_id": "MDE0OlRlYW1EaXNjdXNzaW9uMQ==", "number": 1, "pinned": false, "private": false, "team_url": "https://api.github.com/teams/2343027", "title": "Welcome to our first team post", "updated_at": "2018-01-26T18:22:20Z", "url": "https://api.github.com/teams/2343027/discussions/1", "reactions": { "url": "https://api.github.com/teams/2343027/discussions/1/reactions", "total_count": 5, "+1": 3, "-1": 1, "laugh": 0, "confused": 0, "heart": 1, "hooray": 0, "eyes": 1, "rocket": 1 } }

Aviso de pré-visualização

An additional reactions object in the issue comment payload is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the blog post for full details.

To access the API you must provide a custom media type in the Accept header:

application/vnd.github.squirrel-girl-preview

The reactions key will have the following payload where url can be used to construct the API location for listing and creating reactions.

Delete a discussion (Legacy)

Funciona com o GitHub Apps

Deprecation Notice: This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new Delete a discussion endpoint.

Delete a discussion from a team's page. OAuth access tokens require the write:discussion scope.

Parâmetros

Headers
Name, Type, Description
acceptstring

Setting to application/vnd.github+json is recommended.

Path parameters
Name, Type, Description
team_idintegerRequired

The unique identifier of the team.

discussion_numberintegerRequired

The number that identifies the discussion.

Códigos de status de resposta HTTP

Código de statusDescrição
204

No Content

Exemplos de código

delete/teams/{team_id}/discussions/{discussion_number}
curl \ -X DELETE \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ http(s)://HOSTNAME/api/v3/teams/TEAM_ID/discussions/DISCUSSION_NUMBER

Response

Status: 204