GithubHelp home page GithubHelp logo

chriso1977 / msgraph-sdk-java Goto Github PK

View Code? Open in Web Editor NEW

This project forked from microsoftgraph/msgraph-sdk-java

1.0 2.0 0.0 11.47 MB

Microsoft Graph SDK for Java

Home Page: https://developer.microsoft.com/graph

License: MIT License

Java 100.00%

msgraph-sdk-java's Introduction

Microsoft Graph SDK for Java

Download

Get started with the Microsoft Graph SDK for Java by integrating the Microsoft Graph API into your Java application!

1. Installation

1.1 Install via Gradle

Add the repository and a compile dependency for microsoft-graph to your project's build.gradle:

repository {
    jcenter()
}

dependency {
    // Include the sdk as a dependency
    compile('com.microsoft.graph:microsoft-graph:1.8.+')
}

1.2 Install via Maven

Add the dependency in dependencies in pom.xml

<dependency>
	<groupId>com.microsoft.graph</groupId>
	<artifactId>microsoft-graph</artifactId>
	<version>1.8.0</version>
</dependency>

1.3 Enable ProGuard (Android)

The nature of the Graph API is such that the SDK needs quite a large set of classes to describe its functionality. You need to ensure that ProGuard is enabled on your project. Otherwise, you will incur long build times for functionality that is not necessarily relevant to your particular application. If you are still hitting the 64K method limit, you can also enable multidexing.

2. Getting started

2.1 Register your application

Register your application by following the steps at Register your app with the Azure AD v2.0 endpoint.

2.2 Create an IAuthenticationProvider object

An instance of the GraphServiceClient class handles building requests, sending them to the Microsoft Graph API, and processing the responses. To create a new instance of this class, you need to provide an instance of IAuthenticationProvider, which can authenticate requests to Microsoft Graph.

For an example of authentication in a client application, see the MSGraph SDK Android MSA Auth for Android Adapter.

2.3 Get a GraphServiceClient object

After you have set the correct application ID and URL, you must get a GraphServiceClient object to make requests against the service. The SDK stores the account information for you, but when a user signs in for the first time, it invokes the UI to get the user's account information.

IGraphServiceClient graphClient = 
  GraphServiceClient
    .builder()
    .authenticationProvider(authenticationProvider)
    .buildClient();

3. Make requests against the service

After you have a GraphServiceClient that is authenticated, you can begin making calls against the service. The requests against the service look like our REST API.

3.1 Get the user's drive

To retrieve the user's drive:

graphClient
  .me()
  .drive()
  .buildRequest()
  .get(new ICallback<Drive>() {
     @Override
     public void success(final Drive result) {
        System.out.println("Found Drive " + result.id);
     }
     ...
     // Handle failure case
  });

For a general overview of how the SDK is designed, see overview.

4. Documentation

For more detailed documentation, see:

5. Issues

For known issues, see issues.

6. Contributions

The Microsoft Graph SDK is open for contribution. To contribute to this project, see Contributing.

Thanks to everyone who has already devoted time to improving the library:


Caitlin Bales

๐Ÿ’ฌ ๐Ÿ’ป ๐Ÿ“– ๐Ÿ‘€ โš ๏ธ

David Moten

๐Ÿ› ๐Ÿ’ป ๐Ÿ“– ๐Ÿค” ๐Ÿ‘€ โš ๏ธ

Michael Mainer

๐Ÿ’ฌ ๐Ÿค” ๐Ÿ‘€

Linda Caputo

๐Ÿ“–

John Austin

๐Ÿ›

Dmitry Pimenov

๐Ÿค”

Jonathan Giles

๐Ÿค”

Martin Sawicki

๐Ÿค”

Louis Maresca

๐Ÿค” ๐Ÿ‘€

Josef H.B. Schneider

๐Ÿ› ๐Ÿ’ป

Deepak Agrawal

๐Ÿ’ป

Ben Tipper

Nakul Sabharwal

๐Ÿ’ป ๐Ÿ‘€

This project follows the all-contributors specification. Contributions of any kind are welcome!

7. Supported Java versions

The Microsoft Graph SDK for Java library is supported at runtime for Java 7+ and Android API revision 15 and greater.

8. License

Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT license.

9. Third-party notices

Third-party notices

msgraph-sdk-java's People

Contributors

deepak2016 avatar nakulsabharwal avatar davidmoten avatar michaelmainer avatar krototype avatar kitherill avatar bilalgce avatar bt454 avatar sailreal avatar linda-editor avatar bullsseye avatar gbuac avatar j0s3f avatar culmat avatar muthurathinam avatar vikasprabhakar avatar github-actions[bot] avatar

Stargazers

 avatar

Watchers

James Cloos 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.