How to specify time in Azure AD Sign In REST API request - azure-active-directory

I need to retrieve the data after a specific period of time in order to avoid duplication. I can filter out based on the date. On filtering based on today's date, there is repetition in signIn data for the date for consequent requests
I have tried the filtering criteria for the following API
Ref link: https://learn.microsoft.com/en-us/graph/api/signin-list?view=graph-rest-1.0&tabs=http
Sample Request I have tried : https://graph.microsoft.com/beta/auditLogs/signIns?&$filter=createdDateTime gt 2020-09-29
I need to specify the time in this request...Any ideas ..?
Thanks in Advance

You're on the right track! The filter you're using also accepts a time.
If you check the List sign-in response you'll see the format Microsoft uses to specify the date and the time in out field.
Try this URI (for all items after 2020-09-29 19:00:00 (UTC as noted by the z at the end)):
https://graph.microsoft.com/beta/auditLogs/signIns?&$filter=createdDateTime gt 2020-09-29T19:00:00z

Related

Salesforce Get a list of all opportunities which are new, updated or deleted since a given date using api

I am trying to receive a list of all opportunities that are created/updated/deleted since a given date. When I run query: SELECT Id FROM Opportunity WHERE SystemModStamp >= '2022-09-20' AND isDeleted = TRUE ALL ROWS I get a response stating "message": "ALL ROWS not allowed in this context", "errorCode": "MALFORMED_QUERY".
Going over the salesforce documentation I found out using queryAll() api method we can also get the opportunities which are created/updated/deleted. But I am not able to find an example of how to use this api. Any help in this direction would be highly appreciated.
Salesforce queryAll documentation: https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/resources_queryall.htm
Have you tried using queryAll instead of query? Start with
/services/data/v54.0/queryAll?q=SELECT+Id,+Name,+isDeleted,+StageName+FROM+Opportunity+ORDER+BY+isDeleted+DESC+LIMIT+20
and experiment, remove the ORDER BY, put filter by date...
SELECT Id, Name, isDeleted
FROM Opportunity
WHERE LastModifiedDate >2022-09-01T00:00:00Z
There's also dedicated "data replication API" which you can use to get opportunities updated / deleted in given time window (imagine an oppty that's edited 3 times in September, once in October - the last modified date will happily say October, how would you retrieve the fact it was touched in September too?). It'll give you just the IDs, you'd have to collect them and send the query for actual data - but it's something.

Is it possible to get the price of bitcoin in USD from the coinbase API for a specific time in the past?

GET https://api.coinbase.com/v2/prices/:currency_pair/spot
This price seems to be the current price
This question already has answers. Copy and pasted from here: Coinbase API v2 Getting Historic Price for Multiple Days
Any reason you aren't using coinbase pro?
The new api is very easy to use. Simply add the get command you want followed by the parameters separated with a question mark. Here is the new historic rates api documentation: https://docs.pro.coinbase.com/#get-historic-rates
The get command with the new api most similar to prices is "candles". It requires three parameters to be identified, start and stop time in iso format and granularity which is in seconds. Here is an example:
https://api.pro.coinbase.com/products/BTC-USD/candles?start=2018-07-10T12:00:00&stop=2018-07-15T12:00:00&granularity=900
EDIT: also, note the time zone is not for your time zone, I believe its GMT.

Find Azure Search date without time part

I can't find a way of getting a date from Azure Search using only the date.
The dates in the index are like: "2019-10-15T18:00:00Z","2019-10-22T18:00:00Z","2019-10-29T18:00:00Z"
If I try StartDate/any(s: s eq 2019-10-15T18:00:00Z) I get results
But with StartDate/any(s: s eq 2019-10-15) nothing comes up
I have tried usin the date OData function like so: StartDate/any(s: date(s) eq 2019-10-15) but I get an error 'Function 'date' is not supported'.
Is there any way to get dates without using the time part?
The use of date literals in filters in Azure Search will no longer be supported starting in api-version 2019-05-06-Preview. This was an "accidental feature" that we never intended to support. The reason you don't get any results is because the implicit conversion from Edm.Date to Edm.DateTimeOffset assumes a time of midnight UTC, whereas the dates in your index are 6 PM UTC.
We recommend explicitly providing the time and offset (or Z for UTC) in filters to avoid this problem.
If you want Azure Search to natively support fields and filters of type Edm.Date, please vote for this User Voice suggestion.
Date and time values represented in the OData V4 format: yyyy-MM-ddTHH:mm:ss.fffZ or yyyy-MM-ddTHH:mm:ss.fff[+|-]HH:mm. Precision of DateTimeOffset fields is limited to milliseconds. If you upload DateTimeOffset values with sub-millisecond precision, the value returned will be rounded up to milliseconds.
When you upload DateTimeOffset values with time zone information to your index, Azure Search normalizes these values to UTC.
Refer to supported data types in Azure search.

Correct Way to Pass Dates from Angular to Web API 2

I have an Angular application that takes dates (date only not time) and posts them to a Web API 2 REST service. We are running into an issue when someone from India uses the application due to timezone issues.
Currently the Angular app is converting the date into ISO8601 format in UTC timezone and sending them to Web API. When the data is received on the Web API side, the date ends up being incorrect. If 6/21/2016 was put into the form, the date ends up coming over as 6/20/2016. The desired solution is to have the actual date value entered in the form be the date value received by the API.
One proposed solution is to treat the dates as strings instead of Dates and then just pass the date portion. This just seems like a hack to me and doesn't seem like the "correct" way of doing it.
What is the correct way of handling this situation?
Given the fact that the application has a lot of date field inputs is there an easy way to implement the solution across all Date input values?
The date format yyyy-MM-dd will be accepted in US / India so you can pass it so to your WebAPI. In JavaScript before posting you can alter the date like this.
$scope.MyDate = $filter('date')($scope.MyDate, 'yyyy-MM-dd', timezone);
If you want time too, the format will be yyyy-MM-ddTHH:mmZ

Piwik: Get graph of unique visitors in custom date range using ImageGraph API

I only just started using piwik but am already stuck.
I want to get a graph showing the unique visitors of a custom date range (from February to April), so a count for each day. Just as it's displayed in Piwik under "Visitors => Overview". But somehow that doesn't seem possible with the ImageGraph API.
What I'm trying to do (using the ImageGraph API):
I want to display a graph showing the number of unique visitors per day in a certain date range.
Below I want to display a graph showing all goal conversions per day for the same date range.
It's supposed to show the relation between the two values since it's highly relevant if an increase in conversion is accompanied by an increase in unique visitors.
It would be great if both sparklines were in the same graph but I don't think that's possible.
Does anyone have an idea of how to achieve this? Any help would be appreciated.
Thomas
For daily visits you can generate the graphic by calling the next URL :
$this->baseSite.
'index.php?module=API&graphType=evolution&width=800&height=200&method=ImageGraph.get&idSite=' .
$this->siteId . '**&period=day**'. **'&date=' .
$this->startDate->format('Y-m-d') . ',' .
$this->endDate->format('Y-m-d')** .
'&apiModule=VisitsSummary&apiAction=get&token_auth='.
$this->apiKey

Resources