9

I want to write a desktop widget that checks Stack Exchange API every several seconds and tells me if there are any new reputation changes. I can't figure out what API method I can use for that.

I tried https://api.stackexchange.com/docs/me-full-reputation-history#filter=default&site=stackoverflow, but it doesn't show which reputation changes are read or unread. I tried other methods as well, but none of them seem to do what I need.

Right now I'm testing those methods with 2 unread reputation changes.

4
  • 2
    AFAIK you can only get unread inbox (replies and similar) and unread notifications (badges, privileges and similar) but no unread reputation changes. That would be an extremly useful feature.
    – sergioFC
    Aug 2, 2015 at 14:12
  • You can always look at the JS code for the website and see where it gets the info from Aug 2, 2015 at 15:59
  • @UnicornsAreVeryVeryYummy AFAIK SE hooks into their own Web Sockets to find the unread rep/change with the subscribeToReputationNotifications function - it can be used by us - just connect to the socket is very easy, but it's not as helpful as the API would if this was implemented! (see full.js to see more) Aug 2, 2015 at 16:10
  • 1
    Suseika - it might be worth rephrasing this as a feature request rather than support!! Aug 5, 2015 at 19:23

1 Answer 1

1

I've posted an answer to a similar question on Stack Apps:

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/apple-touch-icon@2.png"
            }
        },
        {
            "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/apple-touch-icon@2.png"
            }
        },
...

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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .