1

Is there an API function to get the contents of the user's inbox? For example, my inbox looks kind of like this:

2 comments on Bash Prompt keeps disappearing

What does that PS1 accomplish that PS1='\u@\h


comment on Get the current response from a RequestContext

When you say 'get_request()' you are referring

Is there a way to get this information? I'd essentially like to mimic the functionality of the inbox in my external application.

Otherwise, it looks like I'll be making a lot of queries and storing info in a local database and watching changes... not fun:

for question in get_user_questions():
    archived_question = None
    if has_archived_question(question):
        archived_question = get_archived_question()
    
    for comment in get_question_comments(question):
        if archived_question and comment not in archived_question.comments:
            notify_new_comment(comment)
            archived_question.comments.append(comment)
        else:
            notify_new_comment(comment)

    for answer in get_question_answers(question):
        if archived_question and answer not in archived_question.answers:
            notify_new_answer(answer)
            archived_question.answers.append(answer)
        else:
            notify_new_answer(answer)

        for comment in get_answer_comments(answer)
            ....

ad infinitum. I can only imagine how many queries this will generate just to simply find all new comments and answers for a given user. Is there an optimized way of doing this?

1 Answer 1

5

Currently, no. However, as an extension of the authentication mechanism being introduced in version 2.0 of the API you will be able to get access to the inbox data directly via the newly introduced /users/{id}/inbox route.

3
  • So, essentially, I need to flood StackExchange with recursive requests and locally cache info in order to determine actual changes, as opposed to reputation changes? Commented Oct 7, 2011 at 2:23
  • @TKKocheran: Well... or wait a few days until v2.0 of the API goes into beta. It really shouldn't be that long from now. Commented Oct 7, 2011 at 3:19
  • Oh, ok, good to know. I was thinking months or years and not days :) Commented Oct 7, 2011 at 4:05

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.