Cirqll Core
HomeCirqll
HomeCirqll
  1. Home
  • Query Parameters
    • Eager Loading
    • Partial Data
    • Count Relations
    • Pagination
      • Filter
      • Order By
  • Authentication
    • OAuth2
      • Authorize
        • Authorize
      • User
        • Me
      • Client
        • Index
        • Create
        • Update
        • Delete
      • Token
        • Create
        • Refresh
        • Index
      • Scopes
  • User
    • Index
      GET
    • Show
      GET
    • Create
      POST
    • Update
      PATCH
    • Delete
      DELETE
  • Role
    • Index
      GET
    • Show
      GET
    • Create
      POST
    • Update
      PATCH
    • Delete
      DELETE
  • Customer
    • Index
      GET
    • Show
      GET
    • Create
      POST
    • Update
      PATCH
    • Delete
      DELETE
  • Contact
    • Index
      GET
    • Show
      GET
    • Create
      POST
    • Update
      PATCH
    • Delete
      DELETE
  • Appointment
    • Index
    • Show
    • Create
    • Update
    • Delete
  • Task
    • Index
    • Show
    • Create
    • Update
    • Delete
  • Financial
    • Chance
      • Index
      • Show
      • Create
      • Update
      • Delete
    • Assignment
      • Index
      • Show
      • Create
      • Update
      • Delete
    • Contract
      • Index
      • Show
      • Create
      • Update
      • Delete
  • Email
    • Index
    • Show
    • Create
    • Update
    • Delete
  • Field
    • Index
    • Show
    • Create
    • Update
    • Delete
  • Note
    • Index
    • Show
    • Create
    • Update
    • Delete
  • To-do
    • Index
    • Show
    • Create
    • Update
    • Delete
  • Template
    • Index
    • Show
    • Update
    • Create
    • Delete
  • Setting
    • Index
    • Update
  • Webhook
    • Index
    • Show
    • Create
    • Update
    • Delete
  1. Home

Query Parameters

1. Eager Loading (with)#

The with parameter allows you to include related data with the primary resource in a single API call. This reduces the need for multiple requests, improving performance.

Usage:#

Comma-separated list: ?with=relation1,relation2
Array-style query: ?with[]=relation1&with[]=relation2

Examples:#

GET /api/user?with=company
GET /api/user?with[]=company&with[]=role

Nested Relations:#

Use dot notation: ?with=relation.nested_relation

2. Partial Data (show)#

The show parameter allows clients to specify the fields they want to include in the response. This is useful for reducing payload size and focusing on necessary data.

Usage:#

Comma-separated list: ?show=field1,field2
Array-style query: ?show[]=field1&show[]=field2

Examples:#

GET /api/resource?show=name,description
GET /api/resource?show[]=name&show[]=description

Nested Fields:#

Use dot notation: ?show=field.nested_field

3. Count Relations (count)#

The count parameter allows clients to include the count of related resources for one-to-many or many-to-many relationships. Counts are returned as {relation_name}_count fields.

Usage:#

Comma-separated list: ?count=relation1,relation2
Array-style query: ?count[]=relation1&count[]=relation2

Examples:#

GET /api/customer?count=assignments
GET /api/customer?count=assignments,contracts
GET /api/customer?count[]=assignments&count[]=contracts

4. Pagination#

Pagination parameters allow you to retrieve data in smaller chunks, improving performance and making it easier to manage large datasets.

Parameters:#

offset: The offset to retrieve items at. Default is 0.
limit: The number of items per page. Default value is 100.

Examples:#

GET /api/resource?offset=40&per_page=20

5. Filter (filter)#

The filter parameter enables clients to narrow down the results based on specific conditions.

Format:#

field:operator:value
Multiple filters can be combined with and/or logic.

Examples:#

GET /api/resource?filter=field:operator:value
GET /api/resource?filter=field:eq:value,another_field:gt:10
Nested logic: ?filter=field:eq:value,and,(field2:gt:5,or,field3:lt:10)

6. Order By (order_by)#

The order_by parameter allows clients to sort the response based on one or more fields.

Usage:#

Comma-separated list: ?order_by=field:asc,another_field:desc
Array-style query: ?order_by[]=field:asc&order_by[]=another_field:desc

Examples:#

GET /api/resource?order_by=name:asc
GET /api/resource?order_by=name:asc,description:desc
GET /api/resource?order_by[]=name:asc&order_by[]=description:desc

Summary#

By combining these parameters, you can:
Optimize performance with eager loading and partial data selection.
Retrieve aggregated information with relation counts.
Paginate, filter, and sort results to tailor the response to your needs.
Modified at 2025-01-26 14:35:32
Next
Eager Loading
Built with