GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - microsoftgraph/msgraph-beta-sdk-java: Microsoft Graph Beta Java SDK

BranchesTags
Open more actions menu

Latest commit

 

History

2,198 Commits
2,198 Commits

Folders and files

NameName
Last commit message
Last commit date
.azure-pipelines
.azure-pipelines
 
 
.config
.config
 
 
.github
.github
 
 
.mvn/wrapper
.mvn/wrapper
 
 
.vscode
.vscode
 
 
android
android
 
 
docs
docs
 
 
scripts
scripts
 
 
src
src
 
 
.editorconfig
.editorconfig
 
 
.gitignore
.gitignore
 
 
.release-please-manifest.json
.release-please-manifest.json
 
 
CHANGELOG.md
CHANGELOG.md
 
 
CODE_OF_CONDUCT.md
CODE_OF_CONDUCT.md
 
 
CONTRIBUTING.md
CONTRIBUTING.md
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
SECURITY.md
SECURITY.md
 
 
THIRD PARTY NOTICES
THIRD PARTY NOTICES
 
 
devx.yml
devx.yml
 
 
msgraph-beta-sdk-java.yml
msgraph-beta-sdk-java.yml
 
 
mvnw
mvnw
 
 
mvnw.cmd
mvnw.cmd
 
 
pom.xml
pom.xml
 
 
release-please-config.json
release-please-config.json
 
 

Repository files navigation

Microsoft Graph SDK for Java

Version 6.1.0 now Generally Available!

Download

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

Note: this SDK allows you to build applications using the beta of Microsoft Graph. If you want to use the production supported Microsoft Graph APIs under v1.0, use our v1.0 SDK instead.

1. Installation

1.1 Install via Gradle

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

repositories {
  mavenCentral()
}

dependencies {
    // Include the sdk as a dependency
    // x-release-please-start-version
    implementation 'com.microsoft.graph:microsoft-graph-beta:6.66.0'
    // x-release-please-end
    // This dependency is only needed if you are using the TokenCrendentialAuthProvider
    implementation 'com.azure:azure-identity:1.11.0'
}

1.2 Install via Maven

Add the dependency in dependencies in pom.xml

<dependency>
  <!-- Include the sdk as a dependency -->
  <groupId>com.microsoft.graph</groupId>
  <artifactId>microsoft-graph-beta</artifactId>
  <!--x-release-please-start-version-->
  <version>6.66.0</version>
  <!--x-release-please-end-->
</dependency>
<dependency>
  <!-- This dependency is only needed if you are using the TokenCrendentialAuthProvider -->
  <groupId>com.azure</groupId>
  <artifactId>azure-identity</artifactId>
  <version>1.11.0</version>
</dependency>

Note: if the repositories node doesn't exist, add it in project. For more information about the maven repositories configuration, refer to this documentation.

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. Checkout the recommended rules.

2. Getting started

2.1 Register your application

Register your application by following the steps at Register your app with the Microsoft Identity Platform.

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 AuthenticationProvider, which can authenticate requests to Microsoft Graph.

For an example of how to get an authentication provider, see choose a Microsoft Graph authentication provider.

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.

final AzureIdentityAuthenticationProvider authenticationProvider =
        new AzureIdentityAuthenticationProvider(credential, null, scopes);
GraphServiceClient graphClient = new GraphServiceClient(authenticationProvider)

//Alternatively
GraphServiceClient graphClient = new GraphServiceClient(credential, scopes);

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 info

To retrieve the user's information:

User me = graphClient.me().get();
System.out.printf("Hello %s, your ID is %s%n", me.getDisplayName(), me.getId());

4. Documentation

For more detailed documentation, see:

  • Overview
  • Collections
  • Making requests
  • Known issues
  • Contributions

5. Issues

For known issues, see issues.

6. Contributions

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

7. Supported Java versions

The Microsoft Graph beta SDK for Java library is supported at runtime for Java 8+ and Android API revision 26 and greater.

8. License

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

9. Third-party notices

Third-party notices

About

Microsoft Graph Beta Java SDK

docs.microsoft.com/en-us/graph/sdks/use-beta?tabs=Java

Topics

devxengjavamicrosoft-graphsdk

Resources

Readme
MIT license

Code of conduct

Code of conduct

Contributing

Contributing

Security policy

Security policy
Activity
Custom properties

Stars

32 stars

Watchers

19 watching

Forks

15 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.