Search & Sorting

Search and Sorting [GET /api/resource?fileds[operator]=value]

This method is used to search and sort the desired keywords and fields, you can append the element that you want to search as parameter using supported parameters below :

  1. Search
    If you use this method, the data will be displayed in accordance with the keywords of the desired field.

    Example : https://app.zahironline.com/api/accounts?search[name]=bank
    or for search array
    https://app.zahironline.com/api/accounts?search[subclassification.code]=3100
    and for search array by id
    https://app.zahironline.com/api/accounts?classification.id=9a781d77-66ae-44df-82ad-e5f595f4d5a8

  2. Sort asc
    If you use this method, the list of data sorted will be sequentially letters or number from large to small.

    Example : https://app.zahironline.com/api/accounts?sort[code]=asc

  3. Sort desc
    If you use this method, the list of data sorted will be sequentially letters or number from small to large.

    Example : https://app.zahironline.com/api/accounts?sort[code]=desc

  4. Equal $eq
    All fields that do not contain special query parameters are compared directly for equality.
    Successful responses return with a HTTP 200 status code.

    Example : https://app.zahironline.com/api/accounts?code=110099010

  5. Not Equal $ne
    $ne selects the records where the value of the field is not equal to the specified value. This includes records that do not contain the field.

    Example : https://app.zahironline.com/api/products?unit_cogs[$ne]=100000

  6. Greater than $gt
    $gt selects those records where the value of the field is greater than (i.e. >) the specified value.

    Example : https://app.zahironline.com/api/products?unit_cogs[$gt]=250000

  7. Greater than or equals $gte
    $gte selects the records where the value of the field is greater than or equal to (i.e. >=) a specified value (e.g. value.).

    Example : https://app.zahironline.com/api/products?unit_cogs[$gte]=300000

  8. Less than $lt
    $lt selects the records where the value of the field is less than (i.e. <) the specified value.

    Example : https://app.zahironline.com/api/products?unit_cogs[$lt]=500000

  9. Less than or equal $lte
    $lte selects the records where the value of the field is less than or equal to (i.e. <=) the specified value.

    Example : https://app.zahironline.com/api/products?unit_cogs[$lte]=250000

  10. like $like
    Find all records that contains ( $like ) of the given criteria Case Insensitive.

    Example : https://app.zahironline.com/api/products?name[$like]=%Honda%

  11. ilike $ilike
    Find all records that contains ( $ilike ) of the given criteria Case sensitive.

    Example : https://app.zahironline.com/api/products?name[$ilike]=%honda%

  12. nlike $nlike
    Find all records that do not contains ( $nlike ) of the given criteria Case Insensitive.

    Example : https://app.zahironline.com/api/products?name[$nlike]=%Honda%

  13. nilike $nilike
    Find all records that do not contains ( $nlike ) of the given criteria Case Sensitive.

    Example : https://app.zahironline.com/api/products?name[$nilike]=%honda%

  14. in $in [GET /api/resource?field[$in]=[value1,value2,valuen]] The $in operator selects the records where the value of a field equals any value in the specified array. To specify an $in expression.

    Example : https://app.zahironline.com/api/products?code[$in]=[P-005,P-002,P-003]

  15. nin $nin [GET /api/resource?field[$nin]=[value1,value2,valuen]] $nin selects the records where the field value is not in the specified array or the field does not exist.

    Example : https://app.zahironline.com/api/products?code[$nin]=[P-005,P-003]