Die REST-API verfügt jetzt über eine Versionskontrolle. Weitere Informationen findest du unter Informationen zur API-Versionsverwaltung.
REST-API-Endpunkte für Feeds
Verwende die REST-API, um mit GitHub-Feeds zu interagieren.
Get feeds
Lists the feeds available to the authenticated user. The response provides a URL for each feed. You can then get a specific feed by sending a request to one of the feed URLs.
- Timeline: The GitHub global public timeline
- User: The public timeline for any user, using
uri_template
. For more information, see "Hypermedia." - Current user public: The public timeline for the authenticated user
- Current user: The private timeline for the authenticated user
- Current user actor: The private timeline for activity created by the authenticated user
- Current user organizations: The private timeline for the organizations the authenticated user is a member of.
- Security advisories: A collection of public announcements that provide information about security-related vulnerabilities in software on GitHub.
By default, timeline resources are returned in JSON. You can specify the application/atom+xml
type in the Accept
header to return timeline resources in Atom format. For more information, see "Media types."
Note
Private feeds are only returned when authenticating via Basic Auth since current feed URIs use the older, non revocable auth tokens.
Differenzierte Zugriffstoken für "Get feeds"
Dieser Endpunkt funktioniert mit den folgenden differenzierten Tokentypen.:
- GitHub-App-Benutzerzugriffstoken
- Zugriffstoken für GitHub App-Installation
- Differenzierte persönliche Zugriffstoken
Das differenzierte Token erfordert keine Berechtigungen.
HTTP-Antwortstatuscodes für „Get feeds“
Statuscode | BESCHREIBUNG |
---|---|
200 | OK |
Codebeispiele für „Get feeds“
Anforderungsbeispiel
get/feeds
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/feeds
Response
Status: 200
{
"timeline_url": "https://github.com/timeline",
"user_url": "https://github.com/{user}",
"current_user_public_url": "https://github.com/octocat",
"current_user_url": "https://github.com/octocat.private?token=abc123",
"current_user_actor_url": "https://github.com/octocat.private.actor?token=abc123",
"current_user_organization_url": "",
"current_user_organization_urls": [
"https://github.com/organizations/github/octocat.private.atom?token=abc123"
],
"security_advisories_url": "https://github.com/security-advisories",
"_links": {
"timeline": {
"href": "https://github.com/timeline",
"type": "application/atom+xml"
},
"user": {
"href": "https://github.com/{user}",
"type": "application/atom+xml"
},
"current_user_public": {
"href": "https://github.com/octocat",
"type": "application/atom+xml"
},
"current_user": {
"href": "https://github.com/octocat.private?token=abc123",
"type": "application/atom+xml"
},
"current_user_actor": {
"href": "https://github.com/octocat.private.actor?token=abc123",
"type": "application/atom+xml"
},
"current_user_organization": {
"href": "",
"type": ""
},
"current_user_organizations": [
{
"href": "https://github.com/organizations/github/octocat.private.atom?token=abc123",
"type": "application/atom+xml"
}
],
"security_advisories": {
"href": "https://github.com/security-advisories",
"type": "application/atom+xml"
}
}
}