Filtering Groups by createdDateTime - microsoft-graph-api

I`m trying to filter Office 365 Groups based on their creation time using Microsoft Graph.
Unfortunately, all DateTime formats produce a 400 - BadRequest - Invalid filter clause response.
I tried below filter clauses:
/v1.0/groups?$filter=createdDateTime/DateTime gt 2016-10-24T14:21:03.000Z
/v1.0/groups?$filter=createdDateTime gt '2016-10-24T14:21:03.000Z'
Could you please help me out on what I`m missing?

I'm afraid Groups do not support filtering by createdDateTime or gt today.
If you would like to see this added to Microsoft Graph, you can submit this idea to Microsoft Graph's UserVocie.

Related

Microsoft Graph filter out non-empty list?

Is there a way to get all the people with non-empty phones lists in a Microsoft Graph call? I've tried
https://graph.microsoft.com/v1.0/me/people?$filter=length(phones) gt 0
https://graph.microsoft.com/v1.0/me/people?$filter=phones/count gt 0
https://graph.microsoft.com/v1.0/me/people?$filter=phones/any(p:p ne 'notanumber')
but they all give "Invalid filter clause" (on beta too). Do I just have to set top=zillions and filter client-side?
Resources:
https://learn.microsoft.com/en-us/graph/query-parameters
https://learn.microsoft.com/en-us/graph/api/user-list-people?view=graph-rest-1.0&tabs=http
https://docs.oasis-open.org/odata/odata/v4.0/errata03/os/complete/part2-url-conventions/odata-v4.0-errata03-os-part2-url-conventions-complete.html
There is no support for filtering this property as of now however you can voice your interest in such feature by creating a feature request in Microsoft Graph Feedback Forum. For now you can filter it on your side.

RE: 275 record limit for $search in Graph API

We have been hoping to use Graph API's $search capability (i.e. received>05/06/2020) to find Outlook messages but it seems the search result is limited to 275 records. Is that a known limitation? Why is there skipToken then if there is no way to receive all matching records?
Using $filter (i.e. ReceivedDateTime gt 2020-05-06) does return all matching messages but there is no $filter way to find emails by matching To or Cc.
Thank you
You can search messages based on a value in specific message properties. The results of the search are sorted by the date and time that the message was sent. A $search request returns up to 250 results.
As the official article said, A $search request returns up to 250 results. So it is a limit for $search in graph api.
For skipToken:
Some requests return multiple pages of data either due to server-side paging or due to the use of the $top parameter to limit the page size of the response. Many Microsoft Graph APIs use the skipToken query parameter to reference subsequent pages of the result.

Microsoft Graph filter vs $filter

I am testing filtering using Microsoft Graph Explorer. I noticed odd behavior that I cannot figure out.
Using endpoint https://graph.microsoft.com/v1.0/me/events?filter=start/dateTime%20ge%20%272018-04-01%27 I get properly filtered data back.
However, using documented $ prefix, https://graph.microsoft.com/v1.0/me/events?$filter=start/dateTime%20ge%20%272018-04-01%27, I get nothing. There is no error, just no data coming back.
How do I query the data using the $filter?
You're not actually getting the results you think you are. When Microsoft Graph sees a query parameter it doesn't expect, it simply ignores it.
When you call /events?filter=start/dateTime ge '2018-04-01' it is simply ignoring the unknown filter parameter and returning you an unfiltered result.
When you call /events?filter=start/dateTime ge '2018-04-01', it is filtering out anything prior to April 1, 2018. If there are no events with a start after this date, you will get an empty array as a result.
I assume you're using the default dataset included with Graph Explorer? The default Graph Explorer data set's most recent event is 2017-11-16T08:00:00.0000000.
The reason you see results from the /calendarView endpoint but not the /events endpoint is that /events only returns single instance meetings and series masters while /celandarView shows everything within a date range. In order to avoid having to maintain a dataset with updated events, the demo data relies on a handful of recurring event entries.
Since events does not return individual occurrences of a meeting, you don't see any results from your query.
If you try this query, you'll see actual results:
https://graph.microsoft.com/v1.0/me/events?$filter=start/dateTime ge '2017-04-01'

Is there any restriction for number of characters in TFS REST API?

I am trying to retrieve workitems from TFS using REST API. https://servername/tfs/collectionname/_apis/wit/workitems?ids='xxxx,yyyy,zzzz,....n' (where n count is 420). Each id is a 4 digit number. I could not retrieve more than 409 workitems. If the query exceed more than 409 ids, I receive "404 - File or directory not found" error. Please help me to find solution for this.
I can reproduce this issue,it has restriction for the length of the strings when using the REST API.
In this case, we can not get all the work items in one time, we can get the work items separately, just call the API twice.

Outlook 365 Calendar API - Filter by Date

I am having some difficulties getting the $filter property of an Outlook 365 query working. Any advice is appreciated.
My query works flawlessly until I add $filter to it, then it returns nothing.
https://outlook.office.com/api/v2.0/Me/Events?$filter=Start/DateTime ge '2016-07-21T07:00:00'&$select=Subject,Start,End,Categories,ShowAs,Sensitivity&$orderby=Start/DateTime&$top=10
My goal is to pull my calendar entries for just today. Once I figure out why the Start/DatTime filter is not working I'll be adding End/DateTime to be the same day with a different end time
Thanks in advance for your help!
you have spaces in the query, replace them with %20

Resources