Odata v.4 $filter for the DateTime Calendar Events in the Office 365 REST API - rest

I am trying to get and filter Calendar events from the Office 365 REST API with the following query:
https://outlook.office.com/api/v2.0/users/user#user.com/calendars/AAAAAAAAAAA/events?$top=100&$select=BodyPreview&$filter=Start ge 2016-02-10T22:00:00Z
So I want 100 results with only the BodyPreview as return value for all Events greater than 2016-02-10 22:00:00.
The Error Message I receive is this one:
ERROR request returned 400
error:
code: 'RequestBroker-ParseUri',
message: 'A binary operator with incompatible types was detected. Found operand types \'Microsoft.OutlookServices.DateTimeTimeZone\' and \'Edm.DateTimeOffset\' for operator kind \'GreaterThanOrEqual\'.'
The query without the filter option works flawlessly. So how do I get my query to represent a 'Microsoft.OutlookServices.DateTimeTimeZone' type?
I had a look at this post:
Odata $filter for the date in the Office 365 REST API
But I can not see the difference between my query and the one in the post.
And all examples on https://msdn.microsoft.com/en-us/office/office365/api/complex-types-for-mail-contacts-calendar do not mention this type of DateTimeTimeZone query in the examples.
I also tried this query format:
datetime'2016-01-10T22:00:00'
Also no luck.
Any ideas?

The type for Start and End changed in the beta and v2 endpoints. It's now a complex type, so you need to change your filter a bit:
$filter=Start/DateTime ge 2016-02-10T22:00:00Z

Related

What will be the best way to get only changed objects since specific date-time in priority-web-sdk ERP

I'm new to priority-web-sdk ERP.
I'm trying to get all the elements that were changed since a specific date-time.
I've tried to use the example from Priority postman collection:
https://www.eshbelsaas.com/ui/odata/Priority/tabmob.ini/usdemo/ORDERS?$since=2020-06-01T01:15+02:00&$expand=ORDERITEMS_SUBFORM
Unfortunately, the response contains all the records, and doesn't change if I change the date.
Help,
:)
You can try using Odata 'ge' operator (greater/equal) on the field you want to filter by.
For example, to filter by CURDATE field:
https://www.eshbelsaas.com/ui/odata/Priority/tabmob.ini/usdemo/ORDERS?$filter=CURDATE ge 2021-06-24T00:00:00Z
to filter by STATUSDATE field:
https://www.eshbelsaas.com/ui/odata/Priority/tabmob.ini/usdemo/ORDERS?$filter=STATUSDATE ge 2021-06-24T00:00:00Z

How to filter YouTube Analytics API request for embedded video stats only

I'm trying to get data from the YouTube Analytics API for embedded videos only.
When I use the "insightPlaybackLocationType==EMBEDDED" filter, I get a response that the query is not supported. Without this filter, the query returns a response without any errors.
response = self.executeAPIRequest(
yt_instance.reports().query,
ids="channel==" + c_id,
startDate=startdate,
endDate=enddate,
metrics="views,likes,dislikes,comments,shares,estimatedMinutesWatched,averageViewDuration,averageViewPercentage",
sort='-views',
filters="video==VIDEO_ID_HERE;insightPlaybackLocationType==EMBEDDED",
maxResults=200,
)
Here's the error I get:
googleapiclient.errors.HttpError: https://youtubeanalytics.googleapis.com/v2/reports?ids=channel%3D%CHANNEL_ID_HERE&startDate=2017-02-28&endDate=2019-08-11&metrics=views%2Clikes%2Cdislikes%2Ccomments%2Cshares%2CestimatedMinutesWatched%2CaverageViewDuration%2CaverageViewPercentage&sort=-views&filters=video%3D%VIDEO_ID_HERE%3BinsightPlaybackLocationType%3D%3DEMBEDDED&maxResults=200&alt=json returned "The query is not supported. Check the documentation at https://developers.google.com/youtube/analytics/v2/available_reports for a list of supported queries.">
That filter can only be used with the insightPlaybackLocationDetail dimension.
Bear in mind that the dimension only supports views and estimatedMinutesWatched metrics.
Documentation (Playback location detail):
https://developers.google.com/youtube/analytics/channel_reports#playback-location-reports
Be sure to set the sort and maxResults parameters correctly for this dimension.

How correctly make REST API request to get complete orders between a date range in Magento 2

I want to get complete orders between a date range using Magento 2 REST Api. So request looks like:
/rest/V1/orders?searchCriteria[filterGroups][0][filters][0][field]=status&searchCriteria[filterGroups][0][filters][0][value]=Complete&searchCriteria[filterGroups][0][filters][0][conditionType]=eq
Now I want get it in specific period. I found that Magento api has "from" and "to" fields but I always confused in searchCriteria filter index. Can anybody complete my request? Thanks
You will get complete orders between a date range by using the conditions from and to.
This API will get you the orders between the two dates:
http://<magento_host>/rest/V1/orders?
searchCriteria[filter_groups][0][filters][0][field]=created_at&
searchCriteria[filter_groups][0][filters][0][condition_type]=from&
searchCriteria[filter_groups][0][filters][0][value]=from_date&
searchCriteria[filter_groups][1][filters][0][field]=created_at&
searchCriteria[filter_groups][1][filters][0][condition_type]=to&
searchCriteria[filter_groups][1][filters][0][value]=to_date
Example:
http://<magento_host>/rest/V1/orders?
searchCriteria[filter_groups][0][filters][0][field]=created_at&
searchCriteria[filter_groups][0][filters][0][condition_type]=from&
searchCriteria[filter_groups][0][filters][0][value]=2016-07-01 00:00:00&
searchCriteria[filter_groups][1][filters][0][field]=created_at&
searchCriteria[filter_groups][1][filters][0][condition_type]=to&
searchCriteria[filter_groups][1][filters][0][value]=2018-07-01 00:00:00
The above API will get you the orders between a by using created_at timestamp.
For an example also see the Magento Docs.

How to make a GET request using a filter on a datetime property with EspoCRM REST API?

EspoCRM provides a REST API that sadly has only incomplete documentation. Especially the filters that can be used with a GET request are not documented:
where - (array) filters;
From using Firebug I've discovered that a filter consists of three query parameters:
where[0][field]=somefield
where[0][type]=somoperator
where[0][value]=somevalue
Example, filter on name=Foo:
?where[0][field]=name&where[0][type]=equals&where[0][value]=Foo
The meaning of equals is not documented, as are the possible filter types.
Now I want to filter a collection on a datetime field modifiedAt. I have no idea what the proper values for type and value would be to find all entities that have been modified after a given datetime.
How can the EspoCRM REST API be used for this?
After playing around with the EspoCRM web GUI, I was able to make a search that uses the filter I need. The query parameters are:
where[0][type]=after
where[0][field]=modifiedAt
where[0][value]=2016-06-01 16:12:00
where[0][dateTime]=true
where[0][timeZone]=Europe%2FBerlin

Searching for messages with categories in Office 365 REST API

I'm trying to find all messages that have a non-empty category list, using Office 365 REST API, using the following request:
/api/v2.0/me/messages?$search=%22Categories:-[]%22
This doesn't seem to work though: it returns an empty result set. When I run the same query in Outlook 2016 UI, it does return results.
Is it not supported or is their something wrong with the query?
As my test, using the following format can get the non-empty category list.
endpointUri + "/Me/Messages?$search=%22category:%22".
The search field is 'category', and add nothing behind the colon. Hope it helps.