This evening, after being inspired by How to get (unread) achievements?, I did some analysis with mitmproxy. It turns out that the Stack Exchange mobile apps use an undocumented API v2.3 method for this: /me/achievements
.
A GET
call to https://api.stackexchange.com/2.3/me/achievements?pageSize=100&filter=*-t3H1VAnvpZbcZ&access_token=[ACCESS_TOKEN]&key=[KEY]
yields the following result:
{
"quota_max": 10000,
"quota_remaining": 7999,
"has_more": false,
"items": [
{
"achievement_type": "reputation",
"account_id": 6085540,
"reputation_change": 2,
"is_unread": false,
"link": "https://ux.stackexchange.com/questions/130203/whats-the-best-way-to-combine-an-action-outside-of-the-ui-with-an-action-in-the/130208#130208",
"creation_date": 1574444062,
"title": "What's the best way to combine an action outside of the UI with an action in the UI?",
"on_site": {
"icon_url": "https://cdn.sstatic.net/Sites/ux/img/apple-touch-icon.png",
"aliases": [
"http://ui.stackexchange.com"
],
"site_url": "https://ux.stackexchange.com",
"api_site_parameter": "ux",
"name": "User Experience",
"high_resolution_icon_url": "https://cdn.sstatic.net/Sites/ux/img/[email protected]"
}
},
{
"achievement_type": "reputation",
"account_id": 6085540,
"reputation_change": 10,
"is_unread": false,
"link": "https://meta.stackexchange.com/questions/334137/dismiss-the-meet-the-overflow-and-podcast-episode-banners-network-wide/334202#334202",
"creation_date": 1574443466,
"title": "Dismiss the "Meet The Overflow" and Podcast Episode banners network-wide",
"on_site": {
"icon_url": "https://meta.stackexchange.com/content/Sites/stackexchangemeta/img/apple-touch-icon.png",
"site_url": "https://meta.stackexchange.com",
"api_site_parameter": "meta",
"name": "Meta Stack Exchange",
"high_resolution_icon_url": "https://meta.stackexchange.com/content/Sites/stackexchangemeta/img/[email protected]"
}
},
...
It works with any Stack App token, not just the ones from the mobile apps. You'll probably need one with scope read_inbox
, though I haven't tested that.
There's a related GET
call to https://mobile.stackexchange.com/1/push/topbar-counts?filter=vqc7J
which returns the number of unread inbox items and the total new reputation (the green +x
badge), but it only works with a token which belongs to the mobile apps. It returns something like this:
{
"total": 1,
"quota_max": 2147483647,
"quota_remaining": 2147483647,
"has_more": false,
"page": 1,
"type": "mobile_top_bar_counts",
"items": [
{
"unread_inbox_count": 0,
"account_id": 6085540,
"unviewed_non_rep_count": 0,
"unviewed_rep_count": 0
}
],
"page_size": 1
}
The filter
seems to be necessary; without it, I get a backoff response.