3

I ran /inbox/unread & /me/inbox/unread.

What is the difference between the two? Also, the site parameter which we give in call to /me/inbox/unread is not required as inbox_item refers to global inbox. Another reason is it is giving wrong results.

I gave programmers as site parameter in call to /me/inbox/unread, and I am getting all the unread inbox items, even though I didn't post any question to Programmers Stack Exchange.

1 Answer 1

2

There is no difference and...
The inbox has always been "The global inbox". Certainly for as long as the API has existed.

So any inbox route will be Stack Exchange wide, even if it accepts a site parameter. If you look at the doc for the /users/{id}/inbox/unread route, it says:

This method is effectively an alias for /inbox/unread. It is provided for consumers who make strong assumptions about operating within the context of a single site rather than the Stack Exchange network as a whole.

It's not too clear what good purpose that serves. Maybe it's for developers who feel naked unless they send a site parameter? 😉   (Except IIRC, extra parameters are generally ignored?)

Also, for almost every /users/{id}/xxx route, there is a convenient shorthand /me/xxx route -- where the user ID is taken to be the already authenticated user.

So we have:

  • /inbox/unread ~==~ /users/{id}/inbox/unread by "alias"
  • /users/{id}/inbox/unread ~==~ /me/inbox/unread by shorthand
  • So, /inbox/unread ~==~ /me/inbox/unread

Irregardless, they are de facto the same and have been since their introduction in API-2.0.

2
  • Very complex. No need to have two functions for the same purpose without any reason. site parameter has no purpose.
    – amit jha
    Commented Jul 22, 2015 at 10:12
  • I agree. At the very least, the docs should be clearer about why there are 2 duplicate functions. Commented Jul 22, 2015 at 20:18

You must log in to answer this question.

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