API Developer Guide
How can we help?

Filter Conditions

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=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.

  • 1. Field id of the field that you would like to filter.
  • 2. Operand in the form of integer to specify your filter operation. The list of operands are listed below.
  • 3. The value that you would like to filter the field with. Remember if your value might include a "," comma character, please URL encode it or just use a %2C instead to avoid collision.

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
Create User 108
Entry Manager 106
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.

Top of Page Table of Contents
Learn more about Ragic:
Why we created Ragic
Webinars
User Guide
Ragic Pricing
Applications
Keep in touch:
Blog
Facebook
YouTube
Ragic, Inc.
1-888-666-8037
Terms
Privacy
info@ragic.com