Python O365 email query API combining search query and dates range - outlook-api

I am looking for a way to query o365 inboxes with both search and date ranges.
The API ignores the date ranges all together and referring only to the search query.
Currently I am using this code:
query:Query = mailbox.new_query()
query.search("('nyt' or 'wsj')")
query.chain('and').on_attribute('created_date_time').greater(datetime.datetime(2020, 3, 21))
query.chain('and').on_attribute('created_date_time').less(datetime.datetime(2021, 3, 21))

Related

How to specify "Since Uploaded" as start date in YouTube Analytics API

I know I can send GET requests to the YouTube API specifying startDates and endDates using a format YYYY-MM-DD, but I'm hoping there is a certain format you could specify to tell the start date to be equal to the published date or upload date?
My simple query is as follows:
startDate <- "2020-01-01" # THIS IS WHAT I'D LIKE TO CHANGE TO BE THE PUBISHING OR UPLOAD DATE
endDate <- Sys.Date()
token <- MY_TOKEN
url <- paste0("https://youtubeanalytics.googleapis.com/v2/reports?",
"&ids=channel%3D%3DMINE",
"&startDate=", startDate,
"&endDate=", endDate,
"&metrics=views,estimatedMinutesWatched,averageViewDuration",
"&filter=video==", MY_VIDEO_ID)
myRequest <- GET(url, token)
I know that you can query from the Data API first, get the published date, and then use that to feed into your query, but I'm hoping to save on API credits because I need to analyze lots of videos.
I found the easiest thing to do is just specify Jan 1, 2000 as the start date, and that seems to work.

Woocommerce REST API - filter orders by number or date

I want to retrieve an order by its number (not order ID) or by a date.
Earlier I've tried to retrieve (with Postman) an order by its order_id, status or order_key - and it worked:
https://example.com/wp-json/wc/v1/orders?status=completed&consumer_key=ck_...&consumer_secret=cs_...
With the example above, it works correctly.
However, when I'm trying to use number, all of the orders are listed:
https://example.com/wp-json/wc/v1/orders?number=123&consumer_key=ck_...&consumer_secret=cs_...
I've tried also filter[number], the result is the same (all orders are listed):
https://example.com/wp-json/wc/v1/orders?filter[number]=123&consumer_key=ck_...&consumer_secret=cs_...
Question: Could you please explain how can I get order by order number (or a date) using Woocommerce REST API?
As per my understanding, you need to display orders in an ASC or DESC order based on the order number.
you can use orderby and order query string parameter like this to get the order by date https://localhost/wp-test/wp-json/wc/v3/orders?&orderby=date&order=asc&consumer_key=ck_b9f70548c7b676&consumer_secret=cs_10acfa5ab943eb6a0e
Generally order by date will provide you the result of an order by number too because the order placed on the latest date will have the latest order id as per WordPress until you modify from the admin side and vice-versa
Please let me know if I can help you further..

RGoogleAnalytics Segment not Agreeing with GA Web Output

Using R and the 'RGoogleAnalytics' package I have run into an issue of when running a query and the query in R not lining up with the table I get with the same segment in the Google Analytics report. I am using Google's Query Explorer to obtain the segment 'gaid', but I have also tried using the segment definition that the query explorer provides.
query.list <- Init(
start.date = "2015-5-1",
end.date = "2015-5-31",
dimensions = "ga:date",
metrics = "ga:users,ga:sessions",
segments = "gaid::...",
max.results = 10000,
sort = "ga:date",
table.id = "...")
ga.query<- QueryBuilder(query.list)
ga.data <- GetReportData(ga.query,oauth_token,
split_daywise = T)
The code runs, gives me a data frame, but the data frame does not match up with the tables I have with the same segment definitions in Google Analytics interface.
The segment of interest excludes specific users (defined by a custom user dimension), and has several session restrictions. The R code is is including extra users and sessions for some reason.
I've looked into the data trying to find out what users and sessions are getting through, but I am not finding any consistent trends between what is getting by the filter. Is anyone else running into this issue? Any suggestions?

Searching dynamic Label.IDs to match Query result

I am currently dynamically generating labels ids on my ASP site based on the date of the month.
E.g. labelSunday1.ID = "01/07/12"
I am also pulling data down from SQL Server, and storing various values in strings.
E.g. Date = resultDate, stock = resultStock
However, I want to do a find on the page, looking for any Label ID that matches the result of the query, and then display the number of stock in the labels text.
Is there anyway I can search the entire page to see if a label ID matches the resultDate string? I would rather do this search somewhat dynamically, as in the future I hope to dynamically generate many labels on the page.
I was thinking along the lines of:
IF Me.Label.ID = resultDate then
me.label.text = resultStock
but that doesn't work :C
Thanks in advance
The answer was to use "01_01_2013" as an Identifier.

I need to group and summarize flat arraycollection data. Data cannot be grouped out side of app and must return arraycollection

I have flat data in my app which I will need to group, summarize, and count as I normally would with a sql query. For this project though, it must be done in the flex app. I need to figure out how to group my data by day or month using a datatime field in my Arraycollection, then appropriately count or summarize data in other fields. I've used Groupingcollections before, but only when binding to hierarchical controls (like AdvancedDataGrid and Tree), but I need a resulting ArrayCollection with the grouped and summarized data.
Basically, I'm trying to access my AC like a sql table (GROUP BY MONTH(datetime), COUNT, COUNT(DISTINCT(), etc.) and I'm unsure how to do it. Does anyone have experience doing this?
You can give ActionLinq (https://bitbucket.org/briangenisio/actionlinq/wiki/Home) a try.
I've not used it myself, but I've been itching to give it a try :)
It's an implementation of Linq (from C#) in actionscript. This gives you a functional way of dealing with collections of data in a very SQL-like manner (select, group, filter, etc.).
I would characterise it like the filter method on steroids.
Here is an example from the website - it shows some of the SQL-like names and how the chaining works:
var transformed:Array =
[-4, -3, -2, -1, 0, 1, 2, 3, 4]
.where(isEven)
.select(square)
.distinct()
.reverse()
.toArray();
assertThat(transformed, array(0, 4, 16));
More information and examples here:
http://riarockstars.com/2011/02/07/processing-data-on-the-clientactionlinq/
You may find that this example points you in the right direction http://flexdiary.blogspot.com/2008/09/groupingcollection-example-featuring.html

Resources