Tool Name: airdroid_business_provisioning_template_list
Risk Level: 🟢 Low Risk
Execution Mode: ⚡ Synchronous
Category: Provisioning Templates
Quick Start (Copy & Use)
Summary: Retrieve a paginated list of provisioning templates (enrollment templates used to pre-configure device settings during enrollment) with optional platform filtering, case-insensitive name search, and configurable sorting (Order + Ascending).
Prerequisites: A valid OAuth2 AccessToken configured in the GI node Credential. All business inputs are optional.
Success Criteria: StatusCode == 200 and ErrorMessage == "".
What to Do Next: Use ProvisioningList[].provisioning_id as ProvisioningId for Get a Provisioning Template, Delete Provisioning Templates, or Generate Device Owner Enrollment QR for Template.
Minimal Request Example (recommended to copy directly):
{
"PageIndex": 1,
"PageSize": 50,
"PlatformType": 0,
"Name": "",
"Order": "create_time",
"Ascending": false
}
Minimal Response Example:
{
"ProvisioningList": [
{
"provisioning_id": 17563,
"name": "Standard Template",
"description": "Standard provisioning template for field devices",
"default_language": "en",
"default_timezone": "America/New_York",
"platform_type": "Android",
"release_type": "Group",
"is_default": "No",
"install_by_wifi": "Yes",
"group_id": 123,
"policy_id": 0,
"wifi_id": 0,
"operator": {
"name": "Admin User",
"email": "admin@example.com"
},
"create_time": "2024-06-15 10:30:00",
"update_time": "2024-12-01 14:20:00"
}
],
"Pagination": {
"total": 1,
"page_size": 50,
"page_index": 1,
"last_page": 1
},
"Hint": "",
"Retryable": false,
"OriginalStatusCode": 200,
"StatusCode": 200,
"ErrorMessage": ""
}
> Use Order (field name) and Ascending (boolean) for sorting. Sort and SortType are not valid inputs. PlatformType defaults to 0 (All platforms).
Recipes (Common Recipes)
Recipe 1: List All Templates (Newest First)
When to use: Browse all templates in the account. Default sort is by creation time, descending (newest first).
{
"PageIndex": 1,
"PageSize": 50,
"PlatformType": 0,
"Name": "",
"Order": "create_time",
"Ascending": false
}
Recipe 2: Find Templates by Name Keyword
When to use: Resolve a template name to its provisioning_id. Name performs a case-insensitive substring match.
{
"PageIndex": 1,
"PageSize": 50,
"PlatformType": 0,
"Name": "Standard",
"Order": "name",
"Ascending": true
}
Recipe 3: Find the Account Default Template
When to use: Locate the default template (which cannot be deleted). The default template is always exposed and queried as the English name Default Configuration — do not use localized/translated names.
{
"PageIndex": 1,
"PageSize": 50,
"PlatformType": 0,
"Name": "Default Configuration",
"Order": "create_time",
"Ascending": false
}
Recipe 4: List Android Templates by Most Recently Updated
When to use: Audit which Android templates were changed recently.
{
"PageIndex": 1,
"PageSize": 50,
"PlatformType": 1,
"Name": "",
"Order": "update_time",
"Ascending": false
}
Recipe 5: Paginate Through All Templates
When to use: The account has more templates than one page. Increment PageIndex while Pagination.page_index < Pagination.last_page.
{
"PageIndex": 2,
"PageSize": 50,
"PlatformType": 0,
"Name": "",
"Order": "id",
"Ascending": true
}
1. Overview
1.1 Description
Get provisioning templates with pagination, optional platform filtering, fuzzy (case-insensitive substring) name search, and configurable sorting by id, name, update_time, or create_time.
Permission scoping: results are scoped to the current account's permissions —
- Accounts without control-all-devices permission only see templates for authorized groups
- Accounts without Configuration File read permission mainly see Group release-type templates
- Accounts without the Policy feature mainly see basic Policy templates plus Group templates
This scope may differ from what an admin sees in the management console.
1.2 When to Use
- Browse or search provisioning templates in the account
- Resolve a ProvisioningId to pass to Get a Provisioning Template, Delete Provisioning Templates, or Generate Device Owner Enrollment QR for Template
- Filter by platform type or name keyword; sort by ID, name, creation time, or update time
- Check which templates exist before cleanup or other provisioning operations
Don't use when: you already have the ProvisioningId and need full template details — use Get a Provisioning Template directly.
1.3 Execution Mode and Response
This operation is synchronous and returns:
- ProvisioningList: Array of template summary objects (permission-scoped)
- Pagination: Pagination metadata (total, page_size, page_index, last_page)
- StatusCode / ErrorMessage / Hint / Retryable / OriginalStatusCode: Call status and error information
1.4 Prerequisites
| Condition | Description | How to Check |
|---|---|---|
| Valid credential | A valid OAuth2 AccessToken is required | Configure AirDroid Business OAuth2 credential in the GI node |
1.5 Differences from Similar Tools
| Tool | Use Case | Key Difference |
|---|---|---|
| List Provisioning Templates | Browse / search / sort templates | Paginated summary list; supports name keyword and platform filter |
| Get a Provisioning Template | Single template full detail | Requires exact ProvisioningId; returns group/policy/wifi objects, install_apps, deploy_code, configuration_code |
2. Inputs
2.1 Parameter List
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| PageIndex | number | No | 1 | Page index for pagination (1-based) |
| PageSize | number | No | 50 (node default) | Records per page, range 1-50 |
| PlatformType | number | No | 0 | Platform filter: 0 = All, 1 = Android, 2 = Windows |
| Name | string | No | "" | Template name keyword (case-insensitive substring match); max 200 characters |
| Order | string | No | create_time | Sort field: id, name, update_time, create_time |
| Ascending | bool | No | false | true = ascending, false = descending |
2.2 Parameter Details
`PageIndex`
- Type: number
- Format: Positive integer starting from 1
- Example: 1
`PageSize`
- Type: number
- Format: 1-50
- Default: The GI node default is 50.
> Set PageSize explicitly when response size matters. The GI node sends 50 unless you choose another value.
- Example: 50
`PlatformType`
Platform type filter.
- Type: number
- Allowed values:
- 0 = All platforms (default)
- 1 = Android
- 2 = Windows
- Any other value returns StatusCode = -1 with ErrorMessage = "Invalid platform_type, must be 0 (All), 1 (Android), or 2 (Windows)."
- Example: 0
`Name`
Optional template name keyword.
- Type: string
- Matching rule: Case-insensitive substring match against the template name. Empty string = no name filter.
- Length limit: Maximum 200 characters (exceeding returns StatusCode = -1)
- Default template naming: The account default template is always exposed and queried as the English name Default Configuration (do not use localized/translated names). To find it, pass Name = "Default Configuration"; the returned name for that template is also Default Configuration.
- Why recommended: filtering by Name narrows results and reduces token consumption before paginating.
- Example:
"Standard"
`Order`
Sort field.
- Type: string
- Allowed values (whitelist — any other value returns StatusCode = -1):
- id: Sort by template ID
- name: Sort alphabetically by template name
- update_time: Sort by last update time
- create_time: Sort by creation time (default)
- Mapping: sent to the API as the sort request parameter
- Example: "update_time"
`Ascending`
Sort order direction.
- Type: bool
- Values: true = ascending (A to Z, 0 to 9, oldest to newest); false = descending (Z to A, 9 to 0, newest to oldest). Default false.
- Mapping: sent to the API as sort_type (true → asc, false → desc)
- Example: false
2.3 Parameter Combination Logic
- All filters are optional and combine with AND semantics: PlatformType and Name both apply when set
- Order + Ascending together define the sort; they do not affect filtering
- PageIndex / PageSize slice the filtered, sorted result set
3. Outputs
3.1 Response Example
Success response: see the Quick Start minimal response example above.
Error response (invalid Order value):
{
"ProvisioningList": [],
"Pagination": {},
"Hint": "Set Order to id, name, update_time, or create_time, then retry.",
"Retryable": false,
"OriginalStatusCode": 0,
"StatusCode": -1,
"ErrorMessage": "Invalid Order. Allowed values: id, name, update_time, create_time."
}
3.2 Field Descriptions
| Field Path | Type | Description |
|---|---|---|
| ProvisioningList | object-array | Array of template summary objects visible to the current account (permission-scoped) |
| ProvisioningList[].provisioning_id | number | Template ID — use as ProvisioningId in other provisioning tools |
| ProvisioningList[].name | string | Template name; the account default template always returns Default Configuration (English, not localized) |
| ProvisioningList[].description | string | Template description or notes |
| ProvisioningList[].default_language | string | Default language preset (e.g. en, zh-CN) |
| ProvisioningList[].default_timezone | string | Default timezone preset (e.g. Asia/Shanghai) |
| ProvisioningList[].platform_type | string | Platform type (e.g. Android, Windows) |
| ProvisioningList[].release_type | string | Association mode — Group (linked to a device group) or Policy (linked to a configuration policy); not a release stage |
| ProvisioningList[].is_default | string | "Yes" = default template, "No" = normal template (compare as string, not boolean) |
| ProvisioningList[].install_by_wifi | string | "Yes" / "No" — whether app installation is limited to Wi-Fi (not boolean) |
| ProvisioningList[].group_id | number | Associated group ID |
| ProvisioningList[].policy_id | number | Associated policy ID |
| ProvisioningList[].wifi_id | number | Associated WLAN configuration ID |
| ProvisioningList[].operator | object | Creator information, typically containing name and email |
| ProvisioningList[].create_time | string | Creation time |
| ProvisioningList[].update_time | string | Last update time |
| Pagination.total | number | Total number of records (after filtering) |
| Pagination.page_size | number | Records per page |
| Pagination.page_index | number | Current page number |
| Pagination.last_page | number | Last page number |
| Hint | string | Next-action guidance on error; empty on success |
| Retryable | boolean | true = transient error; false = persistent error or bad params |
| OriginalStatusCode | number | Upstream HTTP status code; 0 = no upstream response was captured |
| StatusCode | number | 200 = completed (check ErrorMessage), -1 = parameter error, 500 = system/network/HTTP error |
| ErrorMessage | string | Empty on success; error description on failure |
3.3 Status Code / Enum Value Mapping
| Field | Value | Meaning |
|---|---|---|
| PlatformType (input) | 0 / 1 / 2 | All / Android / Windows |
| platform_type (output) | "Android" / "Windows" | Readable platform string (input is a number, output is a string) |
| release_type | "Group" / "Policy" | Template association mode |
| is_default, install_by_wifi | "Yes" / "No" | String flags, not booleans |
3.4 Pagination
| Field | Description |
|---|---|
| Pagination.total | Total filtered record count |
| Pagination.page_size | Records per page |
| Pagination.page_index | Current page (1-based) |
| Pagination.last_page | Last page number |
Paging strategy:
- When page_index < last_page, call again with PageIndex + 1
- Use Name / PlatformType filters to narrow the result set before paginating
- PageSize maximum is 50
4. Examples
4.1 Basic Example: List All Templates
Request Parameters:
{
"PageIndex": 1,
"PageSize": 50,
"PlatformType": 0,
"Name": "",
"Order": "create_time",
"Ascending": false
}
Response: see the Quick Start minimal response example.
4.2 Advanced Example: Alphabetical Name Search
Request Parameters:
{
"PageIndex": 1,
"PageSize": 20,
"PlatformType": 1,
"Name": "field",
"Order": "name",
"Ascending": true
}
Matches every Android template whose name contains field (case-insensitive, e.g. Field Devices Template), sorted alphabetically A→Z.
4.3 Error Example: Invalid PlatformType
Request Parameters (error):
{
"PageIndex": 1,
"PageSize": 50,
"PlatformType": 3,
"Name": "",
"Order": "create_time",
"Ascending": false
}
Response:
{
"ProvisioningList": [],
"Pagination": {},
"Hint": "Set platform_type to 0 (All), 1 (Android), or 2 (Windows), then retry.",
"Retryable": false,
"OriginalStatusCode": 0,
"StatusCode": -1,
"ErrorMessage": "Invalid platform_type, must be 0 (All), 1 (Android), or 2 (Windows)."
}
5. Error Handling
5.1 AB Three-Layer Error Codes
| StatusCode | Meaning | Use Case | Agent Response |
|---|---|---|---|
| -1 | Parameter validation error | Invalid Name (non-string or >200 chars), PlatformType not in 0/1/2, Order not in whitelist, empty access token | ❌ Do not retry; fix parameters |
| 200 | Business success or business error | HTTP request succeeded; check ErrorMessage | Empty ErrorMessage = success; non-empty = business error (see Hint) |
| 500 | Network / HTTP / request exception | Timeout, connection failure, rate limit (HTTP 429), or any non-200 upstream HTTP status | Check Retryable: retry only when true |
This Action's StatusCode semantics: upstream HTTP errors (including 4xx) are returned as StatusCode = 500 with ErrorMessage = "HTTP <code>: ..."; Retryable = true only for HTTP 429/500/502/503/504. Use OriginalStatusCode for the real HTTP code.
5.2 Common Errors
| StatusCode | ErrorMessage Example | Cause | Fix |
|---|---|---|---|
| -1 | Invalid name. Length must not exceed 200 characters. | Name too long | Shorten to ≤ 200 characters |
| -1 | Invalid platform_type, must be 0 (All), 1 (Android), or 2 (Windows). | Value outside enum | Use 0, 1, or 2 |
| -1 | Invalid Order. Allowed values: id, name, update_time, create_time. | Order not in whitelist | Use one of the four allowed sort fields |
| -1 | access_token is invalid. | Credential not configured or token empty | Configure AirDroid Business OAuth2 Credential |
| 200 | Token expired/invalid message | The upstream service rejected the credential | Follow Hint: refresh the OAuth2 access_token, then retry |
| 500 | Rate limited. Please retry after a few seconds. | Upstream HTTP 429 | Wait 10-30 seconds and retry once |
| 500 | Request timeout after 60 seconds. | Request timeout | Retry once; reduce PageSize if it persists |
5.3 Agent Self-Healing Decision Table
| Condition | Handling Strategy |
|---|---|
| StatusCode == 200 and ErrorMessage == "" | Success — read ProvisioningList and Pagination |
| StatusCode == 200 and ErrorMessage != "" | Business error — follow Hint |
| StatusCode == -1 | Fix input parameters or Credential and retry |
| StatusCode == 500 and Retryable == true | Retry up to 2 times (5-second interval) |
| StatusCode == 500 and Retryable == false | Check OriginalStatusCode; fix auth instead of retrying |
6. Best Practices
6.1 Performance Optimization
- Filter before paginating: Use Name and/or PlatformType to narrow results and reduce token consumption
- Sort deliberately: Order = "update_time" with Ascending = false surfaces recently changed templates first
- Set PageSize explicitly: Because the node default (50) and the code fallback (20) differ, always set PageSize explicitly
6.2 Security Considerations
🟢 Read operation: No special security requirements. Results are permission-scoped to the calling account — an empty or short list may reflect limited group/feature permissions rather than a truly empty account.
6.3 Idempotency
Idempotency: Naturally idempotent. Read-only; repeated calls with identical parameters return the same result unless templates change in between.
7. Related Tools
7.1 Follow-up Tools
| Tool Name | Purpose |
|---|---|
| Get a Provisioning Template | View a template's full configuration (use provisioning_id as ProvisioningId) |
| Delete Provisioning Templates | Delete templates (use provisioning_id values as ProvisioningIds; verify is_default first) |
| Generate Device Owner Enrollment QR for Template | Generate an enrollment QR for an Android template (use provisioning_id) |
7.2 Similar Tool Comparison
| Tool | Use Case | Difference |
|---|---|---|
| List Provisioning Templates | Browse / search / sort templates | Paginated summary; keyword + platform filters |
| Get a Provisioning Template | Single template detail | Full configuration including associations and deployment codes |
8. Tool Chains
8.1 Resolve a Template Name to Its ID and Inspect It
Scenario: You know a template's approximate name and need its full settings.
Tool Chain:
List Provisioning Templates → Get a Provisioning Template
Steps:
- Call List Provisioning Templates with Name = "Standard"
- Take ProvisioningList[0].provisioning_id
- Call Get a Provisioning Template with that ID
8.2 Clean Up Obsolete Templates
Scenario: Delete deprecated templates after verifying they are not the default.
Tool Chain:
List Provisioning Templates → Delete Provisioning Templates
Steps:
- Call List Provisioning Templates and inspect name, is_default, update_time
- Collect provisioning_id values where is_default == "No" and the template is obsolete
- Call Delete Provisioning Templates with those IDs (a manual confirmation step will open)
8.3 Generate an Enrollment QR from a Template Name
Scenario: Produce a Device Owner enrollment QR for a template known only by name.
Tool Chain:
List Provisioning Templates → Generate Device Owner Enrollment QR for Template
Steps:
- Call List Provisioning Templates with Name keyword and PlatformType = 1 (Android)
- Take the matching provisioning_id
- Call Generate Device Owner Enrollment QR for Template with that ID
Appendix Reference:
- Field Reference: ./Field Reference.md
- Error Code Quick Reference: ./Error Codes.md
Leave a Reply.