r/GraphAPI • • Feb 20 '23

C# SDK Graph API batching device (issues with working with returned data)

2 Upvotes

I am having issues with the C# SDK when reading the data back from the batching calls. I can't find an excellent way to get it into the Graph API device object (collection, list, array. or something I can work with)
tried to give things like. No joy on any of these

var devices = await returnedResponse.GetResponseByIdAsync<Device>(deviceReuestID);

var deviceList = await returnedResponse.GetResponseByIdAsync<List<Device>>(deviceReuestID); var deviceIcollection = await returnedResponse.GetResponseByIdAsync<IGraphServiceDevicesCollectionRequest>(deviceReuestID);

I'm using Microsoft.Graph.Beta version 4.44.0-preview (as at the time of writing this code last year I needed things that were not in none beta version of the SDK and/or API)


r/GraphAPI • • Jan 27 '22

Using the Microsoft Graph PowerShell SDK for getting privileged role members

Thumbnail self.powershell
1 Upvotes

r/GraphAPI • • Sep 15 '22

Get incremental changes for groups/users

2 Upvotes

I am synchronizing an Azure AD repository by periodically polling the changes in the repository. https://docs.microsoft.com/en-us/graph/delta-query-groups.

Normally an @odata.nextLink should only appear in the response if more data is expected. Unfortunately this is not the case and I sometimes get up to 50 empty @odata.nextLink responses before the final @odata.deltaLink is received.

What could be the reason for this?


r/GraphAPI • • Sep 21 '22

Use GraphAPI to create handwritten notes

2 Upvotes

Good Evening,

I am trying to insert handwritten notes into OneNote pages (specifically OneNote for Windows 10) using the OneNote GraphAPI. Basically i'm looking for a way to insert a set of points or splines depending on how OneNote represents them internally. With handwritten notes being the main feature of OneNote, and images and text begin well supported, i'm sure there is a way to insert notes into pages. So i'm asking you:

  1. Is it possible to insert handwritten notes into OneNote pages via the GraphAPI and if so how exactly does that work?

  2. If its impossible, i'd be very glad to hear about other programmatic ways of inserting handwritten notes aswell (although at first glance it would be extremely odd for such a basic feature to be missing). Is there maybe some way to embed it into HTML and serve it via the clipboard?

Otherwise, the application will have to resort to dragging the mouse pointer using the Windows API which is really error-prone, inefficient and doesn't work on phones.

Thank you in advance and i'm looking forward to your takes,

Erik


r/GraphAPI • • Jan 27 '22

Trying to learn MS Graph with PowerShell, having some issues

Thumbnail
self.powershell
1 Upvotes

r/GraphAPI • • May 24 '23

Any way to get R/W access to my own OneNote without registering an app?

1 Upvotes

I'm trying to do some automation on my own OneNote, and I'm trying to do so entirely without having to create an app on the organisation's AzureAD tenancy. Is there any way to get Notes.ReadWrite.All access without a registered app?

I'm using the (beta) Powershell cmdlets to do everything, so my process has been:


$clientid = "1111111-1111-1111-1111-111111111111"
$tenantid = "1111111-1111-1111-1111-111111111111"

import-module MSAL.PS
import-module microsoft.graph.notes

$token = get-msalToken -clientid $clientID -TenantId $tenantid -IntegratedWindowsAuth
connect-mggraph -accesstoken $token.AccessToken
$me = get-mguser -userid $token.account.HomeAccountId.ObjectId
$ctx = get-mgcontext

Get-MgUserOnenoteNotebook -UserId $me.id

This works to get me connected without any issues, but I don't have the Notes.ReadWrite.All scope.

Using connect-msgraph -scopes "Notes.ReadWrite.All" tells me that I need to get Admin approval; my organisational admin account doesn't have the access to grant that, though, so I'd need to go through hoops to get approval for what's essentially just a stupid little automation task.

Is there any way whatsoever to get access to the OneNote notes within the scope of my own account without having to register an App, which makes "stupid little automation task" a way bigger thing than it needs to be?


r/GraphAPI • • Dec 16 '22

Is it possible to create Appointments?

3 Upvotes

Update: Thank you ChatGBT! To create an appointment using the New-MgUserEvent cmdlet, you can set the -IsOnlineMeeting parameter to $false. This will create a normal appointment, rather than a meeting that involves inviting other attendees. If you also specify any attendees in your event parameters, this will override and create as a meeting.

TL;DR - I've created a script to generate a few hundred Appointments, only to then find out my events are being created as Meetings and not Appointments. I need simple appointments, no attendees.

Hi All,

I have a yearly task to generate a calendar with daily events for our staff and to date, I've manually created these events and modified them year to year for minor changes. I have been recently exploring the Graph PowerShell module that seems to be absorbing every other module and figured now is the time to start migrating my scripts to use these new cmdlets. I stumbled on New-MgUserEvent and thought I was set...

When I pull existing events, I can get both Meetings and Appointments, but reviewing the properties returned for each, I cannot find anything indicating one is a meeting and one is an appointment. Maybe the Graph Powershell modules don't support this, but does Graph API?


r/GraphAPI • • Nov 28 '22

Graph SDK - new-mggroup -owners issues.

3 Upvotes

having trouble with setting the owners parameter when using new-mggroup -owners. I have tried using UPN and Object ID. i am currently trying different iterations of the below code. (user id is sanitized)

provides error 1 $Owner = (Get-MgUser -UserId '[email protected]').id $GroupOwner = "https://graph.microsoft.com/v1.0/users/" + $Owner

provides error 2 $temp = (Get-MgUser -UserId '[email protected]') $GroupOwner = $temp.Values

$GroupParameters = @{ DisplayName = "GraphTest" Description = "Graph SDK for Powershell test " GroupTypes = "Unified" MailNickname = "GraphTest" SecurityEnabled = $true MailEnabled = $false MembershipRuleProcessingState = "On" Visibility = "private" owners = $GroupOwner }

New-MgGroup @GroupParameters

error 1 Cannot process argument transformation on parameter 'Owners'. Cannot convert value "System.Collections.Generic.Dictionary`2+ValueCollection[System.String,System.Object]" to type "Microsoft.Graph.PowerShell.Models.IMicrosoftGraphDirectoryObject[]". Error: "Cannot convert the "https://graph.microsoft.com/v1.0/$metadata#users/$entity" value of type "System.String" to type "Microsoft.Graph.PowerShell.Models.IMicrosoftGraphDirectoryObject"."

error 2 New-MgGroup_CreateExpanded: The context URL 'https://graph.microsoft.com/v1.0/$metadata#users/$entity' is invalid.


r/GraphAPI • • Jan 25 '23

MS Graph API permissions

3 Upvotes

I am guessing this group is full of MS Graph experts so I will ask here. Since this is specifically about Graph API permissions.

I am seeing various questions while study for MS-100 with answer choices that have graph permissions like organization.read.all and directory.read.all. I understand that Directory is at a higher level than organization but I am having a hard time finding something/documentation that actually helps me know exactly what an organization vs a directory is. Like real world examples of what each are within the same company. Any help would be greatly appreciated.


r/GraphAPI • • Nov 03 '22

Get cert from mac keychain for msal auth

1 Upvotes

Hi,

Does anyone know the mac equivalent of doing this? Need to get the cert out of the keychain. I have exported / uploaded to Azure AD app registration already.

windows code:

$CertificatePath = "Cert:\LocalMachine\my\<thumbprint>"

Thanks!


r/GraphAPI • • Mar 13 '23

Teams Clone call increased time (30 min)

3 Upvotes

Hi,

I'm using the Graph API and the Clone call ( /teams/{id}/clone ) in a flow when provisioning new teams. Up until recently (last Februrary) that call was quick in the transition from state "notStarted" to "succeeded" however now I can see this to be 30 minutes. Looking at my flow runs from before the execution time was 3-5 minutes and today its 30-40 minutes.

My Flow is built on the idea from this post with some modifications where I for example are waiting on the team request state to be "succeeded" or "failed" and not "running" as they have in the post.

I have also tried to clone a team using the Microsoft.Graph.Teams PowerShell module with a similar delay of 30 min (from when the command is run until I get notified that I have been added to a new team).

Anyone else noticing this and ideas on way forward?


r/GraphAPI • • Apr 20 '22

Request Limit per Authentication?

3 Upvotes

I am using GraphAPI to export planner tasks into an excel sheet. After i authenticate it exports the first 20 tasks without issue. After that it wants me to authenticate for each additional task. I could only find limits of requests per second or amount of data per request, but not a limit of overall requests per authentication


r/GraphAPI • • Jun 09 '23

Where does the 'from' user field get set from when using Graph API for 'Send chatMessage in channel' but the from field isn't specified in the request body?

2 Upvotes

We are setting up an automation to send a message to a Microsoft Teams channel using an app to integrate with Graph API. We are able to send the message successfully however, we are looking to adjust who the message comes from. Unfortunately we are using an integration that doesn't allow additional fields to be set outside of Teams ID, channel ID, and the message body. Does anyone know how the api determines who the message should come from if it isn't specified in the POST request?

We have attempted updating the owner of the app in Azure but no change. Suspecting it might be the user who authorized the app but we haven't been able to test with the other team.


r/GraphAPI • • Feb 25 '23

Get all past callRecords and onlineMeetings of the past month

2 Upvotes

It seems that it's possible to get single records (i.e. GET /me/onlineMeetings/{meetingId} or GET https://graph.microsoft.com/v1.0/communications/callRecords/{id}) but how could someone get the IDs?

Let's say I want all of my records of the past week or the past month. There must be some way, right?

In the end I just want to have a possibility to see for how long I had meetings and calls with whom. So I basically want to see if who spontaneously called two weeks ago and that the call went 45 minutes.


r/GraphAPI • • Mar 10 '23

GraphAPI and OneNote Endpoint

3 Upvotes

I am having issues with this one here:

https://graph.microsoft.com/{version}/sites/{id}/onenote/{notebooks | sections | sectionGroups | pages}

When sending a GET request to https://graph.microsoft.com/v1.0/sites/{id}/onenote/notebooks it returns a

The OData query is invalid. The URI segment 'notebooks' is invalid after the segment 'notes'.  

I aslo verified the same issue with Powershell Graph API using:

Connect-MgGraph -Scopes "Notes.Read.All", "Sites.Read.All"
Get-MgSiteOnenoteNotebook -SiteId $Site.Id

Error: Get-MgSiteOnenoteNotebook : The OData query is invalid. The URI segment 'notebooks' is invalid after the segment 
'notes'.

Where can I report the bug, if it is one. Can anyone help by verifying for me?


r/GraphAPI • • Feb 16 '22

Noob to Graph API: Missing Role Permissions?

2 Upvotes

Hey everyone..

I'm a bit over my head here, so want to post and get some direction (if even possible)

I want to make a project that in the end needs the MS TEAMS status of everyone in my group chat (I want to light up some LEDS to match the status color for everyone in the group)

I went to Azure, registered my 'app'I went to Postman to test things out...

MSGraphs > Application > TEAMS > (any of the GET options)

I -think- I have done everything correctly.. so far. if I try any of the example calls (GET....etc) from the left panel.. I seem to get permission errors.

"error": {
        "code": "Forbidden",
        "message": "Missing role permissions on the request. API requires one of 'ChannelSettings.Read.All, Channel.ReadBasic.All, ChannelSettings.ReadWrite.All, Group.Read.All, Directory.Read.All, Group.ReadWrite.All, Directory.ReadWrite.All, ChannelSettings.Read.Group, ChannelSettings.Edit.Group, ChannelSettings.ReadWrite.Group'. Roles on the request ''. Resource specific consent grants on the request ''.",

So while I have been fudging my way through all this (being lost/guessing a bit).. I am completely lost at what to do at this point. My guess is nothing. As this would require my jobs 'admin' to do something on a permission/access level then? Is there ANYTHING that can be done publicly? Or is it me, and I am doing something wrong? Maybe POSTMAN is set up incorrectly? (although I dont think I'd be getting those message/response then)

Can I access -anything-? :)

Any legit direction or suggestions is appreciated.

Thanks


r/GraphAPI • • Feb 27 '23

Get Intune device information (Serial)

2 Upvotes

I have been searching and reading for solutions to what I am looking for with no avail.
I am looking to get a list of Intune devices serial information from graph using PowerShell or rest method.
Is there any call that I can obtain the devices serial?


r/GraphAPI • • Apr 22 '22

Graph API long-lived tokens.

2 Upvotes

I have a bit of an odd request.

I have an MFT platform that I need to convert mailbox access from basic auth to OAuth2. The problem is, the mailbox resource only takes a token as plain text input, it does not have a way to request tokens on its own. So my backup plan was to request tokens through the Graph API on behalf of the MFT's service account. But as everyone knows, Graph API tokens are short-lived at 3599 seconds (1 hour).

Is it 1) possible to generate a long-lived token (longest interval possible, preferred 1 year) and 2) how would I go about doing that? I've done some reading on changing the access token policy but do not want to make that change tenant-wide.


r/GraphAPI • • Feb 08 '23

POST request to Graph API to handle JSON objects.

2 Upvotes

Can anyone point me in the right direction:

My end goal is to be able to send a POST request to Graph API, parse the JSON body and record the output in Excel or PowerBI.

I’m trying to migrate this scenario from Google App Scripts and I’m having trouble finding a the correct documentation for receiving HTTP requests in Graph API.

Thanks in Advance!!


r/GraphAPI • • Apr 17 '23

Exporting Bitlocker keys from AAD - Help!

3 Upvotes

Hello! I'm trying to use the Get-MgInformationProtectionBitlockerRecoveryKey cmdlet or the https://graph.microsoft.com/v1.0/informationProtection/bitlocker/recoveryKeys/ API call to pull bitlocker keys for batches of devices.

No matter how I authenticate (app with cert, secret, as myself, as a test account, etc.) I'm unable to pull the keys - I'm hit with:

Welcome To Microsoft Graph!
Failed to authorize, token doesn't have the required permissions.

Everything has the appropriate permissions (Read users/devices, BitLockerKey.Read.All, and security reader role).

Has anyone had any success with exporting these keys from AAD? How did you authenticate?


r/GraphAPI • • Oct 12 '22

Creation of personal contacts in m365 mailboxes via Graph API is slow

2 Upvotes

Hi all, we are using a PowerShell script to sync contacts from our CRM to our staff personal contacts however are finding that the process is slow and hoping others have found a way to do this in bulk.

We have around 30 mailboxes and around 4,000 contacts. So if at times all contact records have been touched and need to be pushed to m365 mailbox personal contacts, this takes about 2-4 secs per record, sometimes longer.

We've looked at parallel processing however then we run into throttling issues by the server.

If anyone has worked an issue like this, please share.


r/GraphAPI • • Jun 28 '22

Cloud not syncing

1 Upvotes

Hi Guys,

I’ve managed to reset passwords through Graph API using Laravel, however the password only works for cloud applications like Teams or Outlook but not Windows.

Could someone explain what i’m missing? I’m assuming it’s not syncing but how would I get it to sync?


r/GraphAPI • • May 30 '23

Retrieve Non-Useable Authentication methods through MSGraph Powershell

3 Upvotes

Hello,

We are in the middle of a MFA rollout and as expected some users are not following the Authenticator workflow correctly, which results in "Non-usable authentications methods" in their AzureAD account.
To be more reactive in such cases, we'd like to retrieve this information directly from AzureAD through MsGraph, but it seems the information isn't available in the get-mguserauthenticationmethod cmdlet: there is no distinction between useable and non-useable methods.
is there a way to retrieve the Auth method status somewhere else?


r/GraphAPI • • Jan 27 '22

Send an E-Mail using the MS-Graph PowerShell Commandlets in 3 steps

Thumbnail
powershell.co.at
1 Upvotes