All Projects → microsoftgraph → Msgraph Sdk Java

microsoftgraph / Msgraph Sdk Java

Licence: mit
Microsoft Graph SDK for Java

Programming Languages

java
68154 projects - #9 most used programming language

Labels

Projects that are alternatives of or similar to Msgraph Sdk Java

Card.io Android Sdk
card.io provides fast, easy credit card scanning in mobile apps
Stars: ✭ 1,942 (+955.43%)
Mutual labels:  sdk
Iot Nodejs
Client libraries and samples for connecting to IBM Watson IoT using nodejs
Stars: ✭ 170 (-7.61%)
Mutual labels:  sdk
Paypal Php Sdk
PHP SDK for PayPal RESTful APIs
Stars: ✭ 2,100 (+1041.3%)
Mutual labels:  sdk
Wordpress Sdk
Stars: ✭ 162 (-11.96%)
Mutual labels:  sdk
Countly Sdk Web
Countly Product Analytics SDK for websites and web applications
Stars: ✭ 165 (-10.33%)
Mutual labels:  sdk
Dingtalkchatbotsdk
钉钉群机器人(.net跨平台)
Stars: ✭ 172 (-6.52%)
Mutual labels:  sdk
Onesignal Unity Sdk
OneSignal is a free push notification service for mobile apps. This plugin makes it easy to integrate your Unity app with OneSignal. https://onesignal.com
Stars: ✭ 161 (-12.5%)
Mutual labels:  sdk
Meilisearch Js
Javascript client for the MeiliSearch API
Stars: ✭ 183 (-0.54%)
Mutual labels:  sdk
Js Sdk
JavaScript & Node.js SDKs for the Elastic Path Commerce Cloud eCommerce API
Stars: ✭ 169 (-8.15%)
Mutual labels:  sdk
Cognitive Face Windows
Windows SDK for the Microsoft Face API, part of Cognitive Services
Stars: ✭ 175 (-4.89%)
Mutual labels:  sdk
Kendryte Freertos Sdk
Kendryte K210 SDK with FreeRTOS
Stars: ✭ 164 (-10.87%)
Mutual labels:  sdk
Telegram Bot Sdk
🤖 Telegram Bot API PHP SDK. Lets you build Telegram Bots easily! Supports Laravel out of the box.
Stars: ✭ 2,212 (+1102.17%)
Mutual labels:  sdk
Applicationinsights Java
Application Insights for Java
Stars: ✭ 172 (-6.52%)
Mutual labels:  sdk
Miband Android
Unofficial SDK for Xiaomi Mi Band
Stars: ✭ 162 (-11.96%)
Mutual labels:  sdk
Ios Consent Sdk
Configurable consent SDK for iOS
Stars: ✭ 178 (-3.26%)
Mutual labels:  sdk
Contentful Management.js
JavaScript library for Contentful's Management API (node & browser)
Stars: ✭ 160 (-13.04%)
Mutual labels:  sdk
Gpu performance api
GPU Performance API for AMD GPUs
Stars: ✭ 170 (-7.61%)
Mutual labels:  sdk
Huobi java
Java SDK for Huobi Spot API
Stars: ✭ 180 (-2.17%)
Mutual labels:  sdk
Iot Python
Client libraries and samples for connecting to IBM Watson IoT using Python 2.7 and 3.x
Stars: ✭ 183 (-0.54%)
Mutual labels:  sdk
Alipay Sdk Python All
支付宝开放平台 Alipay SDK for Python
Stars: ✭ 174 (-5.43%)
Mutual labels:  sdk

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!

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

1. Installation

1.1 Install via Gradle

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

repositories {
    mavenCentral()
}

dependencies {
    // Include the sdk as a dependency
    implementation 'com.microsoft.graph:microsoft-graph:3.0.0'
    // Uncomment the line below if you are building an android application
    //implementation 'com.google.guava:guava:29.0-android'
}

1.2 Install via Maven

Add the dependency in dependencies in pom.xml

<dependency>
  <groupId>com.microsoft.graph</groupId>
  <artifactId>microsoft-graph</artifactId>
  <version>3.0.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. 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 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 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.

GraphServiceClient<Request> 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:

final Drive result = graphClient
  .me()
  .drive()
  .buildRequest()
  .get();
System.out.println("Found Drive " + result.id);

Or with the asynchronous API.

graphClient
  .me()
  .drive()
  .buildRequest()
  .futureGet()
  .thenApply(result -> {
    System.out.println("Found Drive " + result.id);
  });

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.

7. Supported Java versions

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

Android developers targeting lower android API levels can do so by enabling desugaring in their project.

8. License

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

9. Third-party notices

Third-party notices

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].