Skip to main content
REST API теперь версия. Дополнительные сведения см. в разделе "О управлении версиями API".

Конечные точки REST API для обсуждения команд

Используйте REST API для получения, создания, редактирования и удаления записей обсуждений на странице группы.

The team discussions and team discussion comments endpoints will be deprecated on 2023-11-28 in favor of GitHub Discussions. For more information about GitHub Discussions, see "GitHub Discussions documentation."

List discussions

List all discussions on a team's page.

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

OAuth app tokens and personal access tokens (classic) need the read:discussion scope to use this endpoint.

Параметры для "List discussions"

Заголовки
Имя., Тип, Description
accept string

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

Параметры пути
Имя., Тип, Description
org string Обязательное поле

The organization name. The name is not case sensitive.

team_slug string Обязательное поле

The slug of the team name.

Параметры запроса
Имя., Тип, Description
direction string

The direction to sort the results by.

По умолчанию.: desc

Возможные значения: asc, desc

per_page integer

The number of results per page (max 100). For more information, see "Using pagination in the REST API."

По умолчанию.: 30

page integer

The page number of the results to fetch. For more information, see "Using pagination in the REST API."

По умолчанию.: 1

pinned string

Pinned discussions only filter

Коды состояния http-ответа для "List discussions"

Код состоянияОписание
200

OK

Примеры кода для "List discussions"

Пример запроса

get/orgs/{org}/teams/{team_slug}/discussions
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/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 } } ]

Create a discussion

Creates a new discussion post on a team's page.

This endpoint triggers notifications. Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see "Rate limits for the API" and "Best practices for using the REST API."

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

OAuth app tokens and personal access tokens (classic) need the write:discussion scope to use this endpoint.

Параметры для "Create a discussion"

Заголовки
Имя., Тип, Description
accept string

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

Параметры пути
Имя., Тип, Description
org string Обязательное поле

The organization name. The name is not case sensitive.

team_slug string Обязательное поле

The slug of the team name.

Параметры запроса
Имя., Тип, Description
title string Обязательное поле

The discussion post's title.

body string Обязательное поле

The discussion post's body text.

private boolean

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.

По умолчанию.: false

Коды состояния http-ответа для "Create a discussion"

Код состоянияОписание
201

Created

Примеры кода для "Create a discussion"

Пример запроса

post/orgs/{org}/teams/{team_slug}/discussions
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/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 } }

Get a discussion

Get a specific discussion on a team's page.

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}.

OAuth app tokens and personal access tokens (classic) need the read:discussion scope to use this endpoint.

Параметры для "Get a discussion"

Заголовки
Имя., Тип, Description
accept string

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

Параметры пути
Имя., Тип, Description
org string Обязательное поле

The organization name. The name is not case sensitive.

team_slug string Обязательное поле

The slug of the team name.

discussion_number integer Обязательное поле

The number that identifies the discussion.

Коды состояния http-ответа для "Get a discussion"

Код состоянияОписание
200

OK

Примеры кода для "Get a discussion"

Пример запроса

get/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}
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/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 } }

Update a discussion

Edits the title and body text of a discussion post. Only the parameters you provide are updated.

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}.

OAuth app tokens and personal access tokens (classic) need the write:discussion scope to use this endpoint.

Параметры для "Update a discussion"

Заголовки
Имя., Тип, Description
accept string

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

Параметры пути
Имя., Тип, Description
org string Обязательное поле

The organization name. The name is not case sensitive.

team_slug string Обязательное поле

The slug of the team name.

discussion_number integer Обязательное поле

The number that identifies the discussion.

Параметры запроса
Имя., Тип, Description
title string

The discussion post's title.

body string

The discussion post's body text.

Коды состояния http-ответа для "Update a discussion"

Код состоянияОписание
200

OK

Примеры кода для "Update a discussion"

Пример запроса

patch/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}
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/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 } }

Delete a discussion

Delete a discussion from a team's page.

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}.

OAuth app tokens and personal access tokens (classic) need the write:discussion scope to use this endpoint.

Параметры для "Delete a discussion"

Заголовки
Имя., Тип, Description
accept string

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

Параметры пути
Имя., Тип, Description
org string Обязательное поле

The organization name. The name is not case sensitive.

team_slug string Обязательное поле

The slug of the team name.

discussion_number integer Обязательное поле

The number that identifies the discussion.

Коды состояния http-ответа для "Delete a discussion"

Код состоянияОписание
204

No Content

Примеры кода для "Delete a discussion"

Пример запроса

delete/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}
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/discussions/DISCUSSION_NUMBER

Response

Status: 204

List discussions (Legacy)

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 app tokens and personal access tokens (classic) need the read:discussion scope to use this endpoint.

Параметры для "List discussions (Legacy)"

Заголовки
Имя., Тип, Description
accept string

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

Параметры пути
Имя., Тип, Description
team_id integer Обязательное поле

The unique identifier of the team.

Параметры запроса
Имя., Тип, Description
direction string

The direction to sort the results by.

По умолчанию.: desc

Возможные значения: asc, desc

per_page integer

The number of results per page (max 100). For more information, see "Using pagination in the REST API."

По умолчанию.: 30

page integer

The page number of the results to fetch. For more information, see "Using pagination in the REST API."

По умолчанию.: 1

Коды состояния http-ответа для "List discussions (Legacy)"

Код состоянияОписание
200

OK

Примеры кода для "List discussions (Legacy)"

Пример запроса

get/teams/{team_id}/discussions
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/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 } } ]

Create a discussion (Legacy)

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.

This endpoint triggers notifications. Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see "Rate limits for the API" and "Best practices for using the REST API."

OAuth app tokens and personal access tokens (classic) need the write:discussion scope to use this endpoint.

Параметры для "Create a discussion (Legacy)"

Заголовки
Имя., Тип, Description
accept string

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

Параметры пути
Имя., Тип, Description
team_id integer Обязательное поле

The unique identifier of the team.

Параметры запроса
Имя., Тип, Description
title string Обязательное поле

The discussion post's title.

body string Обязательное поле

The discussion post's body text.

private boolean

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.

По умолчанию.: false

Коды состояния http-ответа для "Create a discussion (Legacy)"

Код состоянияОписание
201

Created

Примеры кода для "Create a discussion (Legacy)"

Пример запроса

post/teams/{team_id}/discussions
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/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 } }

Get a discussion (Legacy)

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 app tokens and personal access tokens (classic) need the read:discussion scope to use this endpoint.

Параметры для "Get a discussion (Legacy)"

Заголовки
Имя., Тип, Description
accept string

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

Параметры пути
Имя., Тип, Description
team_id integer Обязательное поле

The unique identifier of the team.

discussion_number integer Обязательное поле

The number that identifies the discussion.

Коды состояния http-ответа для "Get a discussion (Legacy)"

Код состоянияОписание
200

OK

Примеры кода для "Get a discussion (Legacy)"

Пример запроса

get/teams/{team_id}/discussions/{discussion_number}
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/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 } }

Update a discussion (Legacy)

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 app tokens and personal access tokens (classic) need the write:discussion scope to use this endpoint.

Параметры для "Update a discussion (Legacy)"

Заголовки
Имя., Тип, Description
accept string

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

Параметры пути
Имя., Тип, Description
team_id integer Обязательное поле

The unique identifier of the team.

discussion_number integer Обязательное поле

The number that identifies the discussion.

Параметры запроса
Имя., Тип, Description
title string

The discussion post's title.

body string

The discussion post's body text.

Коды состояния http-ответа для "Update a discussion (Legacy)"

Код состоянияОписание
200

OK

Примеры кода для "Update a discussion (Legacy)"

Пример запроса

patch/teams/{team_id}/discussions/{discussion_number}
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/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 } }

Delete a discussion (Legacy)

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 app tokens and personal access tokens (classic) need the write:discussion scope to use this endpoint.

Параметры для "Delete a discussion (Legacy)"

Заголовки
Имя., Тип, Description
accept string

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

Параметры пути
Имя., Тип, Description
team_id integer Обязательное поле

The unique identifier of the team.

discussion_number integer Обязательное поле

The number that identifies the discussion.

Коды состояния http-ответа для "Delete a discussion (Legacy)"

Код состоянияОписание
204

No Content

Примеры кода для "Delete a discussion (Legacy)"

Пример запроса

delete/teams/{team_id}/discussions/{discussion_number}
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/teams/TEAM_ID/discussions/DISCUSSION_NUMBER

Response

Status: 204