Beta Graph API eDiscovery Review Set Apply Tag appear to be tagging just the Group/Section tag and not the child tag - microsoft-graph-api

I'm am developing a power automate flow using the Beta Advanced eDiscovery Graph API which I do the following:
Create a Tag structure for an Advanced eDiscovery Case. This consists of a Section/Group (Parent) Tag named 'Privilege' the 4 child Tags. (see code below) All functions are working w/o error and appear in the eDisovery Case.
Using the Beta Graph API I create a Review Set Query. (see code below) This too is working w/o errors and appears in the eDiscovery Case Review.
Lastly, Using the Beta Graph API I apply one of the child tags associated to the review query from step 2. Again this works w/o error.
The issue is that when I open the Review in Advanced eDiscovery I see the messages that match the review query matches on with Tags, however when I view the message the child tag does not get highlighted.
If I apply a tag manually then again view the message the Tag is highlighted (selected).
Also, when in the Review Set page tag Filter only lists the Parent Tag not the child tag which I specified in the applytag Graph Apl call.
Following are Graph API calls, URI, Body, and Outputs:
Make the Group Tag
https://graph.microsoft.com/beta/compliance/ediscovery/cases/9bb82c7c-bba3-4ad2-a584-4ec30a33544b/tags
Body
{
"displayName": "Privilege",
"childSelectability": "Many"
}
Output
{
"#odata.context": "graph.microsoft.com/beta/$metadata#compliance/ediscovery/cases('9bb82c7c-bba3-4ad2-a584-4ec30a33544b')/tags/$entity",
"displayName": "Privilege",
"description": null,
"lastModifiedDateTime": "2021-11-06T21:13:59.6518126Z",
"childSelectability": "Many",
**"id": "4ab4daccb8c14ef789be7d2580bab245",**
"createdBy": {
"user": {
"id": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"displayName": null,
"userPrincipalName": "xxxxxxxxxxxxx.onmicrosoft.com"
}
}
}
Make 4 child options
1.
POST //graph.microsoft.com/beta/compliance/ediscovery/cases/9bb82c7c-bba3-4ad2-a584-4ec30a33544b/tags
Body
{
"displayName": "Attorney Work Product",
"childSelectability": "Many",
"parent#odata.bind": "//graph.microsoft.com/beta/compliance/ediscovery/cases/9bb82c7c-bba3-4ad2-a584-4ec30a33544b/tags/**4ab4daccb8c14ef789be7d2580bab245**"
}
Outputs
Status Code:201
{
"#odata.context": "://graph.microsoft.com/beta/$metadata#compliance/ediscovery/cases('9bb82c7c-bba3-4ad2-a584-4ec30a33544b')/tags/$entity",
"displayName": "Attorney Work Product",
"description": null,
"lastModifiedDateTime": "2021-11-06T21:14:00.2924266Z",
"childSelectability": "Many",
"id": "6646aa1cde37408dad6be43723dd0503",
"createdBy": {
"user": {
"id": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"displayName": null,
"userPrincipalName": "xxxxxxxxxxxxxxxxxxxxxx.onmicrosoft.com"
}
}
}
2.POST
//graph.microsoft.com/beta/compliance/ediscovery/cases/9bb82c7c-bba3-4ad2-a584-4ec30a33544b/tags
Body
{
"displayName": "Attorney Communication",
"childSelectability": "Many",
"parent#odata.bind": "https://graph.microsoft.com/beta/compliance/ediscovery/cases/9bb82c7c-bba3-4ad2-a584-4ec30a33544b/tags/4ab4daccb8c14ef789be7d2580bab245"
}
Outputs
{
"#odata.context": "https://graph.microsoft.com/beta/$metadata#compliance/ediscovery/cases('9bb82c7c-bba3-4ad2-a584-4ec30a33544b')/tags/$entity",
"displayName": "Attorney Communication",
"description": null,
"lastModifiedDateTime": "2021-11-06T21:14:01.1385531Z",
"childSelectability": "Many",
"id": "03a1f53540874e7085dc57bdb6e71b29",
"createdBy": {
"user": {
"id": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"displayName": null,
"userPrincipalName": "xxxxxxxxxxxxxxxx.onmicrosoft.com"
}
}
}
3. POST
//graph.microsoft.com/beta/compliance/ediscovery/cases/9bb82c7c-bba3-4ad2-a584-4ec30a33544b/tags
Body
{
"displayName": "Potentially Privileged",
"childSelectability": "Many",
"parent#odata.bind": "https://graph.microsoft.com/beta/compliance/ediscovery/cases/9bb82c7c-bba3-4ad2-a584-4ec30a33544b/tags/4ab4daccb8c14ef789be7d2580bab245"
}
Outputs
{
"#odata.context": "https://graph.microsoft.com/beta/$metadata#compliance/ediscovery/cases('9bb82c7c-bba3-4ad2-a584-4ec30a33544b')/tags/$entity",
"displayName": "Potentially Privileged",
"description": null,
"lastModifiedDateTime": "2021-11-06T21:14:01.5424902Z",
"childSelectability": "Many",
"id": "dee7b721d042423a870f9fd695cff573",
"createdBy": {
"user": {
"id": "xxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"displayName": null,
"userPrincipalName": "xxxxxxxxxxxxxxxxxxxxxx.onmicrosoft.com"
}
}
}
4. Post
://graph.microsoft.com/beta/compliance/ediscovery/cases/9bb82c7c-bba3-4ad2-a584-4ec30a33544b/tags
body
{
"displayName": "Privileged",
"childSelectability": "Many",
"parent#odata.bind": "https://graph.microsoft.com/beta/compliance/ediscovery/cases/9bb82c7c-bba3-4ad2-a584-4ec30a33544b/tags/4ab4daccb8c14ef789be7d2580bab245"
}
Outputs
{
"#odata.context": "https://graph.microsoft.com/beta/$metadata#compliance/ediscovery/cases('9bb82c7c-bba3-4ad2-a584-4ec30a33544b')/tags/$entity",
"displayName": "Privileged",
"description": null,
"lastModifiedDateTime": "2021-11-06T21:14:02.0233516Z",
"childSelectability": "Many",
"id": "2bb05d142ab7455eb16a820a54f147fb",
"createdBy": {
"user": {
"id": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"displayName": null,
"userPrincipalName": "xxxxxxxxxxxxxxxxxx.onmicrosoft.com"
}
}
}
enter image description here
Make Review Set Query
//graph.microsoft.com/beta/compliance/ediscovery/cases/f193df40-551d-451c-9ef8-135df2475fc2/reviewSets/921d10fa-9a16-44e5-8240-d9f9cb7d1b5f/queries
Body
{
"displayName": "Potentially Privileged",
"query": "(SenderAuthor:\"adeleV#pageman.onmicrosoft.com\" OR Recipients:\"adeleV#xxxxxxxxxxxx.onmicrosoft.com\")"
}
Outputs
Status code 201
{
"#odata.context": "https://graph.microsoft.com/beta/$metadata#compliance/ediscovery/cases('f193df40-551d-451c-9ef8-135df2475fc2')/reviewSets('921d10fa-9a16-44e5-8240-d9f9cb7d1b5f')/queries/$entity",
"displayName": "Potentially Privileged",
"query": "((SenderAuthor:\"adeleV#xxxxxxxxxxx.onmicrosoft.com\" OR Recipients:\"adeleV#xxxxxxxxx.onmicrosoft.com\"))",
"lastModifiedDateTime": "2021-11-11T21:37:38.4273704Z",
"id": "1c2670a8-7542-4168-9873-b62b3d097cc5",
"createdDateTime": "2021-11-11T21:37:38.4273704Z",
"lastModifiedBy": {
"user": {
"id": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"displayName": null,
"userPrincipalName": "xxxxxxxxxxxxxxxxxxx.onmicrosoft.com"
}
},
"createdBy": {
"user": {
"id": "xxxxxxxxxxxxxxxxxxxxxx",
"displayName": null,
"userPrincipalName": "xxxxxxxxxxxxxxx.onmicrosoft.com"
}
}
}
Apply Tag
//graph.microsoft.com/beta/compliance/ediscovery/cases/f193df40-551d-451c-9ef8-135df2475fc2/reviewSets/921d10fa-9a16-44e5-8240-d9f9cb7d1b5f/queries/1c2670a8-7542-4168-9873-b62b3d097cc5/applyTags
Body
{
"tagsToAdd": [
{
"id": "e4518b76afec491b8d845f87179791f3"
}
]
}
Outputs
Status Code 202
Using the location I track the progress until 100% complete
{
"#odata.context": "https://graph.microsoft.com/beta/$metadata#compliance/ediscovery/cases('f193df40-551d-451c-9ef8-135df2475fc2')/operations/$entity",
"#odata.type": "#microsoft.graph.ediscovery.tagOperation",
"createdDateTime": "2021-11-11T21:37:41.4396791Z",
"completedDateTime": "2021-11-11T21:40:42.919Z",
"percentProgress": 100,
"status": "succeeded",
"action": "applyTags",
"id": "b1755016878c49ed875ce9246c30614d",
"createdBy": {
"user": {
"id": "xxxxxxxxxxxxxxxxxxxxxxxxxx",
"displayName": null,
"userPrincipalName": "xxxxxxxxxxxxxxxxxxxxxxxxxx"
}
}
}
enter image description here
enter image description here
enter image description here

Related

Retrieve homePhone, mobilePhone and faxPhone from Delve Profile using Graph API

I am trying to retrieve the information in the red box via the graph api resource:
https://graph.microsoft.com/beta/me/profile
Here is the return:
"phones": [
{
"displayName": null,
"type": "business",
"number": "xxxxxxxxxx",
"allowedAudiences": "organization",
"createdDateTime": "2021-06-21T23:36:38.0912984Z",
"inference": null,
"lastModifiedDateTime": "2021-06-21T23:36:38.0912984Z",
"id": "a28e87ba-25xx-45xx-8fxx-5f340b597fxx",
"isSearchable": false,
"createdBy": {
"device": null,
"user": null,
"application": {
"displayName": "AAD",
"id": null
}
},
"lastModifiedBy": {
"device": null,
"user": null,
"application": {
"displayName": "AAD",
"id": null
}
},
"source": {
"type": [
"AAD"
]
}
}
],
It looks to only be returning the info from AAD, not the fields in the Delve profile. Upon further research I found these fields are actually linked to the SharePoint online profile. Is there a way to grab this information using the Graph API?

Microsoft Graph API: recent items - How to get onenote displayName instead of filename

My goal is to display the 6 most recent items in the current users OneDrive.
Using https://graph.microsoft.com/v1.0/me/drive/recent?top=6 gives me the correct documents.
Some of these documents are OneNote Items.
At www.office.com the OneNote Items are displayed with the Notebook's displayname.
In the API response only the filename is contained.
Testing this is Microsoft's example data here:
https://developer.microsoft.com/en-us/graph/graph-explorer
Example response
{
"#odata.context": "https://graph.microsoft.com/v1.0/$metadata#Collection(driveItem)",
"#odata.nextLink": "https://graph.microsoft.com/v1.0/me/drive/recent?top=6&expand=section&$skiptoken=s!Njs3NGI0MzJjYS1mNmIzLTQ5YmQtOWIxMC02OTIyNjRlMTI3YTI",
"value": [
...
{
"#odata.type": "#microsoft.graph.driveItem",
"createdDateTime": "2017-08-07T16:08:45Z",
"id": "01BYE5RZ2IKLBQXYXELFD23BMJIB545TH6",
"lastModifiedDateTime": "2020-01-09T03:02:37Z",
"name": "Fabrikam.one",
"webUrl": "https://m365x214355-my.sharepoint.com/personal/meganb_m365x214355_onmicrosoft_com/_layouts/15/Doc.aspx?sourcedoc=%7B0BC35248-E4E2-4759-AD85-89407BCECCFE%7D&file=Fabrikam.one&action=edit&mobileredirect=true&wdorigin=Sharepoint&DefaultItemOpen=1",
"size": 55782,
"createdBy": {
"user": {
"email": "MeganB#M365x214355.onmicrosoft.com",
"displayName": "Megan Bowen"
}
},
"lastModifiedBy": {
"user": {
"email": "",
"displayName": "System Account"
}
},
"file": {
"mimeType": "application/msonenote"
},
"fileSystemInfo": {
"createdDateTime": "2017-08-07T16:08:45Z",
"lastModifiedDateTime": "2020-01-09T03:02:37Z"
},
"remoteItem": {
"createdDateTime": "2017-08-07T16:08:45Z",
"id": "01BYE5RZ2IKLBQXYXELFD23BMJIB545TH6",
"lastModifiedDateTime": "2020-01-09T03:02:37Z",
"name": "Fabrikam.one",
"size": 55782,
"webDavUrl": "https://m365x214355-my.sharepoint.com/personal/meganb_m365x214355_onmicrosoft_com/Documents/Fabrikam.one",
"webUrl": "https://m365x214355-my.sharepoint.com/personal/meganb_m365x214355_onmicrosoft_com/_layouts/15/Doc.aspx?sourcedoc=%7B0BC35248-E4E2-4759-AD85-89407BCECCFE%7D&file=Fabrikam.one&action=edit&mobileredirect=true&wdorigin=Sharepoint&DefaultItemOpen=1",
"createdBy": {
"user": {
"email": "MeganB#M365x214355.onmicrosoft.com",
"displayName": "Megan Bowen"
}
},
"file": {
"mimeType": "application/msonenote"
},
"fileSystemInfo": {
"createdDateTime": "2017-08-07T16:08:45Z",
"lastModifiedDateTime": "2020-01-09T03:02:37Z"
},
"lastModifiedBy": {
"user": {
"email": "",
"displayName": "System Account"
}
},
"parentReference": {
"driveType": "business",
"driveId": "b!-RIj2DuyvEyV1T4NlOaMHk8XkS_I8MdFlUCq1BlcjgmhRfAj3-Z8RY2VpuvV_tpd",
"id": "01BYE5RZ56Y2GOVW7725BZO354PWSELRRZ"
},
"shared": {
"scope": "users"
},
"sharepointIds": {
"listId": "23f045a1-e6df-457c-8d95-a6ebd5feda5d",
"listItemId": "36",
"listItemUniqueId": "0bc35248-e4e2-4759-ad85-89407bceccfe",
"siteId": "d82312f9-b23b-4cbc-95d5-3e0d94e68c1e",
"siteUrl": "https://m365x214355-my.sharepoint.com/personal/meganb_m365x214355_onmicrosoft_com",
"webId": "2f91174f-f0c8-45c7-9540-aad4195c8e09"
}
}
},
...
]
}
Is there a way to retrieve the OneNote notebook's name from here?
The API provides a way to retrieve all notebooks like so:
https://graph.microsoft.com/v1.0/me/onenote/notebooks
However I do not see a connection between these responses.
Maybe relevant how to find OneNote Notebook object from driveItem with MS Graph? - this shows a workaround. I am curious if there is a better solution.

Microsoft graph user delta - manager issue

When I try to get users via the delta endpoint:
https://graph.microsoft.com/v1.0/users/delta?$select=id,displayName,manager
The returned response will contain some users with the manager property defined, as expected:
{
"#odata.context": "https://graph.microsoft.com/v1.0/$metadata#users(id,displayName,manager)",
"#odata.nextLink": "https://graph.microsoft.com/v1.0/users/delta?$skiptoken=[token]",
"value": [
{
"displayName": "user1",
"id": "id1"
},
{
"displayName": "user2",
"id": "id2",
"manager#delta": [
{
"#odata.type": "#microsoft.graph.user",
"id": "managerId1"
}
]
},
{
"displayName": "user3",
"id": "id3"
},
// etc
]
}
However when I then query the returned nextLink to get the second page, the same set of users are returned as the first page, and this time without any managers. Also note that the #odata.context value has changed now too:
{
"#odata.context": "https://graph.microsoft.com/v1.0/$metadata#users",
"#odata.nextLink": "https://graph.microsoft.com/v1.0/users/delta?$skiptoken=[token]",
"value": [
{
"displayName": "user1",
"id": "id1"
},
{
"displayName": "user2",
"id": "id2"
},
{
"displayName": "user3",
"id": "id3"
},
... etc
]
}
When I remove the displayName property, so am only selecting for id and manager, the paging seems to work correctly:
https://graph.microsoft.com/v1.0/users/delta?$select=id,manager
The issue has been reproduced when including the userPrincipalName property in the $select too.

Create thread in Microsoft Teams with Subject

I'm currently trying to create a Microsoft teams thread (within a channel) via the Microsoft Graph API.
I'd like thread to have a subject/title and I'm sending the following request (from the graph explorer)
POST https://graph.microsoft.com/beta/teams/{teamId}/channels/{channelId}/chatThreads
with the following payload
{
"rootMessage": {
"body": {
"contentType": 1,
"content": "<h1>Hello world</h1>"
},
"subject": "Welcome Aboard!"
}
}
However the thread that gets created doesn't have any title as you can see on the following screen capture.
So the question is: how can I create a chat thread with a subject from the Microsoft Graph API?
Edit: here is the payload I get for the message "title from teams" (which was created from the UI), note is contains a subject attribute.
{
"replyToId": null,
"etag": "1537198542791",
"messageType": "message",
"createdDateTime": "2018-09-17T15:35:42.791Z",
"lastModifiedDateTime": null,
"deleted": false,
"subject": "title from teams",
"summary": null,
"importance": "normal",
"locale": "en-us",
"id": "1537198542791",
"from": {
"application": null,
"device": null,
"user": {
"id": "c2e8df37-c6a7-4d88-89b1-feb4f1fda7c5",
"displayName": "Vincent Biret",
"identityProvider": "Aad"
}
},
"body": {
"contentType": "text",
"content": "wvwvwevw"
},
"attachments": [],
"mentions": [],
"reactions": []
}
There is no "subject" for a post in Microsoft Teams. These are chat threads, not email threads. The only content is the body:
{
"rootMessage": {
"body": {
"contentType": 1,
"content": "<h1>Hello world</h1>"
}
}
}

Unable to use both top and skip on drives request for the office 365 graph api

We've recently seen what we believe is a change of functionality regarding the use of the top and skip query parameters when making a /drives call.
An example call is:
https://graph.microsoft.com/v1.0/sites/{siteid}/drives?top=1&skip=2
This results in the error message:
{
"error": {
"code": "invalidRequest",
"message": "$skip is not supported on this API. Only URLs returned by the API can be used to page.",
"innerError": {
"request-id": "14be8885-c3ba-48cc-862b-169dc2c02792",
"date": "2017-08-22T21:15:44"
}
}
}
We are trying to get a list of document libraries for a site collection. We would like to be able to page through them. Is this not the correct approach?
I understand that the concept of skipToken exists but do not receive one when limiting this call with the top query param.
https://graph.microsoft.com/v1.0/sites/muskpartners.sharepoint.com,d0e2f49b-e44c-43a6-8011-c00515666077,05e55f15-4584-4e3d-bf5c-dd4164b76685/drives
returns 3 items:
{
"#odata.context": "https://graph.microsoft.com/v1.0/$metadata#drives",
"value": [
{
"createdBy": {
"user": {
"displayName": "System Account"
}
},
"createdDateTime": "2017-07-25T05:42:33Z",
"description": "This library contains administrator-approved form templates that were activated to this site collection.",
"id": "b!m_Ti0EzkpkOAEcAFFWZgdxVf5QWERT1Ov1zdQWS3ZoWizkgpZiHkQpkllC4-bnhA",
"lastModifiedDateTime": "2017-07-25T05:42:33Z",
"name": "Form Templates",
"webUrl": "https://muskpartners.sharepoint.com/portals/Community/FormServerTemplates",
"driveType": "documentLibrary",
"quota": {
"deleted": 0,
"remaining": 0,
"total": 0,
"used": 0
}
},
{
"createdBy": {
"user": {
"displayName": "System Account"
}
},
"createdDateTime": "2017-07-25T05:41:53Z",
"description": "This system library was created by the PointPublishing feature to store stories that are used throughout the site collection.",
"id": "b!m_Ti0EzkpkOAEcAFFWZgdxVf5QWERT1Ov1zdQWS3ZoVz8ZvkSRbdTYvi75sQq3Tt",
"lastModifiedDateTime": "2017-07-25T05:41:53Z",
"name": "Pages",
"webUrl": "https://muskpartners.sharepoint.com/portals/Community/pPg",
"driveType": "documentLibrary",
"quota": {
"deleted": 0,
"remaining": 0,
"total": 0,
"used": 0
}
},
{
"createdBy": {
"user": {
"displayName": "System Account"
}
},
"createdDateTime": "2017-07-25T05:41:59Z",
"description": "This system library was created by the PointPublishing feature to store settings that are used throughout the site collection.",
"id": "b!m_Ti0EzkpkOAEcAFFWZgdxVf5QWERT1Ov1zdQWS3ZoU_AWZq16MrSLjg0Cv0MA8_",
"lastModifiedDateTime": "2017-07-25T05:41:59Z",
"name": "Settings",
"webUrl": "https://muskpartners.sharepoint.com/portals/Community/pSet",
"driveType": "documentLibrary",
"quota": {
"deleted": 0,
"remaining": 0,
"total": 0,
"used": 0
}
},
{
"createdBy": {
"user": {
"displayName": "System Account"
}
},
"createdDateTime": "2017-07-25T05:41:43Z",
"description": "Use the style library to store style sheets, such as CSS or XSL files. The style sheets in this gallery can be used by this site or any of its subsites.",
"id": "b!m_Ti0EzkpkOAEcAFFWZgdxVf5QWERT1Ov1zdQWS3ZoUmZuKEP6ZjQ75eVvVinqIN",
"lastModifiedDateTime": "2017-07-25T05:41:47Z",
"name": "Style Library",
"webUrl": "https://muskpartners.sharepoint.com/portals/Community/Style%20Library",
"driveType": "documentLibrary",
"quota": {
"deleted": 0,
"remaining": 0,
"total": 0,
"used": 0
}
}
]
}
When I use the top query param such as:
https://graph.microsoft.com/v1.0/sites/muskpartners.sharepoint.com,d0e2f49b-e44c-43a6-8011-c00515666077,05e55f15-4584-4e3d-bf5c-dd4164b76685/drives?top=1
I receive only one result and no way to page to the others.
{
"#odata.context": "https://graph.microsoft.com/v1.0/$metadata#drives",
"value": [
{
"createdBy": {
"user": {
"displayName": "System Account"
}
},
"createdDateTime": "2017-07-25T05:42:33Z",
"description": "This library contains administrator-approved form templates that were activated to this site collection.",
"id": "b!m_Ti0EzkpkOAEcAFFWZgdxVf5QWERT1Ov1zdQWS3ZoWizkgpZiHkQpkllC4-bnhA",
"lastModifiedDateTime": "2017-07-25T05:42:33Z",
"name": "Form Templates",
"webUrl": "https://muskpartners.sharepoint.com/portals/Community/FormServerTemplates",
"driveType": "documentLibrary",
"quota": {
"deleted": 0,
"remaining": 0,
"total": 0,
"used": 0
}
}
]
}
If the skipToken is what I should be looking for, is it a bug that it is not returned in this case?
Not all ODATA parameters are supported by all endpoints, the /drives endpoint for example doesn't support the $skip parameter. What you're looking for instead is the $skipToken.
The $top parameter sets the page size. If you're call to the API has additional results (i.e. more drives in this case) then the results will include a skipToken value. Passing that token into the API will fetch the next page of results (and another skipToken if there are yest more data).
https://graph.microsoft.com/v1.0/sites/{siteId}/drives?$top=1&$skiptoken={skipToken}
You can read about using this parameter under Paging Microsoft Graph data in your app.

Resources