8

Screenshot / Code Snippet

StackExchangeApi api = new StackExchangeApi(key);
api.authorize(authToken);

StackExchangeSite siteService = api.getSiteService(StackExchangeSite.STACK_OVERFLOW);
Response<User> users = siteService.getUsers();
for (User user : users) {
    System.out.println(user.getDisplayName());
}

StackExchange service = api.getService();
Response<Site> sites = service.getSites();
sites.getQuotaRemaining();

About

StackExchange API Java wrapper is a Java wrapper for StackExchange API v2.2. ;-) Right now it's in early development stage. I am posting it here because I would like to build it with you. This tool should be helpful for you, so I would like to hear some feedback from you about any feature or idea you have.

This library uses retrofit for HTTP requests.

It will be available also in maven repository.

License

StackExchange API Java wrapper is available under the MIT license.

Download

Releases will be available in GitHub releases section.

Platform

Java/Android

Contact

You can contact me here, using jakub at hsz.mobi or GitHub issues.

Code

Source code is available under my hsz/StackExchange repository.

Feel free to fork and pull request.

1 Answer 1

4

a few questions i have about your API.

  1. based on the user can I get a list of all questions and answers the user has?
  2. giving a user can I get a List<Questions> and List<Answer> that the user has made?
  3. will the answer object have the following methods:
    • Answer.addPlus()
    • Answer.removePlus()
    • Answer.addNegitive()
    • Answer.removeNegitive()
    • Answer.setAccepted()
    • Answer.unsetAccepted()
  4. can you do a search for names and get a List<user> that match or closely match the String you pass?
  5. If credentials are passed in can user object delete account?
  6. If credentials are passed in can user object delete/un-delete answers/questions?
  7. If credentials are passed in can user make new question?
  8. also interested in user.getReputation().
  9. also interested in Answer.getScore() to get the current up/down score.
  10. Question.getScore() , Question.addStar() , Question.removeStar() , Question.isStared()
  11. User.getStared() should return a List<Questions>
  12. User.getPlusQuestions() , User.getNegitiveQuestions() , User.getPlusAnswers()' ,User.getNegitiveQuesionts()That way with the user object you can get a list of questions and ansers that user has +1 or -1. Using simpleListandList` would make this very easy to use.
  13. Answers and questions should also have the following methods addComment(String msg),removeComment(int id), getComments() "would return a List<comment>, the removeComment() may work better as part of the comment object. There should be an easy way to get the comment id from the comment object.

I'm very excited about your api and hope to see it on github. also If you added a plus and then call add negative it should know it should remove the plus prior to adding the negative.

UPDATE:

also interested for more User settings (delete account, new account, change password, all account settings) This would be great for when you want to manage your account.

7
  • His code is available on GitHub. Have you tried it? That would answer many of these questions. Commented Mar 2, 2015 at 20:25
  • Yeah I just forked the project and started looking into it. There is not a lot of methods so far just a lot of protected variables. Not to many comments or documents so far to tell what is going on. Commented Mar 2, 2015 at 20:27
  • 1
    Can this be use for things other than maven? Commented Mar 2, 2015 at 20:29
  • 1
    If I do some improvements on this how do I submit it back to him to consider merging it on github. Commented Mar 2, 2015 at 20:32
  • You would use a standard GitHub pull request. Commented Mar 2, 2015 at 20:54
  • just noticed how old this is. Is this api dead? is he still working on it? The last update he did on github is over a year ago. Commented Mar 2, 2015 at 22:09
  • The OP will have to answer that, but keep in mind that the SE API, that this Java API wraps, last changed over a year ago (version 2.2). Commented Mar 2, 2015 at 22:26

You must log in to answer this question.

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