How to get OrgContacts with Addresses with Microsoft Graph Delta endpoint? - microsoft-graph-api

I am trying to get the Org contacts of my tenant using this Delta endpoint:
GET https://graph.microsoft.com/v1.0/contacts/delta
which is documented here.
Unfortunately, this is not returned the Address of my contacts. In order to retrieve the addresses, I am obliged to call this endpoint instead:
GET https://graph.microsoft.com/v1.0/contacts
The issue is that I need to call the Delta endpoint because that returns the DeltaToken that I can use in the future to only pull the list of modified/deleted contacts.
Is there any workaround to do this, without having to go through both endpoints, the first one to get the DeltaToken, and the second one to get the addresses of my contacts? (PS: I tried the expand option with no luck).
Thanks!

AFAIK, Currently address of contacts is not returned using this delta endpoint.
Being said that, consider filing uservoice for your specific ask so it could be considered for future implementations.
Thanks.

Related

Microsoft Graph API - get drive "Url specified is invalid."

I am facing a weird issue with microsoft's graph api.
I am trying to retrieve files stored on Sharepoint. I don't know what the issue is and I have tried a lot of different things:
Call to get all drives for the site works and returns a list of all available drives:
GET https://graph.microsoft.com/v1.0/sites/site.sharepoint.com,<id>,<id>:/teams/myTeam:/drives
Via the previous endpoint I can extract the id for that drive with which I would then like to retrieve drive details (and in consequence all children of that drive):
GET https://graph.microsoft.com/v1.0/sites/site.sharepoint.com,<id>,<id>:/teams/myTeam:/drives/<driveId>
GET https://graph.microsoft.com/v1.0/sites/site.sharepoint.com,<id>,<id>:/teams/myTeam:/drives/<driveId>/root
GET https://graph.microsoft.com/v1.0/sites/site.sharepoint.com,<id>,<id>:/teams/myTeam:/drives/<driveId>/root/children
But all 3 above endpoints throw a 400 Bad Request Error with message: Url specified is invalid.
Additional information:
My access token has the following scopes: Sites.FullControl.All User.Read profile openid email
I am able to retrieve an individual drive item through the list endpoints (but the folder structure is quite complex and I need to list several layers of folders/files - this is why I believe the syntax with drive would be a lot more convenient):
GET https://graph.microsoft.com/v1.0/sites/site.sharepoint.com,<id>,<id>:/teams/myTeam:/lists/<list-id>/items/<item-id>/driveItem
via the field parentReference I am also able to fetch the driveId and even the relative path (/drives/<drive-id>/root:) but I also have no idea how I would get the content from that.
Help is greatly appreciated as I have been stuck for a long time now - thank you!
Try with the below HTTP call.
https://graph.microsoft.com/v1.0/sites/site.sharepoint.com,<id>,<id>/drives/driveid/root/children
It worked for me.

How to start using Delta function in Microsoft graph by skipping initial data

Microsoft recommends to use delta function in combination with Subscriptions/Notifications to synchronize mailbox. So my plan is:
Create subscription
Receive notification about new mail in inbox
Use delta function to get latest changes in the inbox
My mailbox already has several thousands of letters. If I run the query
https://graph.microsoft.com/v1.0/users/{id}/mailFolders/inbox/messages/delta
It will return in response #odata.nextLink with $skiptoken param many times and only after I get all the thousands of emails in my mailbox I will receive response with $deltatoken to track new changes.
Is there a way to get deltatoken after the first request? I don't want to synchronize the old messages. I want to skip all old messages in inbox and have a fresh start.
Today the delta query functionality does not support this scenario. To request new features please post ideas to uservoice
This is supported for some endpoints. You can use $deltaToken=latest to get just a deltaToken without any resource data. It's not, as far as I can tell, available for mailboxes… but who knows, maybe it will be soon.
This is not documented anywhere in the documentation for the specific APIs that do support it, but is instead documented in the Overview for change tracking. Why? Because Microsoft wants you to be sad all the time.

Count of user/members from group azure AD using graph API

I need to take a count of each group from Azure AD using Graph API. Can anyone tell me how to achieve it
I also faced the similar issue. When I ran the end point mentioned in https://learn.microsoft.com/en-us/graph/api/group-list-members?view=graph-rest-1.0&tabs=http#example-2-get-only-a-count-of-all-membership I got "$count is not currently supported."
However, if you notice the documentation clearly, it asks us to send in the ConsistencyLevel as eventual in the REST header. I got the correct response when I sent the header along with the call:
GET https://graph.microsoft.com/v1.0/groups/{id}/members/$count ConsistencyLevel: eventual
There is currently no Microsoft Graph endpoint to get the number of users.
You could list members by using:
GET https://graph.microsoft.com/v1.0/groups/{id}/members
And then handle the count of the members in your code.
See the reference here. Try it quickly with Microsoft Graph Explorer.

Returning employeeId of a user through MS Graph API

I've been trying to return the employeeId of a user through the Microsoft Graph API but so far haven't had much luck.
I'm assuming this is probably because it doesn't exist in the metadata for the user in the Graph API so makes sense.
However, the property is populated in Azure AD. If I use the AZ command prompt to query the user I can see the property. Likewise, if I query the old Active Directory Graph API endpoint I can even see it there.
For example, querying
https://graph.windows.net/{tennant}/users/{upn}?api-version=1.6 directly I receive the employeeId as part of the response (using the ActiveDirectoryClient however seems to ignore this property and doesn't store it anywhere).
Is there any reason for this? Wouldn't it make sense to have it returned as an additional property? I've also looked into extensions, but as it's not an extension isn't returned there.
Any help would be appreciated. I can get the information I need by querying the old endpoint directly, but this seems like a complete backwards step and involves multiple queries to get the information I need - including having to use multiple end points (one of which I assume will be deprecated and removed soon).
EmployeeId is currently a beta feature and is only available in the beta endpoint of the Graph API.
So if you want to access the beta endpoint you just have to change the version to beta in your url. For example:
https://graph.microsoft.com/beta/me/
https://graph.microsoft.com/beta/users/{id|upn}/
https://graph.windows.net/{tennant}/users/{id|upn}?api-version=beta
For more information about the user-object in the beta endpoint see: https://developer.microsoft.com/en-us/graph/docs/api-reference/beta/resources/user

Endpoint nodes list in Kaa

I want to get list of endpoints in Kaa, I see many REST functions here but all of them need informations like Endpoint Hash Key and ... but I don't know how I can find them. Anybody can help me how I can do this ? and is there a way for geting event on device discovery in Kaa ?
Thanks in advance
On your link for each Rest call, there is the description with the endpoint cresponding to the request. For example:
Get user authentication status
URL : /kaaAdmin/rest/api/auth/checkAuth
Same for parameter needed.
If that's not what you are looking for, you might have to explain a little bit more.
You are able to get endpoint key hash in 3 ways :
Get information from Client SDK on your device. Check appropriate documentation of you desirable SDK.
Look at Admin UI in Endpoint profiles menu.
Get via Admin REST API .
Please, check profiling section.
I think it will help you to find your desired information.

Resources