Sage CRM 2024 R2: RESTful API enhancements - new Query Parameters and Operators

1 minute read time.

Orderby

Sage CRM 2024 R2, there have been enhancements to the RESTful API. The GET operations that retrieve all entity records have been updated to provide an orderBy system query option. This allows you to order the returned records by the value of a specified field in either ascending (asc) or descending (desc) order.

See: https://developer.sage.com/crm/reference/2024R2/#tag/Address/paths/~1Address/get

Supported Operators

You can use the following operators to filter the records retrieved by a GET request:

  • and.
    • AND operator.
  • between and.
    • A numeric value must be in the specified range.
  • eq.
    • A numeric, string, or date/time value must be identical to the specified value.
  • ge.
    • A numeric value must be greater than or equal to the specified value.
  • gt.
    • A numeric value must be greater than the specified value.
  • like.
    • A numeric or string value must match the specified pattern. Accepts %25 as a wildcard character.
  • or.
    • OR operator.

To use these operators, append where= to the URL in your request and then specify a condition. Encode a white space as %20.

See: https://developer.sage.com/crm/reference/2024R2/#section/Operators-to-filter-retrieved-records

Examples

% Wildcard represented at %25 character encoding.

  • http://localhost/sdata/crmj/sagecrm2/-/person?where=pers_personid eq '30'
  • http://localhost/sdata/crmj/sagecrm2/-/company?where=comp_name like 'A%25'
  • http://localhost/sdata/crmj/sagecrm2/-/company?where=comp_name like 'A%25' and comp_type eq 'customer'
  • http://localhost/sdata/crmj/sagecrm2/-/company?where=comp_name like 'A%25' or comp_name like 'C%25'
  • http://localhost/sdata/crmj/sagecrm2/-/company?where=comp_name like 'A%25'&orderBy=comp_name desc
  • http://localhost/sdata/crmj/sagecrm2/-/company?where=comp_companyid between 43 and 50
  • http://localhost/sdata/crmj/sagecrm2/-/company?where=comp_companyid eq '43'
  • http://localhost/sdata/crmj/sagecrm2/-/quoteitems?where=quit_quotedprice ge 8
  • http://localhost/sdata/crmj/sagecrm2/-/quoteitems?where=quit_productid gt 3 and quit_productid le 10
  • http://localhost/sdata/crmj/sagecrm2/-/quoteitems?where=quit_quotedprice gt 2000