Skip to main content
3 of 3
added 5 characters in body; edited tags
Glorfindel
  • 6.9k
  • 3
  • 22
  • 49

Can I get the question id in the inbox route?

My intended behavior of my app is to navigate the user the the question page when an inbox item gets clicked.

For example, when the API return a link like this https://stackapps.com/questions/8515/after-which-time-span-can-my-vote-no-longer-change/8517#8517 I navigate in my app to questions/8515/after-which-time-span-can-my-vote-no-longer-change/8517#8517 and everything works fine.
Here I can simply use the question id 8515 to navigate to the question and 8517#8517 to highlight the answer.

To come to my problem now. When I use the inbox route I'm interested in two item_types :

  • new_answer
  • comment

Both contain a link that for me is hard to use, because they don't contain the question id. e.g.:

  • https://stackapps.com/a/8517?noredirect=1 (item_type: new_answer)
  • https://stackapps.com/posts/comments/17601?noredirect=1 (item_type: comment)

Is there any way to figure out the question id of the answer / comment without making another request like [answers by ids][1]?

[1]: https://api.stackexchange.com/docs/answers-by-ids#filter=!SWJ_U*(icXTT70ePdT