msgraph-sdk-java | Microsoft Graph SDK for Java | SDK library
kandi X-RAY | msgraph-sdk-java Summary
kandi X-RAY | msgraph-sdk-java Summary
Microsoft Graph SDK for Java
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Sets the raw JSON object to the given serializer
- Sets the raw json object
- Sets the raw JSON representation of this PagePagePage object
- Returns a list of function options associated with this request
- Gets the function options for this request
- Sets the raw content of this Page
- Returns the function options for the request
- Returns a list of function options for this request
- Set the raw JSON representation of this page
- Sets the raw JSON object to raw text
- Sets the raw JSON representation of this object
- Sets the raw workbook to the given serializer
- Returns the function options for this request
- Sets the raw value of this page
- Returns the function options
- Set the JSON representation of this object
- Sets the raw JSON representation of this page
- Sets the raw JSON representation of this request
- Gets the function options
- Sets the raw JSON representation of this Page
msgraph-sdk-java Key Features
msgraph-sdk-java Examples and Code Snippets
Community Discussions
Trending Discussions on msgraph-sdk-java
QUESTION
I am currently looking for a good JS library to use for my addin. And I came across this project : MSGRAPH-SDK-JAVASCRIPT
I tried to read through their project details but could not find out definitively if they support the SSO-OBO flow for addins.
Has anybody used the said library successfully for an SSO-OBO flow?
Thank you very much.
...ANSWER
Answered 2022-Feb-28 at 19:27Single sign on and MS Graph SDK are different things. You can use SSO to deal with Graph API from Outlook web add-ins. See Using Single Sign-On (SSO) with Office Add-ins for more information.
Also you may find the following posts helpful:
QUESTION
I have several Office 365 SharePoint sites. I would like my NodeJS based daemon that is registered as an Azure App Registration to write to several different folders within these SharePoint sites. I am struggling to get the correct syntax of the request url correct to create a resumable upload session. This is made worse by fairly unclear and non working examples provided by Microsoft. An important detail here is that the application is doing this without user delegation, meaning no user is using the application to cause these files but rather it is and should be the entity who owns the file uploads. Many examples show how to do this with user delegation. Some of the files being uploaded include binary or text content.
I have read quite a bit of the ms docs and referred to many questions. I even watched many videos on YouTube and started digging through source code with the microsoft-graph-client
incase there were insights to be had there. I don't think I can review graph server code or if that would be helpful. Below are just a few that I still I have open due to being closely related.
- Samples from GitHub
- GitHub repo docs - LargeFileUploadTask
- MS Docs - Getting drive item children
- MS Docs - createuploadsession
- SO - sharepoint-create-a-new-file-in-a-specific-drive-with-graph-api
Here is my latest attempt which I feel should be getting pretty close:
...ANSWER
Answered 2021-Dec-17 at 22:10I had to add a colon after the folder_id for the 2nd requestUrl format.
Also the await graph.LargeFileUploadTask
had to become new graph.LargeFileUploadTask
QUESTION
I'm currently experiencing an issue with the subscriptions endpoint.
When making a call to https://graph.microsoft.com/v1.0/subscriptions, a next link is returned.
...ANSWER
Answered 2021-Oct-13 at 08:05As of 2021-10-13, this issue is no longer occurring and the Graph API is once again functioning as expected.
QUESTION
I have recently upgraded my application to :
- Spring Boot: 2.4.4
- microsoft-graph: 3.0.0
While upgrading the application i have followed the upgrade guide.
I'm retrieving the group members using below code:
...ANSWER
Answered 2021-Mar-31 at 12:46The GraphServiceClient is being instantiated for each call. This in turns instantiates one OkHttpClient per GraphServiceClient, which in turns creates a connection pool. Because of the way connections are managed by OSes (they are kept open for a period because closing and opening a connection is a costly operation), this will lead to a port exhaustion on the machine.
The next requests that come in after no more ports are available, block waiting for a port to free and for a connection to be available, and eventually timeout with the exception you are seeing.
To fix that issue:
- Make sure your GraphClient class is instantiated once throughout the lifecycle of your application
- Implement some lazy loading for the getGraphServiceClient method, so it "caches" a client in a field and returns that if the value is not null instead of creating a new one for each call.
QUESTION
Application Type : Java Spring Boot Daemon application using Client Credentials Flow.
I was earlier using microsoft-graph 2.10.0 for fetching data from Microsoft graph. However with the recent microsoft-graph 3.0.0, I wanted to update the project.
Following the upgrade and auth details, i have used the below to get the GraphServiceClient using ClientCredentials azure-identity:
...ANSWER
Answered 2021-Mar-24 at 12:50For anyone facing the issue, below is a solution:
Project Details:
Spring Boot 2.4.4
microsoft-graph 3.0.0
Create GraphClient using below:
QUESTION
I am using UsernamePasswordCredential provider to connect to AAD and get de users using msgraph-sdk-java (https://github.com/microsoftgraph/msgraph-sdk-java), the code is the following:
...ANSWER
Answered 2021-Apr-13 at 13:00Your problem has been resolved through comments. Post it as an answer to end the thread:
Make sure your account is not a personal account.
Make sure you enable
Allow public client flows
.
- Using msal4j library and PublicClientApplication class to acquire a token with a username, password and scope.
QUESTION
I'm trying to send mail with multiple attachments (Sum of size is < 4MB) using Graph API version 2.3.2. Please find the following code snippet for the same.
...ANSWER
Answered 2020-Nov-03 at 14:33Your request is exceeding the maximum 4MB limit for Graph requests as:
- 1st pdf :3.6MB
- space usage increase for 1st PDF due to base64 encoding : 2.2MB
- 2nd pdf: 20kB
- space usage increase for 2nd PDF: 7kB
- JSON payload: probably a few kBs
the total being well over the 4MB limit. You need to use large attachment uploads for that PDF.
QUESTION
I am upgrading the version of the msgraph-sdk-java library in my project. I was using version 1.7.1 but I had some issues with setting conflict behavior when uploading files >4MB. I saw the issue was fixed in the latest version (see here) so I am trying to upgrade to version 2.3.0.
I updated my build.gradle file and noticed that now the interface IAuthenticationProvider is deprecated.
Provides authentication for a requests before it is sent by an HTTP provider.
@deprecated use ICoreAuthenticationProvider instead
It says I should use ICoreAuthenticationProvider instead but how do I build a new instance of GraphServiceClient without implementing the IAuthenticationProvider interface?
...ANSWER
Answered 2020-Oct-08 at 11:34Just use whatever implementation you would have.
Whilst it is deprecated, it still works for now.
I imagine an update will allow the ICoreAuthenticationProvider to be used in the GraphServiceClient constructor, but that's not present yet.
QUESTION
I'm trying to use Username/Password authentication for a Microsoft Graph files request (in conjunction with an AD account created for this purpose, since we want to limit access to only specific directories within SharePoint). I wrote some code using .Net Core's Graph SDK (working a-ok) that I'm porting to Java for a different application, and I can't get it to authenticate. I pasted the Java code I'm trying to run, its .Net Core equivalent, and lastly the whole debug-level log output from a run of the Java code.
I got the Java code as close as possible, but I didn't see an equivalent of the .WithUsernamePassword(email, password)
method (probably since the Java SDK gives the username and password directly to the constructor of UsernamePasswordProvider
).
I'm using v0.2.0 of the Auth library and v2.2.0 of the main SDK. I raised this as an issue with the msgraph-sdk-java-auth library, as it seems likely this might be a bug in the SDK, but I'm also curious for someone else to look at my Java code and let me know if I'm doing anything wrong, which is more likely.
Java code producing the exception ...ANSWER
Answered 2020-Sep-29 at 18:18This turned out to be a missing dependency, responsible for decoding the JSON responses. The NoClassDefFound
error wasn't getting propagated. The underlying error was that no scopes were specified, which came through once I added the org.json JAR to my classpath. I used the scope https://graph.microsoft.com/.default
.
QUESTION
I'm using msgraph-sdk-java-auth through an application that I've created.
I'm trying to get data from Microsoft Azure with the object AuthorizationCodeProvider
but I'm not able to understand how to get the AUTHORIZATION_CODE
parameter.
Somebody knows how to use this class?
Thanks!
...ANSWER
Answered 2020-Jun-17 at 08:16As far as I know, AUTHORIZATION_CODE
is the Authorization Code received from the initial authorize call. You could find the authorization_code in the Steps to get authorizationCode from the sample.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install msgraph-sdk-java
Add the dependency in dependencies in pom.xml.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page