How to get rest api data filterable by updated_at attribute in Magento1?
I would like my rest API data to be filtered by last updated_at so I have tried something like this:-
http://localhost/mage1/products?page=1&limit=5&filter[0][attribute]=updated_at&filter[0][gteq]=2019-09-01 07:40:30
I have tried the filters shown on devdocs for M1 but didn't succeeded with any proper result. https://prnt.sc/p0lrk9
https://localhost/api/rest/products?filter[0][attribute]=updated_at&filter[0][from][0]=max_date&page=1&limit=100&order=updated_at&dir=asc"
This may help you.It worked for me
Related
I have a rest URL that I am running against Microsoft Graph via POSTMAN and I'd like to know how to make the date filter check for records with activity in the last 90 days. My URL is this:
https://graph.microsoft.com/beta/users?$select=signInActivity&$filter=signInActivity/lastSignInDateTime%20le%202022-09-01
I do not want to use the hard-coded date like in this example or have to lean on something like powershell. Is there a way to calculate the date in the url or to tell the filter to do so? Something like this would be nice:
https://graph.microsoft.com/beta/users?$select=signInActivity&$filter=signInActivity/lastSignInDateTime%20le%20(today()-days(90))
Graph API does not support functions for working with date.
You can declare a property in Postman and set the property before the request is sent.
Example
The Graph API request is in a Postman collection. You can create a collection variable MyVar and use the variable in $filter query.
Then you can write a pre-request script in JavaScript and set the collection variable.
let d = new Date();
d.setDate(d.getDate()-90);
pm.collectionVariables.set("MyVar", d.toISOString().split('T')[0]);
Send the request and check console how the request looks like.
Resources:
Filter query operators
Is there a way to get the last accessed date of a view in tableau online/server using rest api. I am currently using this
http://my_site/api/3.6/sites/site_id/workbooks/workbook_id/views?includeUsageStatistics=true
but getting usage statics like how many times it was viewed and created date and modified date.
There is a Views method in the rest api. I'm using python and tableauserverclient to get the usage you are looking for. See TSC reference and Direct Rest API for full docs.
import tableauserverclient as TSC
tableau_auth = TSC.TableauAuth('username', 'password')
server = TSC.Server('https://servername')
with server.auth.sign_in(tableau_auth):
all_views, pagination_item = server.views.get()
for x in all_views:
print(x.name, x.total_views)
The output will look like this and I verified directly in Server.
created_at and updated_at are in the WorkbookItem class
I hope that does it for you!
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.
Posting data to firebase generate new items similar to the following example:
log
-K4JVL1PZUpMc0r0xYcw
-K4jVRhOeL7fH6CoNNI8
-K4Jw0Uo0gUcxZ74MWBO
I struggle to find how to e.g. delete entries that is older than x days - preferably with the REST API. Suggestions appreciated.
You can do a range query.
This technique requires you to have a timestamp property for each record.
Using orderBy and endAt you can retrieve all of the items before a specified date.
curl https://<my-firebase-app>.firebaseio.com/category/.json?orderBy="timestamp"&endAt=1449754918067
Then with the result, you can delete each individual item.
I am looking to retrieve results from instagram for a particular tag mytag , I tried using this API call,
https://api.instagram.com/v1/tags/{tag-name}/media/recent
but it only returned 33 results even though there are more results. This question can be considered an extension to this question: How To Search Instagram via API Query?
What is the way to return instagram results for a particular tag within a date range?
This may be done through the min_tag_id and max_tag_id which. Not sure how to convert my date time to min_tag_id or max_tag_id?
call the API with max_tag_id and min_tag_id like this:
https://api.instagram.com/v1/tags/{tag-name}/media/recent?client_id={CLIENT_ID}&max_tag_id=1378677250000000&min_tag_id=1375998850000000
max_tag_id and min_tag_id is epoch_time + "000000"
you still only get 20 per API call, use pagination to get all
Update: Instagram changed the tag_id, so date filter cannot be done
this way. Login on http://gramfeed.com and search for a hashtag and
you can do date/time filter, its a different hack implementation.