Home

OAuth requests

After you have successfully implemented OAuth's authorization process, you can now make requests to BibSonomy's API.

You can now use BibSonomy's rest logic interface to perform API operations.

RestLogicFactory rlf = new RestLogicFactory("<HOME_URL>/api", RenderingFormat.XML);
LogicInterface rl = rlf.getLogicAccess(accessor);

Post<Bookmark> testPost = generatePost(accessor.getRemoteUserId());

//
// publish first test post
//
List<Post<? extends Resource>> uploadPosts = new LinkedList<Post<? extends Resource>>();
uploadPosts.add(testPost);
testPost.getResource().recalculateHashes();
String firstHash = testPost.getResource().getIntraHash();
try {
    rl.createPosts(uploadPosts);
} catch (BadRequestOrResponseException e) {
    System.err.println(e.getMessage());
}

Please replace <HOME_URL> with https://www.bibsonomy.org/.

A running example can be found here. If you have further questions, please feel free to write a mail to api-support@bibsonomy.org.