Compliance Tag Field not available with Microsoft Graph API filter - microsoft-graph-api

Using the Microsoft Graph API (v1.0) sites/{site-id}/lists/{list-id}/items end-point to try and find any new documents that have had a Compliance Tag applied. In the fields I see _ComplianceTagWrittenTime but when I supply that field into the filter I'm given 'field not recognized' error
Here is the list of fields
"fields": {
"#odata.etag": "\"etag\"",
"FileLeafRef": "Test.docx",
"id": "1",
"ContentType": "Document",
"Created": "2019-06-27T18:08:27Z",
"AuthorLookupId": "6",
"Modified": "2020-01-05T23:39:12Z",
"EditorLookupId": "6",
"_CheckinComment": "",
"LinkFilenameNoMenu": "Test.docx",
"LinkFilename": "Test.docx",
"DocIcon": "docx",
"FileSizeDisplay": "19243",
"ItemChildCount": "0",
"FolderChildCount": "0",
"_ComplianceFlags": "7",
"_ComplianceTag": "Short Record",
"_ComplianceTagWrittenTime": "2020-11-02T19:41:16Z",
"_ComplianceTagUserId": "6",
"_IsRecord": "7",
"_CommentCount": "",
"_LikeCount": "",
"_DisplayName": "",
"Edit": "0",
"_UIVersionString": "6.0",
"ParentVersionStringLookupId": "1",
"ParentLeafNameLookupId": "1"
}
This call works https://graph.microsoft.com/v1.0/sites/{site-id}/lists/{list-id}/items?expand=fields&filter=fields/Modified gt '2019-01-05T23:39:12Z'
but this one https://graph.microsoft.com/v1.0/sites/{site-id}/lists/{list-id}/items?expand=fields&filter=fields/_ComplianceTagWrittenTime gt '2019-01-05T23:39:12Z'
returns
{
"error": {
"code": "invalidRequest",
"message": "A provided field name is not recognized",
"innerError": {
"date": "2020-11-03T17:33:52",
"request-id": "{request-id}",
"client-request-id": "{client-id}"
}
}
}

No, you cannot filter the list items as of now as there is no support for it. Please upvote an already existing feature request in the Microsoft Graph Feedback forum.

Related

Not getting any webhook notification for Microsoft O365 Management APIs

I have created the below webhooks and all are enabled.:
[
{
"contentType": "Audit.AzureActiveDirectory",
"status": "enabled",
"webhook": {
"authId": "12345",
"address": "https://978b7cfb66d9.ngrok.io/callback/",
"expiration": "",
"status": "enabled"
}
},
{
"contentType": "Audit.General",
"status": "enabled",
"webhook": {
"authId": "12345",
"address": "https://978b7cfb66d9.ngrok.io/callback/",
"expiration": "",
"status": "enabled"
}
},
{
"contentType": "Audit.SharePoint",
"status": "enabled",
"webhook": {
"authId": "12345",
"address": "https://978b7cfb66d9.ngrok.io/callback/",
"expiration": "",
"status": "enabled"
}
}
]
I don't see any notifications coming when there are changes made in sharepoint. Anything in particular need to change?
From the access token, I do see correct app permissions:
"roles": [
"ServiceHealth.Read",
"ActivityFeed.Read"
]
I manually queried to get content and it shows empty.
https://manage.office.com/api/v1.0/{tenant-guid}/activity/feed/subscriptions/content?contentType=Audit.Sharepoint
Looks like the auditing for Office 365 organization is disabled.
Make sure you turn on audit log search.

Unable to retrieve event details using Microsoft Graph API 1.0

Has anyone got Microsoft Graph API working for EventMessage? i.e reading email content of EventMessage using Graph API.
Looks like it has actionable card and graph API 1.0 is not able to read it.
Provided delegate access to user for a room resource.
On event creation for that room, mail is received by the delegated user in inbox. The mail type is eventMessage ("#odata.type": "#microsoft.graph.eventMessage").
On fetching the mail through GraphAPI v1.0, the event values are not visible in the response.
Also on setting the Expand property for the mail in graph API as per docs, results in below error.
{ "error": {
"code": "BadRequest",
"message": "Parsing Select and Expand failed.",
"innerError": {
"request-id": "310bbcce-bdd8-4cb6-890c-035243a5ab6d",
"date": "2020-01-21T09:18:10"
}
}
}
I'm unable to repro your issue. The Microsoft Graph API returns details for event messages. Can you provide repro steps, request/response capture, and the values that you'd expect to see?
I used v1.0/me/messagesto get all of the messages to find an eventMessage. I then perform the following to get details on the eventMessage:
GET https://graph.microsoft.com/v1.0/me/messages/{messagedId}
Response body:
{
"#odata.context": "https://graph.microsoft.com/v1.0/$metadata#users('d09-94-498-a9777d4b')/messages/$entity",
"#odata.type": "#microsoft.graph.eventMessage",
"#odata.etag": "W/\"DAA2pU9s\"",
"id": "AAMkADEzOTExYjJkAAA=",
"createdDateTime": "2020-01-24T14:47:24Z",
"lastModifiedDateTime": "2020-01-24T21:08:07Z",
"changeKey": "DApU9s",
"categories": [],
"receivedDateTime": "2020-01-24T14:47:25Z",
"sentDateTime": "2020-01-24T14:47:11Z",
"hasAttachments": false,
"internetMessageId": "<AM5P3M#A38.EURPRD83.prod.outlook.com>",
"subject": "Accepted: Microsoft Graph DevX Roadmap",
"bodyPreview": "",
"importance": "normal",
"parentFolderId": "AAMk3AAA=",
"conversationId": "AAQkADEzOU4=",
"conversationIndex": "AdXReVPepTg==",
"isDeliveryReceiptRequested": null,
"isReadReceiptRequested": false,
"isRead": true,
"isDraft": false,
"webLink": "https://outlook.office365.com/owa/?ItemID=AAMkA%3D&exvsurl=1&viewmodel=ReadMessageItem",
"inferenceClassification": "focused",
"meetingMessageType": "meetingAccepted",
"body": {
"contentType": "text",
"content": ""
},
"sender": {
"emailAddress": {
"name": "Nicole",
"address": "sig#contoso.com"
}
},
"from": {
"emailAddress": {
"name": "Nicole",
"address": "sig#contoso.com"
}
},
"toRecipients": [
{
"emailAddress": {
"name": "Michael Mainer",
"address": "mm#contoso.com"
}
}
],
"ccRecipients": [],
"bccRecipients": [],
"replyTo": [],
"flag": {
"flagStatus": "notFlagged"
}
}

How to create item with column that has strange SharePoint internal encoding?

I created a column with the name "col1" in the list through the web interface Office 365. When I tried to get whole info about this column using msgraph request to
GET /sites/{site-id}/lists/{list-id}/columns/{column-id}
I got such the response:
{
"#odata.context": ...,
"columnGroup": "Custom Columns",
"description": "",
"displayName": "col1",
"enforceUniqueValues": false,
"hidden": false,
"id": "a9fe9dc8-c5b8-467d-8504-23d95f1cc937",
"indexed": false,
"name": "_x0063_ol1",
"readOnly": false,
"required": false,
"number": {
"decimalPlaces": "automatic",
"displayAs": "number",
"maximum": 1.7976931348623157e+308,
"minimum": -1.7976931348623157e+308
}
}
So the problem is that I cannot create an item with that column (I tried both names "col1" and "_x0063_ol1"). The request was to
POST /sites/{site-id}/lists/{list-id}/items
with the body:
{
"fields": {
"Title": "Test2",
"_x0063_ol1": 42
}
}
I got response:
{
"error": {
"code": "invalidRequest",
"message": "Field '_x0063_ol1' is not recognied",
"innerError": {
"request-id": "dbb98ed3-0c2f-48dc-924e-dd888e70c867",
"date": "2018-05-02T07:41:36"
}
}
}
How can I properly create the item with this column using msgraph API?

Bad request when creating windowsMobileMSI in Intune using microsoft graph api

I'm trying to create a windowsMobileMSI app in intune.
I use the following JSON:
{
"#odata.type": "#microsoft.graph.windowsMobileMSI",
"displayName": "API uploaded Package",
"description": "Desc of Api uploaded pkg",
"publisher": "publisher 1",
"isFeatured": false,
"privacyInformationUrl": "",
"informationUrl": null,
"owner": "owner 1",
"developer": "dev 1",
"notes": "no notes",
//File info
"committedContentVersion": "1",
"fileName": "PackageProvider.msi",
"size": 409664,
"identityVersion": "1.0.8",
"commandLine": "",
"productCode": "{cc12adbd-8692-458d-b186-9d83b639ff1d}",
"productVersion": "1.0.8",
"ignoreVersionDetection": false
}
However when I post it to
POST https://graph.microsoft.com/beta/deviceAppManagement/mobileApps
I get the error message
{
"error": {
"code": "BadRequest",
"message": "An error has occurred - Operation ID (for customer support): 00000000-0000-0000-0000-000000000000 - Activity ID: fd5ee560-f4da-4255-b893-aa133c60fe4b - Url: https://fef.amsub0102.manage.microsoft.com/StatelessAppMetadataFEService/deviceAppManagement/mobileApps?api-version=5017-10-18 - CustomApiErrorPhrase: ",
"innerError": {
"request-id": "fd5ee560-f4da-4255-b893-aa133c60fe4b",
"date": "2017-12-22T08:31:35"
}
}
}
I took the lines below the "//File info" comment from an existing windowsMobileMSI app.
I tried removing of these lines but it didn't help me.
Can anyone advise me what is wrong with my JSON?
I've got an advice to use only the "identityVersion" after the //File info.
So here's the JSON that works now:
{
"#odata.type": "#microsoft.graph.windowsMobileMSI",
"displayName": "API uploaded Package",
"description": "Desc of Api uploaded pkg",
"publisher": "publisher 1",
"isFeatured": false,
"privacyInformationUrl": "",
"informationUrl": null,
"owner": "owner 1",
"developer": "dev 1",
"notes": "no notes",
//File info
"identityVersion": "1.0.8",
}
Try removing "size": 409664 from the JSON.

Formatting a Chat Window

I'm trying to build a messaging application for iOS. I've got a web service returning JSON, but I'm not sure how to get it to display in a scrollable, formatted area of the application. I'm also clueless on how to get it to ping the server to check for an update, and refresh the stream if one has been posted. Any help provided would be greatly appreciated.
Here's the basic JSON that I'm working with:
{
"messages": [
{
"id": "1",
"location_id": "1",
"origination_id": "1",
"message": "Test message",
"timestamp": "2014-01-16 08:57:26"
},
{
"id": "2",
"location_id": "1",
"origination_id": "1",
"message": "Test Message - start",
"timestamp": "2014-01-16 09:00:50"
},
{
"id": "3",
"location_id": "1",
"origination_id": "2",
"message": "Test response",
"timestamp": "2014-01-16 09:01:06"
},
{
"id": "6",
"location_id": "1",
"origination_id": "1",
"message": "This is a test message from the API",
"timestamp": "2014-01-16 10:23:11"
},
{
"id": "7",
"location_id": "1",
"origination_id": "1",
"message": "This is a test message from the API",
"timestamp": "2014-01-16 10:23:13"
},
{
"id": "8",
"location_id": "1",
"origination_id": "1",
"message": "This is a test message from the API",
"timestamp": "2014-01-16 10:23:22"
}
]
}

Resources