Giter VIP home page Giter VIP logo

java-discogs-client's Introduction

java-discogs-client

A client library to communicate with the API from discogs.com

Currently supported

Please be aware that this library is still in early development. I try to keep the public API of the client as small and stable as possible but things might change until the client is considered being feature complete.

Usage

The main entry point is the class DiscogsClient that provides access to API operations as well as authentication.

Example:

// Create a client without any authentication
DisogsClient client = new DiscogsClient();

The different API's are accessible through Operations. These can be retrieved using the following calls:

// Create a new authorization strategy that should be used with the operation.
AuthorizationStrategy auth = new TokenAuthenticationStrategy("my-secret-api-token");

// To get access to the database API
DatabaseOperations dbOps = client.getDatabaseOperations(auth);

// To get access to the user collection API
UserCollectionOperations userOps = client.getUserCollectionOperations(auth);

OAuth authentication

Note: This is not fully implemented yet.

// Create a new OAuth flow for a given clientKey and clientSecret
OAuthVector vector = new OAuthVector(clientKey, clientSecret);
OAuthFlow flow = client.getOAuthFlow(vector);

// Request a redirect URL to the authorization page
OAuthCredentials credentials = flow.getAuthenticationUrl();

// credentials will now contain a URL the user needs to be redirected to
// in order to grant access to his account through your application
String redirectUrl = credentials.getRedirectUrl();

// the user will be presented a page to grant access and has to enter
// the presented verification code in your application. You can then
// gain the access token with the following step
credentials = flow.getAccessToken(credentials, verificationCode);

// When the authenticatin was successful, credentials will now contain
// the access token and shared secret. This should be persisted somewhere.

java-discogs-client's People

Contributors

jruaux avatar mfischbo avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.