Tool Name: airdroid_business_batch_operation_activity_log_search
Risk Level: 🟢 Low Risk
Execution Mode: ⚡ Synchronous
Category: Reports & Analytics
Quick Start (Copy & Use)
In one sentence: Poll per-device execution status for any batch device-operation task using one OperationLogId.
What you need: OperationLogId from the batch command tool that started the job (e.g. Batch Clear App Data and Cache or other batch tools that return it; not batch file uploads)
Success criteria: StatusCode == 200 and ErrorMessage is empty; check Summary and ActivityLogs[].Progress
What to do next: Repeat until Summary.Executing == 0, or filter failed devices via Filter.progress
Minimal request example:
{
"OperationLogId": 1770854462319857000
}
Minimal response example:
{
"BatchOperation": {
"OperationLogId": "1770854462319857000",
"Action": "app_clear",
"DeviceNum": 2,
"CreatedAt": "2026-07-21 14:30:00"
},
"ActivityLogs": [
{
"DeviceId": "fa6edcff65ab444e8b5e0eb08df4175d",
"DeviceName": "Office Tablet A",
"Pid": "1770854462319857001",
"Action": "app_clear",
"Progress": "Success",
"FailReason": ""
}
],
"Summary": {
"Total": 2,
"Executing": 0,
"Success": 2,
"Failure": 0,
"Overridden": 0
},
"Pagination": {
"total": 2,
"page_size": 50,
"page_index": 1,
"last_page": 1
},
"StatusCode": 200,
"ErrorMessage": ""
}
Recipes (Common Recipes)
Recipe 1: Poll After Batch Clear
Scenario: Track all devices after calling Batch Clear App Data and Cache
{
"OperationLogId": 1770854462319857000
}
Polling strategy:
- Call this tool with the OperationLogId from the batch clear response
- If Summary.Executing > 0, call again until the batch reaches a terminal state
- Stop when Summary.Executing == 0
- Inspect ActivityLogs where Progress == "Failure" and read FailReason
Recipe 2: List Only Failed Devices
Scenario: After polling, focus on devices that failed
{
"OperationLogId": 1770854462319857000,
"Filter": {
"progress": {
"eq": "Failure"
}
}
}
Recipe 3: Paginate Large Batches
Scenario: More than 50 devices in one batch operation
{
"OperationLogId": 1770854462319857000,
"PageIndex": 2,
"PageSize": 50
}
1. Overview
1.1 Description
This tool queries per-device activity logs for a batch operation identified by OperationLogId. Use it after batch daemon write tools (such as Batch Clear App Data and Cache) to monitor execution progress across all targeted devices in one call.
Each row in ActivityLogs uses the same field semantics as Get an Activity Log (DeviceId, Pid, Progress, FailReason, etc.).
1.2 When to Use
- Poll batch clear results: After Batch Clear App Data and Cache, track all devices with one OperationLogId
- Aggregate status: Use Summary to see how many devices are still Executing vs terminal states
- Filter failures: Use Filter.progress to list only failed devices
Do not use when:
- You have a single device and a single Pid → use Get an Activity Log
- The batch write has not been submitted yet → call the batch write tool first
1.3 Execution Mode & Response
This is a synchronous read that returns the current activity log snapshot immediately.
- Return value: BatchOperation, ActivityLogs, Summary, Pagination
- Key fields: Summary.Executing, ActivityLogs[].Progress, ActivityLogs[].FailReason
1.4 Prerequisites
| Condition | Description | How to Verify |
|---|---|---|
| Valid OperationLogId | Must come from a batch write tool response | From Batch Clear App Data and Cache → OperationLogId |
| Activity log permission | OAuth credential needs device activity log read access | 403 on HTTP layer if missing |
1.5 Prerequisite Tools
| Dependency Tool | Purpose | Necessity |
|---|---|---|
| Batch Clear App Data and Cache | Provides OperationLogId | 🔴 Required for batch clear polling |
2. Inputs
2.1 Parameter List
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| OperationLogId | number | ✅ Yes | - | Batch operation log ID from a batch write tool |
| PageIndex | number | ❌ No | 1 | Page number (1-based); zero, negative, decimal, and other invalid values return StatusCode -1 |
| PageSize | number | ❌ No | 50 | Records per page (1–100); zero, negative, decimal, and values above 100 return StatusCode -1 |
| Filter | object | ❌ No | - | Optional filter on device_id, device_name, progress |
2.2 Parameter Details
`OperationLogId`
Batch operation log ID returned by a batch write tool.
- Type: number (integer)
- How to obtain: From Batch Clear App Data and Cache response → OperationLogId
- Example:
1770854462319857000
`PageIndex`
Page number for paginated results.
- Type: number
- Default: 1 only when omitted / None
- Validation: Must be a whole number starting at 1; zero, negative, decimal, non-numeric text, and other invalid values return StatusCode -1
- Example: 1
`PageSize`
Number of activity log records per page.
- Type: number
- Default: 50 only when omitted / None
- Validation: Must be a whole number from 1 through 100; zero, negative, decimal, non-numeric text, and other invalid values return StatusCode -1
- Maximum: 100; larger values return StatusCode -1 with an error stating that the maximum was exceeded
`Filter`
Optional filter object. Multiple top-level fields are combined with AND.
Supported fields:
- progress (eq, in): Executing, Success, Failure, Overridden (English values only)
- device_id (eq, like, in): device unique identifier
- device_name (eq, like, in): device display name
Example — failed devices only:
{
"progress": {
"eq": "Failure"
}
}
2.3 Parameter Combination Logic
- OperationLogId is required; pagination and filter are optional
- Use Summary for overall progress; use ActivityLogs for per-device detail on the current page
3. Outputs
3.1 Response Examples
Success response:
{
"BatchOperation": {
"OperationLogId": "1770854462319857000",
"Action": "app_clear",
"DeviceNum": 3,
"CreatedAt": "2026-07-21 14:30:00"
},
"ActivityLogs": [
{
"DeviceId": "fa6edcff65ab444e8b5e0eb08df4175d",
"DeviceName": "Office Tablet A",
"Pid": "1770854462319857001",
"Action": "app_clear",
"Progress": "Success",
"FailReason": ""
}
],
"Summary": {
"Total": 3,
"Executing": 1,
"Success": 2,
"Failure": 0,
"Overridden": 0
},
"Pagination": {
"total": 3,
"page_size": 50,
"page_index": 1,
"last_page": 1
},
"Hint": "",
"Retryable": false,
"OriginalStatusCode": 200,
"StatusCode": 200,
"ErrorMessage": ""
}
Validation error (missing OperationLogId):
{
"BatchOperation": {},
"ActivityLogs": [],
"Summary": {},
"Pagination": {},
"Hint": "Provide the OperationLogId returned by a batch write tool such as 'Batch Clear App Data and Cache'.",
"Retryable": false,
"OriginalStatusCode": 0,
"StatusCode": -1,
"ErrorMessage": "OperationLogId is required."
}
Batch log not found:
{
"BatchOperation": {},
"ActivityLogs": [],
"Summary": {},
"Pagination": {},
"Hint": "Batch operation log was not found; use OperationLogId returned by the batch write tool and retry.",
"Retryable": false,
"OriginalStatusCode": 200,
"StatusCode": 200,
"ErrorMessage": "Batch operation log not found."
}
3.2 Field Reference
| Field | Type | Description | |||
|---|---|---|---|---|---|
| BatchOperation.OperationLogId | string | Batch operation log ID | |||
| BatchOperation.Action | string | Batch action name | |||
| BatchOperation.DeviceNum | number | Total devices in the batch | |||
| BatchOperation.CreatedAt | string | Batch creation timestamp | |||
| ActivityLogs[] | object-array | Per-device activity log rows (current page) | |||
| ActivityLogs[].DeviceId | string | Device unique identifier | |||
| ActivityLogs[].DeviceName | string | Device display name | |||
| ActivityLogs[].Pid | string | Per-device activity log process ID | |||
| ActivityLogs[].Action | string | Operation action name | |||
| ActivityLogs[].Progress | string | Executing \ | Success \ | Failure \ | Overridden |
| ActivityLogs[].FailReason | string | Failure reason when Progress is Failure | |||
| Summary.Total | number | Total activity log count | |||
| Summary.Executing | number | Devices still executing | |||
| Summary.Success | number | Successful devices | |||
| Summary.Failure | number | Failed devices | |||
| Summary.Overridden | number | Overridden devices | |||
| Pagination.total | number | Total matching records | |||
| Pagination.page_size | number | Page size used | |||
| Pagination.page_index | number | Current page index | |||
| Pagination.last_page | number | Last page number | |||
| StatusCode | number | Tool status code | |||
| ErrorMessage | string | Empty = success; non-empty = failure | |||
| Hint | string | Suggested next action on error | |||
| Retryable | bool | Whether identical retry may help | |||
| OriginalStatusCode | number | Upstream HTTP status (0 = no response) |
3.3 Progress Values
| Progress | Meaning | Agent Action |
|---|---|---|
| Executing | Command queued or in progress | Continue polling |
| Success | Completed successfully | Done for this device |
| Failure | Failed | Read FailReason |
| Overridden | Superseded by a newer command | Usually no action needed |
4. Examples
4.1 Basic Poll After Batch Clear
Step 1: Batch Clear App Data and Cache returns OperationLogId
Step 2: Query status
{
"OperationLogId": 1770854462319857000
}
Step 3: When Summary.Executing == 0, review Summary.Failure and failed rows in ActivityLogs
4.2 Filter Executing Devices
{
"OperationLogId": 1770854462319857000,
"Filter": {
"progress": {
"in": ["Executing"]
}
}
}
5. Error Handling
5.1 Status Code Reference
| StatusCode | Meaning | Agent Action |
|---|---|---|
| -1 | Local validation error | Fix parameters; do not retry unchanged |
| 200 | Request completed | Check ErrorMessage; empty = success |
| 500 | Network/timeout error | Retry if Retryable == true |
5.2 Common Errors
| StatusCode | ErrorMessage (example) | Cause | Fix |
|---|---|---|---|
| -1 | OperationLogId is required. | Missing ID | Pass OperationLogId from batch write |
| -1 | OperationLogId must be a positive integer. | Invalid ID | Use the whole-number ID from the batch write response |
| -1 | PageIndex is invalid. | Page index is zero, negative, decimal, non-numeric text, or otherwise invalid | Use a whole number starting at 1; only an omitted / None value defaults to 1 |
| -1 | PageSize is invalid. | Page size is zero, negative, decimal, non-numeric text, or otherwise invalid | Use a whole number from 1 through 100; only an omitted / None value defaults to 50 |
| 200 | (non-empty message) | Batch log not found or business error | Verify OperationLogId; read Hint |
| 500 | Request timeout after 60 seconds. | Network timeout | Retry once with smaller PageSize |
5.3 Agent Self-Healing
| StatusCode | Auto-retry | Strategy |
|---|---|---|
| -1 | ❌ | Fix parameters |
| 200 + ErrorMessage | ❌ | Follow Hint |
| 500 + Retryable=true | ⚠️ | Retry the read according to Hint |
6. Best Practices
6.1 Polling
- Stop condition: Summary.Executing == 0
- Use Summary first; drill into ActivityLogs only when needed
- For batches over 50 devices, paginate with PageIndex / PageSize
6.2 Idempotency
This is a read-only, idempotent tool. Safe to call repeatedly with the same parameters.
6.3 vs Get an Activity Log
| Tool | Input | Use Case |
|---|---|---|
| Search Batch Operation Activity Logs | OperationLogId | All devices in one batch operation |
| Get an Activity Log | DeviceId + Pid | Single device, single Pid |
7. Related Tools
| Tool | Relationship |
|---|---|
| Batch Clear App Data and Cache | Provides OperationLogId (upstream) |
| Get an Activity Log | Single-device alternative when you already have DeviceId + Pid |
8. Tool Chains
List Devices → Batch Clear App Data and Cache → Search Batch Operation Activity Logs (poll until Summary.Executing == 0)
Steps:
- Collect DeviceIds and PkgId
- Submit batch clear; save OperationLogId
- Poll this tool until all devices reach a terminal Progress
- Optionally filter progress == Failure to retry or notify operators
Appendix:
- Field reference: ./Field Reference.md
- Error codes: ./Error Codes.md
Leave a Reply.