How to retrieve only the newest rows via the Smartsheet API - smartsheet-api

I need to be able to retrieve only the newest (most recently modified) rows via the Smartsheet API.
The only way to get a sheet's rows seems to be via the Get Sheet call here: http://www.smartsheet.com/developers/api-documentation#h.4930jur8qsvs
I have a large sheet that is taking this call over 30 seconds to return. What I really need is just a way to get the most recently modified rows since a given timestamp.
Is there a way?

Try this (REST GET operation):
/sheet/{sheetID}?rowsModifiedSince={DATETIME}
DATETIME: Must be in UTC Format. e.x.:
https://api.smartsheet.com/1.1/sheet/##########?rowsModifiedSince=2015-03-26T11:40:00Z
This is an undocumented parameter of Smartsheet API 1.1.

Grabbing rows by modified date is not currently supported by the Smartsheet API at this time.

Just to provide an update of a hard to find correct syntax for version 2.0:
ten_ago = datetime.now() - timedelta(minutes=10)
ten_ago = ten_ago.isoformat()
page = smart.Sheets.get_sheet(sheet, level=2, rows_modified_since=ten_ago, include=object_value)
This will retrieve only the rows that has been modified 10 min ago including smartsheet object values.

Related

Date format in HTTP GET for test/runs azure DevOps API query

I'm attempting to call the Azure DevOps API to determine the outcome for test runs using the URL, narrowing the results to a single releaseEnvId:
https://dev.azure.com/organisation/project/_apis/test/runs?api-version=5.0&releaseEnvIds=12345&minLastUpdatedDate=2019-05-17T14:00:00.910Z&maxLastUpdatedDate=2019-05-15T14:00:00.910Z
The API request requires two mandatory date-time fields, but the doc at https://learn.microsoft.com/en-us/rest/api/azure/devops/test/runs/query?view=azure-devops-rest-5.0 does not specify the format:
maxLastUpdatedDate
minLastUpdatedDate
The date-time format I am specifying is wrong because the error comes up:
{"$id":"1","innerException":null,"message":"Invalid dates specified.","typeName":"Microsoft.TeamFoundation.TestManagement.WebApi.InvalidPropertyException, Microsoft.TeamFoundation.TestManagement.WebApi","typeKey":"InvalidPropertyException","errorCode":0,"eventId":3000}
As I understand the doc, the min date must be less than 7 days from the max. if I add garbage to the date formats then it produces a proper date parsing error.
The format you provided it's good but in your example the minLastUpdatedate (5/17) it's after the maxLastUpadeDate (5/15) in it should be the opposite. try to replace the values and it should work.
BTW - you specified the date in the full format, the API should works also with date only - 2019-05-15 or with a time - 2019-05-15T14:00:00.

Qlik Sense: Change date field format from Google Analytics API

I've pulled in data in Qlik Sense (cloud) from the Google Analytics connector. I'm trying to convert the standard date [ga_dateHourMinute] field to a more eligible date format.
The current format is YearMonthDayhHourMinute, for instance: 201810250004, I would like to convert this to the standard date format 2018-10-25 00:04:00. How do I do this? Answers concerning methods in the data load script or master formula's or variables are all welcome.
Click to see screenshot: left = current date format and right = desired date format
This is one approach:
DateAlter:
LOAD * INLINE [
Date
201810250004
];
DateAlter2:
LOAD
Date(Date#([Date], 'YYYYMMDDhhmm') ,'YYYY-MM-DD hh:mm') AS [MyDateField]
Resident
DateAlter;
If you haven't played around with the data manager, it will allow you to edit fields and handle dates in a fairly easy manner:
Qlik Sense Data Manager
I ended up creating a text fields that combined the different digits from the one field into a new order, then pushed the data format into a date/time. Quite a bit of work, but fairly solid.

Is there a way to check date dynamically in eloqua?

Context: I am using Microsoft Dynamics (CRM) and Eloqua to send email campaigns. I have a date field in CRM that I want to check against in Eloqua for a specific campaign. This campaign needs to check to see if the date field is <= today's date + 90 days. I am using the campaign UI in Eloqua, not doing anything programmatically at this point.
I have tried using the Compare Custom Object Fields decision in Eloqua by finding the date field, setting the comparator to dynamically on or before, and I want to make the compared value Today + 90 days. I'm not sure how to accomplish this in this type of Decision object because the only options I have to compare the date field to are Yesterday, Today, or Tomorrow. See image below:
I have also tried to use the Compare Date Decision object, but there is no dynamic comparison, just hard-coded date options.
The last thing I tried was a Wait step, but that only waits a hard-coded number of days rather than checking dynamically.
Has anyone run into this issue or know of a solution to this problem?
We were able to find an Eloqua Date App to download that adds a Date Decision step to the program builder which allowed us more flexibility with comparing dates in a custom range.

Facebook Marketing API Between Relative Dates

I know I can retrieve data from the API between two specified dates like so:
https://graph.facebook.com/v2.5/act_xxxxxx/insights?level=ad&fields=ad_name,adset_name,campaign_name,spend,unique_clicks,clicks,impressions,cost_per_unique_click,cpm,ctr&sort=spend_descending&time_range[since]=2016-04-01&time_range[until]=2016-04-16
Is there a way to retrieve the data from the API using relative dates from today? Such as this psuedocode:
https://graph.facebook.com/v2.5/act_xxxxxx/insights?level=ad&fields=ad_name,adset_name,campaign_name,spend,unique_clicks,clicks,impressions,cost_per_unique_click,cpm,ctr&sort=spend_descending&time_range[since]=15 DAYS AGO&time_range[until]=7 DAYS AGO
Yes and no.
We do support a list of date presets
And they are defined in:
https://developers.facebook.com/docs/marketing-api/reference/ad-account/insights/
Or you can check our php SDK:
https://github.com/facebook/facebook-php-ads-sdk/blob/613d89fbe0424d017a5156658b4e324fbfb5be68/src/FacebookAds/Object/Values/AdsInsightsDatePresetValues.php
https://github.com/facebook/facebook-php-ads-sdk/blob/d51193b19d730ae9274d45540986e1ac311b074d/src/FacebookAds/Object/AdsInsights.php#L72
In curl you will just use date_preset parameter instead of since

Facebook Graph Feed documentation

Where can I find the documentation (parameters that can be given) of the following graph url:
https://graph.facebook.com/<PAGENAME>/feed
I've been searching for hours, but I can't find them.. I'm looking for the parameter to get posts till a certain date..
What you are looking for is Time-based Pagination to navigate through results data using Unix timestamps which point to specific times in a list of data. You can use the until field which as per documentation is
A Unix timestamp or strtotime data value that points to the end of the range of time-based data.
For example, following will give you the posts of User until 10th June 2013
me/feed?until=1370840400