Flashcat API (English)
API referenceDocs中文
API referenceDocs中文
  1. Open API
  • Open API
    • Quick Start
    • About Pagination
    • Member Management
      • Invite members
      • Delete member
      • Reset information
      • Member list
    • Team Management
      • Team list
      • Basic information
      • Delete team
      • Team upsert
    • Schedule Management
      • Preview schedule
      • Update schedule
      • Enable schedule
      • Disable schedule
      • Create schedule
      • Delete schedule
      • View schedule details
      • Get schedule information by ID list
      • View schedule list
      • Personal schedule calendar
      • Role information
    • Information Retrieval
      • Channel
      • Member
      • Team
    • Preference Settings
      • View preference settings
      • Modify preference settings
    • Channel
      • Escalation Rules
        • Enable rule
        • Disable rule
        • Delete rule
        • Rule list
        • Rule details
        • Create rule
        • Update rule
      • Subscription Rules
        • Enable rule
        • Disable rule
        • Delete rule
        • Rule list
        • Create rule
        • Update rule
      • Drop Rules
        • Enable rule
        • Disable rule
        • Delete rule
        • Rule list
        • Create rule
        • Update rule
      • Silence Rules
        • Enable rule
        • Disable rule
        • Delete rule
        • Rule list
        • Rule details
        • Inner conditions
      • Inhibit Rules
        • Disable rule
        • Delete rule
        • Rule list
        • See creation interface for filters explanation
        • Channel ID
        • Rule name
      • Match conditions
      • Delete rule
      • See creation interface for filters explanation
      • Enable rule
      • Update rule
      • Rule ID
      • Rule name
      • Sort
      • Delete rule
      • See creation interface for filters explanation
      • Name by integration
      • Robot list
    • Template Management
      • Name
      • Enable rule
      • Delete rule
      • See creation interface for filters explanation
      • Channel ID
      • Rule name
      • Required when updating
      • Update rule
    • Incident Management
      • Group View
        • Channel
        • Rule name
        • Inner conditions
        • Channel
      • Match conditions
      • Enable rule
      • Disable rule
      • Delete rule
      • Rule list
      • See creation interface for filters explanation
      • Create rule
      • Rule description
      • Update rule
      • Channel
      • Match conditions
      • Match conditions
      • Update rule
      • Channel
      • Rule ID
      • Inner conditions
      • Enable rule
      • Rule list
      • Rule details
      • Rule name
      • Rule description
      • Match conditions
      • Rule description
      • See creation interface for filters explanation
      • Disable rule
      • Rule description
    • Alert Management
      • Group View
        • Required when updating
        • Rule name
        • Inner conditions
        • Disable rule
      • Alert Info
      • Close Alert
      • Alert List By Card
      • Alert List
      • Alert List By ID
      • Event List
      • Feed
      • Merge Incident
    • Change Management
      • Inner conditions
    • Insights (old)
      • Channel
      • Match conditions
      • Rule ID
      • Enable rule
      • Name
      • Disable rule
      • Rule name
      • Name
      • See creation interface for filters explanation
    • Custom Fields
      • Enable rule
      • Disable rule
      • See creation interface for filters explanation
      • Channel ID
      • Channel
    • Service Calendar
      • Match conditions
      • Delete rule
      • Update rule
      • Required when updating
      • Rule details
      • Required when updating
      • Inner conditions
      • Channel
    • Label Enhancement
      • Mapping
        • Rule name
        • Rule list
        • Rule description
        • Match conditions
        • Rule ID
        • Rule description
        • Inner conditions
        • Enable rule
        • Disable rule
        • Rule description
      • Enable rule
      • Delete rule
    • Alert Processing
      • Create rule
      • Rule name
    • Integration Routing
      • Required when updating
      • Rule description
      • Match conditions
    • License Management
      • Create rule
    • Insights
      • Team Metrics
      • Responder Metrics Export
      • Incident List
      • Responder Metrics
      • Account Metrics
      • Channel Metrics Export
      • Team Metrics Export
      • Incident Export
      • Alert Top
      • Cahnnel Metrics
  • Event API
    • Quick Start
    • Alert Event
    • Change Event
  • Webhook
    • Quick Start
    • Custom Actions
    • Alert Webhook
    • Incident Webhook
  1. Open API

About Pagination

Generally, when fetching or retrieving data objects, we return data in batches based on pagination rather than returning all data in a single request.

Traditional Pagination

We define pagination technology based on OFFSET and LIMIT as traditional pagination. In most Flashduty list query APIs, you'll see the following parameter definitions:

{
    "p": 1,     // Page number, starts from 1. offset=(p-1)*limit
    "limit": 20 // Items per page, maximum value is 100, default is 20
}

In the response, we return these parameters:

{
    "total": 1000,       // Total number of items matching current conditions
    "has_next_page": 20  // Whether there is a next page under current conditions
}

While traditional pagination is simple, it may encounter these issues:

1. Performance issues: When using OFFSET and LIMIT for pagination queries, the database needs to skip a specified number of rows (OFFSET) and then return a specified number of rows (LIMIT). As the offset increases, query performance may decrease, especially when handling large amounts of data. Each query needs to scan and skip previous rows, making queries progressively slower.

2. Data instability: When using PAGE and LIMIT for pagination queries, if data is deleted or inserted during the query, results may become unstable. For example, if rows are deleted during the query process, subsequent offsets may become invalid, leading to inaccurate or missing results.

To protect the system and ensure stable access for most users, we've implemented these limitations for APIs using traditional pagination:

CAUTION

PAGE * LIMIT must be <= 10000. If it exceeds 10000, the system will return a 400 error. In this case, please switch to cursor pagination or narrow your query conditions.

Cursor Pagination

We define pagination technology based on SEARCH_AFTER_CTX as cursor pagination. Cursor pagination can better handle large datasets and high-performance requirements, providing a more stable and efficient pagination experience.

We support cursor pagination in these APIs:
Incident List
Alert List

In these APIs, you'll see these parameter definitions:

{
    "search_after_ctx": "658bcbae6ab5a67b3b800230",  // Cursor index, starts from first page if not set
    "limit": 20 // Items per page, maximum value is 100, default is 20
}

In the response, we return these parameters:

{
    "total": 1000,       // Total number of items matching current conditions
    "has_next_page": 20, // Whether there is a next page under current conditions
    "search_after_ctx": "658ba7f9566077d6090e8d51" // Next page cursor address, returned only if next page exists
}

About TOTAL

Regardless of pagination technology used, Flashduty always returns TOTAL and HAS_NEXT_PAGE parameters. However, note that TOTAL value isn't always accurate. To ensure quick system response, we've added these limitations:

CAUTION

When total matching data is less than 1000, total value is exact;
When total matching data is greater than or equal to 1000, total value is always 1000. This only indicates the system matched 1000+ items.

Therefore, please use has_next_page to determine if there's a next page, rather than total.

Modified at 2024-11-21 11:47:36
Previous
Quick Start
Next
Invite members
Built with