Very often your database contains a large amount of entries, so it's better to apply filters when you retrieve data. Ragic API filters are in a special format
You can use the parameter "where" to add a filter condition to a query as below:
curl --get -d "where=2000123,eq,Alphabet Inc." \ -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.
To filter by subtable fields, you can use the format below,
where=< subtable field id >|< subtable field id >,< operand >,< value >
You can supply a query with multiple filter conditions as below:
curl --get -d "where=2000123,eq,Alphabet Inc." \ -d "where=2000127,eq,Jeff Kuo" \ -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=2000127,eq," \.
3. OR filtering for the SAME field can be achieved by supplying multiple where queries. For example, to retrieve records where field id 1000001 is either Ratshotel OR Claflin, "where=1000001,eq,Ratshotel&where=1000001,eq,Claflin" .
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=Alphabet" \ -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.
Very often your database contains a large amount of entries, so it's better to apply filters when you retrieve data. Ragic API filters are in a special format
You can use the parameter "where" to add a filter condition to a query as below:
curl --get -d "where=2000123,eq,Alphabet Inc." \ -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.
To filter by subtable fields, you can use the format below,
where=< subtable field id >|< subtable field id >,< operand >,< value >
You can supply a query with multiple filter conditions as below:
curl --get -d "where=2000123,eq,Alphabet Inc." \ -d "where=2000127,eq,Jeff Kuo" \ -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=2000127,eq," \.
3. OR filtering for the SAME field can be achieved by supplying multiple where queries. For example, to retrieve records where field id 1000001 is either Ratshotel OR Claflin, "where=1000001,eq,Ratshotel&where=1000001,eq,Claflin" .
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=Alphabet" \ -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.