Skip to main content

Data Extraction

Get My Data

Description

This endpoint allows retrieving specific data from the OmniQ API.

Request

  • Method: GET
  • URL: https://api.omniq.icq24.com/getmydata

Required Headers

  • x-tenant-id: ORGANIZATION-TENANTID

Request Body

  • Type: Raw (application/json)
  • Format:
{
"index": "",
"filterBy": { "FIELD": "" },
"from": 0,
"size": 0
}

Parameters

  • index: (Required) Name of the entity to query.
  • filterBy: (Optional) Object to filter by field and value.
  • from: (Optional) Starting index for pagination (default: 0).
  • size: (Optional) Number of results to return (default: 10).

Response

  • Status Code: 200 OK
  • Content Type: application/json

Response Schema

{
"type": "array",
"items": {
"type": "object",
"properties": {
"document": {
"type": "object",
"properties": {
"_id": { "type": "string" },
"botModule": { "type": [ "null", "string" ] },
"campaign": { "type": "string" },
"client": { "type": "string" },
"createdAt": { "type": "string" },
"instance": { "type": "string" },
"platform": { "type": "string" },
"scid": { "type": "string" },
"step": { "type": "string" },
"isNewClient": { "type": "boolean" },
"workflow": {
"type": "object",
"properties": {
"attrs": {
"type": "object",
"properties": {
"clientFromTemplate": { "type": "boolean" },
"templateId": { "type": "string" },
"contact": {
"type": "object",
"properties": {
"number1": { "type": "string" },
"email": { "type": "string" },
"firstName": { "type": "string" },
"question": { "type": "string" }
}
}
}
}
}
},
"agentTotalTime": { "type": [ "null", "number" ] },
"botStartedAt": { "type": "string" },
"botTotalTime": { "type": [ "null", "number" ] },
"poolTotalTime": { "type": [ "null", "number" ] },
"bot": { "type": "string" },
"tenantIdKey": { "type": "string" },
"updatedAt": { "type": "string" },
"tenantId": { "type": "string" },
"__v": { "type": "number" }
}
}
}
}
}

Available Entities

The following values can be used in the index field:

  • templates_reports
  • communicationlogs
  • hsm_templates
  • communications
  • manual_instances
  • users
  • campaings
  • profiles
  • reports
  • agents

Date Filtering

To filter by date, use the createdAt field with the following options:

Single date (exact match):

{
"index": "agents",
"filterBy": {
"createdAt": "2025-05-20T00:00:00.000Z"
},
"from": 0,
"size": 15
}

Date range:

{
"index": "agents",
"filterBy": {
"createdAt": {
"from": "2025-05-20T00:00:00.000Z",
"to": "2025-06-21T23:59:59.999Z"
}
},
"from": 0,
"size": 15
}

These two examples will search in the entity "agents", filtering by the specified criteria, and will return the first 15 results. Note: For a complete search, adjust the "from" and "size" fields. For example, "from":0, "size":100 will search from the first result to the 100th.

Pagination

Pagination Examples:

// Get first 100 records
{
"from": 0,
"size": 100
}
// Returns records: 0, 1, 2, ..., 99

// Get next 100 records
{
"from": 100,
"size": 100
}
// Returns records: 100, 101, 102, ..., 199

// Get 50 records starting from position 200
{
"from": 200,
"size": 50
}
// Returns records: 200, 201, 202, ..., 249

Understanding the Response:

The API response includes pagination information to help you navigate through large datasets:

{
"results": [/* your data */],
"total": {
"value": 10000,
"relation": "gte"
},
"count": 15000,
"pagination": {
"from": 2000,
"size": 15000,
"hasMore": true
}
}

Response Fields Explained:

  • value: Number of matching records found by the API
  • relation:
    • "eq" = Exact count (when ≤ 10,000 records)
    • "gte" = "Greater than or equal" (when > 10,000 records exist)
  • count: Actual number of records returned in this response
  • from: Starting position used in this request
  • size: Maximum records requested
  • hasMore:
    • true = More records available beyond this page
    • false = This is the last page of results

Pagination Strategy:

  • For datasets with ≤ 10,000 records: value shows exact count
  • For larger datasets: Use hasMore to determine if more pages exist
  • Continue pagination by incrementing from by your size value until hasMore becomes false

Usage Example

To get the first 15 results from the agents entity:

{
"index": "agents",
"filterBy": {
"FIELD": "TEXT"
},
"from": 0,
"size": 15
}

Notes

  • Specify the desired entity in the index field
  • Use filterBy to specify the field and search text
  • Adjust from and size to paginate the results
  • For a complete search, adjust the from and size fields. For example, "from": 0, "size": 100 will search from the first result to the 100th