AzureAD Graph API - getting removed users using delta links on groups - azure-active-directory

I am not able to get removed users using a delta link retrieved from a previous call of https://graph.microsoft.com/v1.0/groups/delta
Explanations:
I retrieve the groups using the query
https://graph.microsoft.com/v1.0/groups/delta
which returns the results correctly
Then I keep the delta link
(example of delta link from JSON response: "#odata.deltaLink": "https://graph.microsoft.com/v1.0/groups/delta?$deltatoken=7VBZ66f3HT ...
)
I remove manually a user which belongs to a group to be sure the delta link works and returns the removed user id.
-> nothing at all is returned.
According to their documentation, it should work:
https://learn.microsoft.com/en-us/graph/delta-query-groups#deltalink-response
Moreover, when i do the same thing with delta user query, it works fine, the removed user is returned with user delta link.
Question:
Does anyone is experiencing this issue and did you find any solution?

I didn't reproduce your issue on my side. I am using Microsoft graph explore to test the api.
When I accessed the final nextLink response, I got the deltaLink.
Then I removed two users from a group on Azure portal.
I can get the expected result when I access the deltaLink.
Update:
I just noticed that you deleted the user directly. That's why you can only get removed user on user delta. If you remove the user from the group directly, you will get the removed user.

Related

How to know people get promoted on Azure AD User Object

I need to get the information if a user in Azure AD get promoted. Information i got so far from this documentation: https://learn.microsoft.com/en-us/graph/api/resources/user?view=graph-rest-1.0
There is a JobTitle property, but i don't see property like: JobTitleHistory, or JobTitleChangeDate
Is there a workaround to get the promotion information?
Thanks!
There is no such field like JobTitleHistory, or JobTitleChangeDate.
There is a workaround you can get to know what changes are made to user profile using delta query.
I tested in my environment by changing the JobTittle=Null to JobTittle=Software Engineer :
Delta Query: The purpose of delta query is to retrieve all the
changes.
Use the below URL to generate the #odata.nextLink
URL: https://graph.microsoft.com/v1.0/users/delta/?$filter=id eq‘Object ID’
Use #odata.nextLink link to get the changes to for particular user. Use Key Value prefer:return=minimal in Request Header to get only the updated attribute.
Reference : https://learn.microsoft.com/en-us/graph/delta-query-overview

Different views for different users in reactJS

I am having a problem in ReactJS. I want to create a text editor ( with ReactQuill). So, I want different accounts for each user, such that, if one person creates a note and edits it in his account, the other person should not see this.for example this is my current stage - https://wright-text.web.app. After you create your account and login you would see a note called first note because that's the note I created. What should I do so that when you login you see no notes because you have not created a note, but when I login, I should see the note I had already created. How would I do this ??
You need to add a scope to notes endpoint so that user could only GET notes, which they have created.
You need to add query parameters in the API you are fetching. For example, if you are fetching data via a GET request, add in some specific user id that you assign to your user upon validation and then fetch data of a particular user using that id as a query parameter on your API.

External access settings for Office 365 groups

I'm trying to update GroupSettings of individual O365 Group, however I always get error
Resource 'guid' does not exist or one of its queried reference-property objects are not present.
A code I'm using to update the group settings
var graphResult = graphClient.GroupSettings[guid].Request().UpdateAsync(groupSetting).GetAwaiter().GetResult();
I've tried to use Group guid as well as GroupSettings guid, none of that worked.
I can set the settings for the first time (overwrite defaults) using codde below, but update doesn't work afterwards.
graphResult = graphClient.Groups[guid].Settings.Request().AddAsync(groupSetting).GetAwaiter().GetResult();
Any idea what can be wrong please?
Thanks
You should use GroupSettings guid here.
I can repro your issue when I use an incorrect guid here.
You should firstly use GET https://graph.microsoft.com/v1.0/groupSettings to find the GroupSettings guid of the GroupSetting you want to update.
Please note that you should include all the values in the request body even though you don't want to update some of them.
Then you could put it as the guid in your code.
It's stronly recommended to have a quick test in Microsoft Graph Explorer.
Since documentation doesn't say how to update settings for particular group, here it is: you need to use both IDs in call
graphResult = graphClient.Groups[groupGuid].Settings[settingsGuid].Request().UpdateAsync(groupSetting)

protoPayload vs jsonPayload in logging

The log entries of my app result in jsonPayload while the gae request log entries use protoPayload. Just like in protoPayload, I added a requestId in my logging that shows up in jsonPayload. However, when using the log viewer where "Show entries from same request" action, I don't see my log entries since the filter uses protoPayload.requestId="xyz". I tried to use an or condition with jsonPayload.requestId="xyz" but that didn't help. Ideally I wouldn't even want to manually edit the clause as it will be painful to do everytime. Seems like per the following documentation, the requestId in each of these types of payloads don't map to the same underlying bigquery field.
https://cloud.google.com/logging/docs/export/bigquery
There is also a "trace" field directly on the log entry and that is same for all the related logs. However, there is no field called trace to search. Doing a text search does return all the entries. While this works, again the UX is bad as it requires first drilling down to the request log entry, copying the trace value and then doing a query.
So, are there any other options to tie the request log entry with the rest of the app log entries for that request easily?
There is a field called "trace" that is on the log entry which works. I think I was confused with the "traceId" within the protoPayload. Note that to get the "trace" field to show up with json payload, the field name should be "logging.googleapis.com/trace"

AAD Change Notifications - Delta query to track recent changes using "$deltaToken=latest"

I have created brand new AAD Group, added a couple of users to it, and removed users from it. I then tried the below request and it's returning a deltalink as expected:
https://graph.microsoft.com/beta/groups/delta/?$filter= id eq '900faee0-0115-44a9-876w-cd1644472792'&$deltaToken=latest
When trying to call the deltaLink I received using the above request, I'm getting an empty response without the expected members#delta showing recently added or deleted Users.
Note: I didn't try the delta function on the desired resource as I'm not interested in retrieving the full state of the resource but trying above $deltaToken=latest request as very first delta change query.
The reason you're not seeing membership changes is that you haven't expanded members in your query. Your current question will only return changes to the Group itself, not related entities.
To retrieve a delta for the Group & Members your query should be:
/v1.0/groups/delta/?$expand=members&$filter= id eq '900faee0-0115-44a9-876w-cd1644472792'&$deltaToken=latest
Also, note that you really shouldn't call the Graph Beta version unless your testing new Graph features. The Beta APIs can and will see breaking changes occur without warning. It is not safe for production code.

Resources