Access your Event timelines and OAuth tokens through the API
Today we’re announcing two new API features: Event Timeline access, and OAuth Authorizations. We’ve also tweaked the way mime types work in preparation for the finalization of API v3. Event…
Today we’re announcing two new API features: Event Timeline access, and OAuth Authorizations. We’ve also tweaked the way mime types work in preparation for the finalization of API v3.
Event Timelines
You can now access the events that power the various activity streams on GitHub. You may notice some timelines that don’t actually exist on the site too. Some highlights include:
# get events for a repository
$ curl https://api.github.com/repos/github/github/events
# get events for a public network
$ curl https://api.github.com/networks/sinatra/sinatra/events
# get events that a user has received
# this shows events from public repos that a user is watching.
$ curl https://api.github.com/users/technoweenie/received_events/public
Check out the full Event timeline docs, as well as description of the payloads for every Event type. These payloads are what custom webhooks will receive, too.
OAuth Authorizations
One complaint we hear about API v3 is the lack of token support. People want to be able to setup scripts without the hassle of authorizing the app through the OAuth workflow. For this, we’ve added the OAuth Authorizations API. If you want to create a quick token with the repo
scope:
$ curl -i -u "user:pass"
https://api.github.com/authorizations
-d '{"scopes":["repo"]}'
You can also add/remove scopes from authorizations, or delete them.
The OAuth docs have the specifics.
Mime Types
All resource mime types were simplified. Instead of sending a type like this to get HTML rendered comments:
application/vnd.github-pull.html+json
You can now just use this:
application/vnd.github.html+json
We also plan to make a few breaking changes in the next month before we move the API out of its beta state. If you’re using API v3, start specifying the ‘beta’ version so that you can have a graceful transition period at your own pace.
# for all API requests
Accept: application/vnd.github.v3+json
# when you want HTML comments:
Accept: application/vnd.github.v3.html+json
Example:
$ curl -H "Accept: application/vnd.github.beta.html+json"
https://api.github.com/repos/github/hubot/issues/123
Read more about the new mime types.
Written by
Related posts
![](https://github.blog/wp-content/uploads/2023/10/Collaboration-DarkMode-2.png?resize=400%2C212)
2024 is the biggest global election year in history. What’s at stake for developers?
GitHub is considering what is at stake for our users and platform, how we can take responsible action to support free and fair elections, and how developers contribute to resilient democratic processes.
![](https://github.blog/wp-content/uploads/2023/10/AI-DarkMode-2.png?resize=400%2C212)
GitHub named a Leader in the Gartner first-ever Magic Quadrant for AI Code Assistants
This year, as part of its annual Magic Quadrant series, Gartner published a first-of-its-kind report analyzing the state of play in the AI Code Assistants market–and named GitHub a Leader.
![AI in software development 2024 survey results with colorful graphics and percentages.](https://github.blog/wp-content/uploads/2024/08/ai-survey-header.png?resize=400%2C212)
Survey: The AI wave continues to grow on software development teams
We surveyed 2,000 people on software development teams at enterprises in the U.S., Brazil, India, and Germany about the use, experience, and expectations around generative AI tools in software development.