Comments (10)
BTW, this is what I'm trying to accomplish:
- Get all contacts the first time.
- Every few hours, get newly updated or created contact and company data.
from rest-api.
Hi thanks, I saw this waay too late. Any idea on how I can do an "OR" condition between (updated between x and y) OR (created between x and y)
BTW, I used the Chrome inspector to see the post data in Agile CRM's filtering in the UI. This should be documented much better than it is. There are a lot of rules and ways to fetch data I didn't even know existed.
from rest-api.
Hi @dedupely ,
Sorry for late reply !
Currently we don't have any option to fetch contacts data using "OR" condition between (updated between x and y) OR (created between x and y).
from rest-api.
Hi @Adam81
I appreciate your efforts in sharing this information with us. This would help all the existing customers and the future customers who will be a part of Agile CRM family. We will continue to come up with more updates in the near future.
https://github.com/agilecrm/rest-api/blob/master/README.md#12-dynamic-filters-on-contacts--deals
from rest-api.
Hi @clintonskakun ,
We have API to fetch list of contacts sort by created time but not by updated time. Please check below API explained how to get list of contacts using paging technique sort by created time.
https://www.youtube.com/watch?v=jJAAZKqybQ4
reference : https://github.com/agilecrm/rest-api#devapicontacts
In case you need more depth filter you can use dynamic filter :
https://github.com/agilecrm/rest-api#121-get-contacts-by-dynamic-filter
dynamic filter options : https://snag.gy/ngz7wh.jpg
from rest-api.
Damn. updated_time would be a giant resource saver. I need to fetch everything at once everytime then. Makes things a lot slower. Is it at all simple to add that feature? That'd be a giant life saver and resource saver on all 3 ends (client, Agile API and my integration end)
Can I use the cursor with the dynamic filter to pull pages of contacts changed(updated or created) after a certain time?
from rest-api.
Hi @clintonskakun ,
Sorry for late reply yes you can use dynamic filter for updating by or creating time -
curl https://{your_domain}.agilecrm.com/dev/api/filters/filter/dynamic-filter -H "Accept: application/json"
-H "Content-Type :application/x-www-form-urlencoded"
-d 'page_size=25&global_sort_key=-updated_time&filterJson={"rules":[{"LHS":"updated_time","CONDITION":"ON","RHS":1486924200000}],"contact_type":"PERSON"}'
-v -u [email protected]:123fghfhf******* -X POST
Note : global_sort_key (possible value)
-created_time -> sort by descending time [latest first]
created_time -> sort by ascending time
-updated_time -> sort by descending time [latest updated first]
updated_time -> sort by ascending time
"CONDITION" (possible value)
ON -- Your time zone: some date, 12:00:00 AM GMT+5:30
{"rules":[{"LHS":"updated_time","CONDITION":"ON","RHS":1486924200000}],"contact_type":"PERSON"}
BETWEEN
{"rules":[{"LHS":"updated_time","CONDITION":"BETWEEN","RHS":1486837800000,"RHS_NEW":1487010599999}],"contact_type":"PERSON"}
Note : you can use paging with dynamic filter also
from rest-api.
How can I get total number of contacts so in the pagination i can show number of contact are being display e.g showing 500 of 1400?
from rest-api.
Just in case someone is looking for a way to sort contacts by descending and ascending order I'm documenting it here. This API could use better documentation.
// Descending order ( note -created_time vs created_time)
contacts?page_size=1&cursor&global_sort_key=-created_time
// Ascending order
contacts?page_size=1&cursor&global_sort_key=created_time
from rest-api.
Hi all, guess what... It's possible to run the dynamic filter on contacts and also deals, I will include examples below.
@ghost Thanks for opening this post, you should now be able to accomplish what you wish.
Big thanks to @dedupely, using his inspector technique I was able to identify many of these filters and also find the hidden endpoint for "deals". To start, I will return the favor and answer his question correctly.
@dedupely asked...
Hi thanks, I saw this waay too late. Any idea on how I can do an "OR" condition between (updated between x and y) OR (created between x and y)
@ranjanagilecrm said its not possible but he's now incorrect, perhaps this functionality was added after his comment. It's possible to filter using an OR if you move the rules to the "or_rules" section of the dynamic filter request. Here's how you filter with an "OR" condition for (updated BETWEEN 11/18/19 and 11/19/19) OR (created BETWEEN 11/18/19 and 11/19/19)...
page_size=25&global_sort_key=-created_time&filterJson={"rules":[],"or_rules":[{"LHS":"updated_time","CONDITION":"BETWEEN","RHS":1574053200000,"RHS_NEW":1574312399999}, {"LHS":"created_time","CONDITION":"BETWEEN","RHS":1574053200000,"RHS_NEW":1574312399999}],"contact_type":"PERSON"
Endpoints
Contacts: /dev/api/filters/filter/dynamic-filter
Deals: /dev/api/deal/filters/filter/dynamic-filter
Examples:
Contacts updated within the last day
page_size=25&global_sort_key=-created_time&filterJson={"rules":[{"LHS":"updated_time","CONDITION":"LAST","RHS":"1"}],"or_rules":[],"contact_type":"PERSON"}
Contacts updated after Nov 1st, 2019
page_size=25&global_sort_key=-created_time&filterJson={"rules":[{"LHS":"updated_time","CONDITION":"AFTER","RHS":1572580800000}],"or_rules":[],"contact_type":"PERSON"}
Contacts updated on Nov 1st, 2019 with a "paid" tag
page_size=25&global_sort_key=-created_time&filterJson={"rules":[{"LHS":"tags","CONDITION":"EQUALS","RHS":"paid"},{"LHS":"updated_time","CONDITION":"ON","RHS":1572580800000}],"or_rules":[],"contact_type":"PERSON"}
Contacts with VIP tag OR paid tag
page_size=10&global_sort_key=-updated_time&filterJson={"rules":[],"or_rules":[{"LHS":"tags","CONDITION":"EQUALS","RHS":"VIP"},{"LHS":"tags","CONDITION":"EQUALS","RHS":"paid"}],"contact_type":"PERSON"}
Deals updated on Nov 1st, 2019
Note: use the deals endpoint and change "contact_type" to "OPPORTUNITY"
page_size=25&filterJson={"rules":[{"LHS":"updated_time","CONDITION":"ON","RHS":1572580800000}],"or_rules":[],"contact_type":"OPPORTUNITY"}
I hope this brings value to someone, it will save us lots of processing time.
from rest-api.
Related Issues (20)
- Getting an error while searching for a registered company
- Retrieve company's contacts on Agile CRM?
- Provide better documentation HOT 1
- Changing Company Owner
- Add "users" to the documentation
- Is there a method to retrieve all email records belongs to contact or company?
- Add forms to the documentation
- Creating a Deal With Products HOT 1
- Merging Companies HOT 1
- Reliably get all contacts HOT 3
- -updated_time in the global_sort_key throws exception
- dev/api/contacts/search/phonenumber/{phone-number} return company instead of contact
- Is there a parameter to add ordering?
- How to get list of contacts deleted?
- API does not return Web Stats
- Search for contact by email returns XML instead of JSON
- create a note for a ticket not working using REST API
- Dynamic filter null pointer exception
- Possible DNS/routing issue
- endpoint for listing fields for module
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rest-api.