You can use the parameter "where" to add a filter condition to a query as below:
curl --get -d "where=800003,eq,Dwight Schrute" \
-H "Authorization:Basic YOUR_API_KEY_GOES_HERE" \
-d api \
https://www.ragic.com/demo/sales/1
The parameter is a "," comma delimited format, with at least 3 arguments.
You can supply a query with multiple filter conditions as below:
curl --get -d "where=800003,eq,Dwight Schrute" \
-d "where=800007,eq,Reseller" \
-H "Authorization:Basic YOUR_API_KEY_GOES_HERE" \
-d api \
https://www.ragic.com/demo/sales/1
Here's the list of operands that you can use:
Operand Name | Operand Value |
---|---|
Equals | eq |
Regular Expression | regex |
Greater or equals | gte |
Less or equals | lte |
Greater | gt |
Less | lt |
Contains | like |
Equals a node id | eqeq |
Please note that:
1.When you filter by date or date time, they will need to be in the following format: yyyy/MM/dd or yyyy/MM/dd HH:mm:ss.
2.You don't need to fill the third argument if you want to filter empty values, for example, "where=800003,eq," \.
There are some system fields that has special field ids that you can use in your query. Common system fields listed below:
System field name | Field id |
---|---|
Create Date | 105 |
Entry Manager | 106 |
Create User | 108 |
Last Update Date | 109 |
Notify User | 110 |
If Locked | 111 |
If Starred | 112 |
You can also use a full text search as a query filter. Just provide your query term in the parameter fts and the matched result will be returned.
curl --get -d "fts=Dwight" \
-H "Authorization:Basic YOUR_API_KEY_GOES_HERE" \
-d api \
https://www.ragic.com/demo/sales/1
You can also apply Shared View. Just set the id as below.
curl --get -d "filterId=YOUR_SHARED_VIEW_ID" \
-H "Authorization:Basic YOUR_API_KEY_GOES_HERE" \
-d api \
https://www.ragic.com/demo/sales/1
You could get the id by clicking the Shared View URL.