1# @ohos.security.asset (Asset Store Service) 2 3The asset store service (ASSET) provides secure storage and management of sensitive data less than 1024 bytes in size, including passwords, app tokens, and other critical data (such as bank card numbers). 4 5> **NOTE** 6> 7> The initial APIs of this module are supported since API version 11. Newly added APIs will be marked with a superscript to indicate their earliest API version. 8 9## Modules to Import 10 11```typescript 12import { asset } from '@kit.AssetStoreKit'; 13``` 14 15## asset.add 16 17add(attributes: AssetMap): Promise\<void> 18 19Add an asset. This API uses a promise to return the result. 20 21To set [IS_PERSISTENT](#tag), the application must have the ohos.permission.STORE_PERSISTENT_DATA permission. 22 23**Atomic service API**: This API can be used in atomic services since API version 14. 24 25**System capability**: SystemCapability.Security.Asset 26 27**Parameters** 28 29| Name | Type | Mandatory| Description | 30| ---------- | -------- | ---- | ------------------------------------------------------------ | 31| attributes | [AssetMap](#assetmap) | Yes | Attributes of the asset to add, including the asset plaintext, access control attributes, and custom data.| 32 33**Return value** 34 35| Type | Description | 36| ------------- | ----------------------- | 37| Promise\<void> | Promise that returns no value.| 38 39**Error codes** 40 41For details about the error codes, see [Asset Store Service Error Codes](errorcode-asset.md). 42 43| ID| Error Message | 44| -------- | ---------------------------------------------------------- | 45| 201 | The caller doesn't have the permission. | 46| 401 | Parameter error. Possible causes: <br> 1. Mandatory parameters are left unspecified. <br> 2. Incorrect parameter types. <br> 3. Parameter verification failed. | 47| 24000001 | The ASSET service is unavailable. | 48| 24000003 | The asset already exists. | 49| 24000005 | The screen lock status does not match. | 50| 24000006 | Insufficient memory. | 51| 24000007 | The asset is corrupted. | 52| 24000008 | The database operation failed. | 53| 24000009 | The cryptography operation failed. | 54| 24000010 | IPC failed. | 55| 24000011 | Calling the Bundle Manager service failed. | 56| 24000012 | Calling the OS Account service failed. | 57| 24000013 | Calling the Access Token service failed. | 58| 24000014 | The file operation failed. | 59| 24000015 | Getting the system time failed. | 60 61**Example** 62 63```typescript 64import { asset } from '@kit.AssetStoreKit'; 65import { util } from '@kit.ArkTS'; 66import { BusinessError } from '@kit.BasicServicesKit'; 67 68function stringToArray(str: string): Uint8Array { 69 let textEncoder = new util.TextEncoder(); 70 return textEncoder.encodeInto(str); 71} 72 73let attr: asset.AssetMap = new Map(); 74attr.set(asset.Tag.SECRET, stringToArray('demo_pwd')); 75attr.set(asset.Tag.ALIAS, stringToArray('demo_alias')); 76attr.set(asset.Tag.ACCESSIBILITY, asset.Accessibility.DEVICE_FIRST_UNLOCKED); 77attr.set(asset.Tag.DATA_LABEL_NORMAL_1, stringToArray('demo_label')); 78try { 79 asset.add(attr).then(() => { 80 console.info(`Asset added successfully.`); 81 }).catch((err: BusinessError) => { 82 console.error(`Failed to add Asset. Code is ${err.code}, message is ${err.message}`); 83 }) 84} catch (error) { 85 let err = error as BusinessError; 86 console.error(`Failed to add Asset. Code is ${err.code}, message is ${err.message}`); 87} 88``` 89 90## asset.addSync<sup>12+</sup> 91 92addSync(attributes: AssetMap): void 93 94Add an asset. This API returns the result synchronously. 95 96To set [IS_PERSISTENT](#tag), the application must have the ohos.permission.STORE_PERSISTENT_DATA permission. 97 98**Atomic service API**: This API can be used in atomic services since API version 14. 99 100**System capability**: SystemCapability.Security.Asset 101 102**Parameters** 103 104| Name | Type | Mandatory| Description | 105| ---------- | -------- | ---- | ------------------------------------------------------------ | 106| attributes | [AssetMap](#assetmap) | Yes | Attributes of the asset to add, including the asset plaintext, access control attributes, and custom data.| 107 108**Error codes** 109 110For details about the error codes, see [Asset Store Service Error Codes](errorcode-asset.md). 111 112| ID| Error Message | 113| -------- | ---------------------------------------------------------- | 114| 201 | The caller doesn't have the permission. | 115| 401 | Parameter error. Possible causes: <br> 1. Mandatory parameters are left unspecified. <br> 2. Incorrect parameter types. <br> 3. Parameter verification failed. | 116| 24000001 | The ASSET service is unavailable. | 117| 24000003 | The asset already exists. | 118| 24000005 | The screen lock status does not match. | 119| 24000006 | Insufficient memory. | 120| 24000007 | The asset is corrupted. | 121| 24000008 | The database operation failed. | 122| 24000009 | The cryptography operation failed. | 123| 24000010 | IPC failed. | 124| 24000011 | Calling the Bundle Manager service failed. | 125| 24000012 | Calling the OS Account service failed. | 126| 24000013 | Calling the Access Token service failed. | 127| 24000014 | The file operation failed. | 128| 24000015 | Getting the system time failed. | 129 130**Example** 131 132```typescript 133import { asset } from '@kit.AssetStoreKit'; 134import { util } from '@kit.ArkTS'; 135import { BusinessError } from '@kit.BasicServicesKit'; 136 137function stringToArray(str: string): Uint8Array { 138 let textEncoder = new util.TextEncoder(); 139 return textEncoder.encodeInto(str); 140} 141 142let attr: asset.AssetMap = new Map(); 143attr.set(asset.Tag.SECRET, stringToArray('demo_pwd')); 144attr.set(asset.Tag.ALIAS, stringToArray('demo_alias')); 145attr.set(asset.Tag.ACCESSIBILITY, asset.Accessibility.DEVICE_FIRST_UNLOCKED); 146attr.set(asset.Tag.DATA_LABEL_NORMAL_1, stringToArray('demo_label')); 147try { 148 asset.addSync(attr); 149} catch (error) { 150 let err = error as BusinessError; 151 console.error(`Failed to add Asset. Code is ${err.code}, message is ${err.message}`); 152} 153``` 154 155## asset.remove 156 157remove(query: AssetMap): Promise\<void> 158 159Removes one or more assets. This API uses a promise to return the result. 160 161**Atomic service API**: This API can be used in atomic services since API version 14. 162 163**System capability**: SystemCapability.Security.Asset 164 165**Parameters** 166 167| Name| Type | Mandatory| Description | 168| ------ | -------- | ---- | ------------------------------------------------------ | 169| query | [AssetMap](#assetmap) | Yes | Attributes of the asset to remove, such as the asset alias, access control attributes, and custom data.| 170 171**Return value** 172 173| Type | Description | 174| ------------- | ----------------------- | 175| Promise\<void> | Promise that returns no value.| 176 177**Error codes** 178 179For details about the error codes, see [Asset Store Service Error Codes](errorcode-asset.md). 180 181| ID| Error Message | 182| -------- | ---------------------------------------------------------- | 183| 401 | Parameter error. Possible causes: <br> 1. Incorrect parameter types. <br> 2. Parameter verification failed. | 184| 24000001 | The ASSET service is unavailable. | 185| 24000002 | The asset is not found. | 186| 24000006 | Insufficient memory. | 187| 24000007 | The asset is corrupted. | 188| 24000008 | The database operation failed. | 189| 24000010 | IPC failed. | 190| 24000011 | Calling the Bundle Manager service failed. | 191| 24000012 | Calling the OS Account service failed. | 192| 24000013 | Calling the Access Token service failed. | 193| 24000015 | Getting the system time failed. | 194 195**Example** 196 197```typescript 198import { asset } from '@kit.AssetStoreKit'; 199import { util } from '@kit.ArkTS'; 200import { BusinessError } from '@kit.BasicServicesKit'; 201 202function stringToArray(str: string): Uint8Array { 203 let textEncoder = new util.TextEncoder(); 204 return textEncoder.encodeInto(str); 205} 206 207let query: asset.AssetMap = new Map(); 208query.set(asset.Tag.ALIAS, stringToArray('demo_alias')); 209try { 210 asset.remove(query).then(() => { 211 console.info(`Asset removed successfully.`); 212 }).catch((err: BusinessError) => { 213 console.error(`Failed to remove Asset. Code is ${err.code}, message is ${err.message}`); 214 }); 215} catch (error) { 216 let err = error as BusinessError; 217 console.error(`Failed to remove Asset. Code is ${err.code}, message is ${err.message}`); 218} 219``` 220 221## asset.removeSync<sup>12+</sup> 222 223removeSync(query: AssetMap): void 224 225Removes one or more assets. This API returns the result synchronously. 226 227**Atomic service API**: This API can be used in atomic services since API version 14. 228 229**System capability**: SystemCapability.Security.Asset 230 231**Parameters** 232 233| Name| Type | Mandatory| Description | 234| ------ | -------- | ---- | ------------------------------------------------------ | 235| query | [AssetMap](#assetmap) | Yes | Attributes of the asset to remove, such as the asset alias, access control attributes, and custom data.| 236 237**Error codes** 238 239For details about the error codes, see [Asset Store Service Error Codes](errorcode-asset.md). 240 241| ID| Error Message | 242| -------- | ---------------------------------------------------------- | 243| 401 | Parameter error. Possible causes: <br> 1. Incorrect parameter types. <br> 2. Parameter verification failed. | 244| 24000001 | The ASSET service is unavailable. | 245| 24000002 | The asset is not found. | 246| 24000006 | Insufficient memory. | 247| 24000007 | The asset is corrupted. | 248| 24000008 | The database operation failed. | 249| 24000010 | IPC failed. | 250| 24000011 | Calling the Bundle Manager service failed. | 251| 24000012 | Calling the OS Account service failed. | 252| 24000013 | Calling the Access Token service failed. | 253| 24000015 | Getting the system time failed. | 254 255**Example** 256 257```typescript 258import { asset } from '@kit.AssetStoreKit'; 259import { util } from '@kit.ArkTS'; 260import { BusinessError } from '@kit.BasicServicesKit'; 261 262function stringToArray(str: string): Uint8Array { 263 let textEncoder = new util.TextEncoder(); 264 return textEncoder.encodeInto(str); 265} 266 267let query: asset.AssetMap = new Map(); 268query.set(asset.Tag.ALIAS, stringToArray('demo_alias')); 269try { 270 asset.removeSync(query); 271} catch (error) { 272 let err = error as BusinessError; 273 console.error(`Failed to remove Asset. Code is ${err.code}, message is ${err.message}`); 274} 275``` 276 277## asset.update 278 279update(query: AssetMap, attributesToUpdate: AssetMap): Promise\<void> 280 281Updates an asset. This API uses a promise to return the result. 282 283**Atomic service API**: This API can be used in atomic services since API version 14. 284 285**System capability**: SystemCapability.Security.Asset 286 287**Parameters** 288 289| Name | Type | Mandatory| Description | 290| ------------------ | -------- | ---- | ------------------------------------------------------------ | 291| query | [AssetMap](#assetmap) | Yes | Attributes of the asset to update, such as the asset alias, access control attributes, and custom data.| 292| attributesToUpdate | [AssetMap](#assetmap) | Yes | New attributes of the asset, such as the asset plaintext and custom data. | 293 294**Return value** 295 296| Type | Description | 297| ------------- | ----------------------- | 298| Promise\<void> | Promise that returns no value.| 299 300**Error codes** 301 302For details about the error codes, see [Asset Store Service Error Codes](errorcode-asset.md). 303 304| ID| Error Message | 305| -------- | ---------------------------------------------------------- | 306| 401 | Parameter error. Possible causes: <br> 1. Mandatory parameters are left unspecified. <br> 2. Incorrect parameter types. <br> 3. Parameter verification failed. | 307| 24000001 | The ASSET service is unavailable. | 308| 24000002 | The asset is not found. | 309| 24000005 | The screen lock status does not match. | 310| 24000006 | Insufficient memory. | 311| 24000007 | The asset is corrupted. | 312| 24000008 | The database operation failed. | 313| 24000009 | The cryptography operation failed. | 314| 24000010 | IPC failed. | 315| 24000011 | Calling the Bundle Manager service failed. | 316| 24000012 | Calling the OS Account service failed. | 317| 24000013 | Calling the Access Token service failed. | 318| 24000015 | Getting the system time failed. | 319 320**Example** 321 322```typescript 323import { asset } from '@kit.AssetStoreKit'; 324import { util } from '@kit.ArkTS'; 325import { BusinessError } from '@kit.BasicServicesKit'; 326 327function stringToArray(str: string): Uint8Array { 328 let textEncoder = new util.TextEncoder(); 329 return textEncoder.encodeInto(str); 330} 331 332let query: asset.AssetMap = new Map(); 333query.set(asset.Tag.ALIAS, stringToArray('demo_alias')); 334let attrsToUpdate: asset.AssetMap = new Map(); 335attrsToUpdate.set(asset.Tag.SECRET, stringToArray('demo_pwd_new')); 336try { 337 asset.update(query, attrsToUpdate).then(() => { 338 console.info(`Asset updated successfully.`); 339 }).catch((err: BusinessError) => { 340 console.error(`Failed to update Asset. Code is ${err.code}, message is ${err.message}`); 341 }); 342} catch (error) { 343 let err = error as BusinessError; 344 console.error(`Failed to update Asset. Code is ${err.code}, message is ${err.message}`); 345} 346``` 347 348## asset.updateSync<sup>12+</sup> 349 350updateSync(query: AssetMap, attributesToUpdate: AssetMap): void 351 352Updates an asset. This API returns the result synchronously. 353 354**Atomic service API**: This API can be used in atomic services since API version 14. 355 356**System capability**: SystemCapability.Security.Asset 357 358**Parameters** 359 360| Name | Type | Mandatory| Description | 361| ------------------ | -------- | ---- | ------------------------------------------------------------ | 362| query | [AssetMap](#assetmap) | Yes | Attributes of the asset to update, such as the asset alias, access control attributes, and custom data.| 363| attributesToUpdate | [AssetMap](#assetmap) | Yes | New attributes of the asset, such as the asset plaintext and custom data. | 364 365**Error codes** 366 367For details about the error codes, see [Asset Store Service Error Codes](errorcode-asset.md). 368 369| ID| Error Message | 370| -------- | ---------------------------------------------------------- | 371| 401 | Parameter error. Possible causes: <br> 1. Mandatory parameters are left unspecified. <br> 2. Incorrect parameter types. <br> 3. Parameter verification failed. | 372| 24000001 | The ASSET service is unavailable. | 373| 24000002 | The asset is not found. | 374| 24000005 | The screen lock status does not match. | 375| 24000006 | Insufficient memory. | 376| 24000007 | The asset is corrupted. | 377| 24000008 | The database operation failed. | 378| 24000009 | The cryptography operation failed. | 379| 24000010 | IPC failed. | 380| 24000011 | Calling the Bundle Manager service failed. | 381| 24000012 | Calling the OS Account service failed. | 382| 24000013 | Calling the Access Token service failed. | 383| 24000015 | Getting the system time failed. | 384 385**Example** 386 387```typescript 388import { asset } from '@kit.AssetStoreKit'; 389import { util } from '@kit.ArkTS'; 390import { BusinessError } from '@kit.BasicServicesKit'; 391 392function stringToArray(str: string): Uint8Array { 393 let textEncoder = new util.TextEncoder(); 394 return textEncoder.encodeInto(str); 395} 396 397let query: asset.AssetMap = new Map(); 398query.set(asset.Tag.ALIAS, stringToArray('demo_alias')); 399let attrsToUpdate: asset.AssetMap = new Map(); 400attrsToUpdate.set(asset.Tag.SECRET, stringToArray('demo_pwd_new')); 401try { 402 asset.updateSync(query, attrsToUpdate); 403} catch (error) { 404 let err = error as BusinessError; 405 console.error(`Failed to update Asset. Code is ${err.code}, message is ${err.message}`); 406} 407``` 408 409## asset.preQuery 410 411preQuery(query: AssetMap): Promise\<Uint8Array> 412 413Performs preprocessing for the asset query. This API is used when user authentication is required for the access to the asset. After the user authentication is successful, call [asset.query](#assetquery) and [asset.postQuery](#assetpostquery). This API uses a promise to return the result. 414 415**Atomic service API**: This API can be used in atomic services since API version 14. 416 417**System capability**: SystemCapability.Security.Asset 418 419**Parameters** 420 421| Name| Type | Mandatory| Description | 422| ------ | -------- | ---- | ------------------------------------------------------ | 423| query | [AssetMap](#assetmap) | Yes | Attributes of the asset to query, such as the asset alias, access control attributes, and custom data.| 424 425**Return value** 426 427| Type | Description | 428| ------------------- | ----------------------------------------------------- | 429| Promise\<Uint8Array> | Promise used to return a challenge value.<br>**NOTE**: The challenge value is used for subsequent user authentication.| 430 431**Error codes** 432 433For details about the error codes, see [Asset Store Service Error Codes](errorcode-asset.md). 434 435| ID| Error Message | 436| -------- | ------------------------------------------------------------ | 437| 401 | Parameter error. Possible causes: <br> 1. Incorrect parameter types. <br> 2. Parameter verification failed. | 438| 24000001 | The ASSET service is unavailable. | 439| 24000002 | The asset is not found. | 440| 24000005 | The screen lock status does not match. | 441| 24000006 | Insufficient memory. | 442| 24000007 | The asset is corrupted. | 443| 24000008 | The database operation failed. | 444| 24000009 | The cryptography operation failed. | 445| 24000010 | IPC failed. | 446| 24000011 | Calling the Bundle Manager service failed. | 447| 24000012 | Calling the OS Account service failed. | 448| 24000013 | Calling the Access Token service failed. | 449| 24000016 | The cache exceeds the limit. | 450| 24000017 | The capability is not supported. | 451 452**Example** 453 454```typescript 455import { asset } from '@kit.AssetStoreKit'; 456import { util } from '@kit.ArkTS'; 457import { BusinessError } from '@kit.BasicServicesKit'; 458 459function stringToArray(str: string): Uint8Array { 460 let textEncoder = new util.TextEncoder(); 461 return textEncoder.encodeInto(str); 462} 463 464let query: asset.AssetMap = new Map(); 465query.set(asset.Tag.ALIAS, stringToArray('demo_alias')); 466try { 467 asset.preQuery(query).then((challenge: Uint8Array) => { 468 console.info(`Succeeded in pre-querying Asset.`); 469 }).catch ((err: BusinessError) => { 470 console.error(`Failed to pre-query Asset. Code is ${err.code}, message is ${err.message}`); 471 }); 472} catch (error) { 473 let err = error as BusinessError; 474 console.error(`Failed to pre-query Asset. Code is ${err.code}, message is ${err.message}`); 475} 476``` 477 478## asset.preQuerySync<sup>12+</sup> 479 480preQuerySync(query: AssetMap): Uint8Array 481 482Performs preprocessing for the asset query. This API is used when user authentication is required for the access to the asset. After the user authentication is successful, call [asset.querySync](#assetquerysync12) and [asset.postQuerySync](#assetpostquerysync12). This API returns the result synchronously. 483 484**Atomic service API**: This API can be used in atomic services since API version 14. 485 486**System capability**: SystemCapability.Security.Asset 487 488**Parameters** 489 490| Name| Type | Mandatory| Description | 491| ------ | -------- | ---- | ------------------------------------------------------ | 492| query | [AssetMap](#assetmap) | Yes | Attributes of the asset to query, such as the asset alias, access control attributes, and custom data.| 493 494**Return value** 495 496| Type | Description | 497| ------------------- | ----------------------------------------------------- | 498| Uint8Array | Challenge value.<br>**NOTE**: The challenge value is used for subsequent user authentication.| 499 500**Error codes** 501 502For details about the error codes, see [Asset Store Service Error Codes](errorcode-asset.md). 503 504| ID| Error Message | 505| -------- | ------------------------------------------------------------ | 506| 401 | Parameter error. Possible causes: <br> 1. Incorrect parameter types. <br> 2. Parameter verification failed. | 507| 24000001 | The ASSET service is unavailable. | 508| 24000002 | The asset is not found. | 509| 24000005 | The screen lock status does not match. | 510| 24000006 | Insufficient memory. | 511| 24000007 | The asset is corrupted. | 512| 24000008 | The database operation failed. | 513| 24000009 | The cryptography operation failed. | 514| 24000010 | IPC failed. | 515| 24000011 | Calling the Bundle Manager service failed. | 516| 24000012 | Calling the OS Account service failed. | 517| 24000013 | Calling the Access Token service failed. | 518| 24000016 | The cache exceeds the limit. | 519| 24000017 | The capability is not supported. | 520 521**Example** 522 523```typescript 524import { asset } from '@kit.AssetStoreKit'; 525import { util } from '@kit.ArkTS'; 526import { BusinessError } from '@kit.BasicServicesKit'; 527 528function stringToArray(str: string): Uint8Array { 529 let textEncoder = new util.TextEncoder(); 530 return textEncoder.encodeInto(str); 531} 532 533let query: asset.AssetMap = new Map(); 534query.set(asset.Tag.ALIAS, stringToArray('demo_alias')); 535try { 536 let challenge: Uint8Array = asset.preQuerySync(query); 537} catch (error) { 538 let err = error as BusinessError; 539 console.error(`Failed to pre-query Asset. Code is ${err.code}, message is ${err.message}`); 540} 541``` 542 543## asset.query 544 545query(query: AssetMap): Promise\<Array\<AssetMap>> 546 547Queries one or more assets. If user authentication is required for the access to the asset, call [asset.preQuery](#assetprequery) before this API and call [asset.postQuery](#assetpostquery) after this API. For details about the development procedure, see [Querying an Asset with User Authentication](../../security/AssetStoreKit/asset-js-query-auth.md). This API uses a promise to return the result. 548 549**Atomic service API**: This API can be used in atomic services since API version 14. 550 551**System capability**: SystemCapability.Security.Asset 552 553**Parameters** 554 555| Name | Type | Mandatory| Description | 556| -------- | ------------------------------- | ---- | ------------------------------------------------------------ | 557| query | [AssetMap](#assetmap) | Yes | Attributes of the asset to query, such as the asset alias, access control attributes, and custom data. | 558 559**Return value** 560 561| Type | Description | 562| ------------------------ | ------------------------------------- | 563| Promise\<Array\<AssetMap>> | Promise used to return the result obtained.| 564 565**Error codes** 566 567For details about the error codes, see [Asset Store Service Error Codes](errorcode-asset.md). 568 569| ID| Error Message | 570| -------- | ---------------------------------------------------------- | 571| 401 | Parameter error. Possible causes: <br> 1. Incorrect parameter types. <br> 2. Parameter verification failed. | 572| 24000001 | The ASSET service is unavailable. | 573| 24000002 | The asset is not found. | 574| 24000004 | Access denied. | 575| 24000005 | The screen lock status does not match. | 576| 24000006 | Insufficient memory. | 577| 24000007 | The asset is corrupted. | 578| 24000008 | The database operation failed. | 579| 24000009 | The cryptography operation failed. | 580| 24000010 | IPC failed. | 581| 24000011 | Calling the Bundle Manager service failed. | 582| 24000012 | Calling the OS Account service failed. | 583| 24000013 | Calling the Access Token service failed. | 584| 24000017 | The capability is not supported. | 585 586**Example** 587 588```typescript 589import { asset } from '@kit.AssetStoreKit'; 590import { util } from '@kit.ArkTS'; 591import { BusinessError } from '@kit.BasicServicesKit'; 592 593function stringToArray(str: string): Uint8Array { 594 let textEncoder = new util.TextEncoder(); 595 return textEncoder.encodeInto(str); 596} 597 598let query: asset.AssetMap = new Map(); 599query.set(asset.Tag.ALIAS, stringToArray('demo_alias')); 600try { 601 asset.query(query).then((res: Array<asset.AssetMap>) => { 602 for (let i = 0; i < res.length; i++) { 603 // parse the attribute. 604 let accessibility: number = res[i].get(asset.Tag.ACCESSIBILITY) as number; 605 } 606 console.info(`Asset query succeeded.`); 607 }).catch ((err: BusinessError) => { 608 console.error(`Failed to query Asset. Code is ${err.code}, message is ${err.message}`); 609 }); 610} catch (error) { 611 let err = error as BusinessError; 612 console.error(`Failed to query Asset. Code is ${err.code}, message is ${err.message}`); 613} 614``` 615 616## asset.querySync<sup>12+</sup> 617 618querySync(query: AssetMap): Array\<AssetMap> 619 620Queries one or more assets. If user authentication is required for the access to the asset, call [asset.preQuerySync](#assetprequerysync12) before this API and call [asset.postQuerySync](#assetpostquerysync12) after this API. For details about the development procedure, see [Querying an Asset with User Authentication](../../security/AssetStoreKit/asset-js-query-auth.md). This API returns the result synchronously. 621 622**Atomic service API**: This API can be used in atomic services since API version 14. 623 624**System capability**: SystemCapability.Security.Asset 625 626**Parameters** 627 628| Name | Type | Mandatory| Description | 629| -------- | ------------------------------- | ---- | ------------------------------------------------------------ | 630| query | [AssetMap](#assetmap) | Yes | Attributes of the asset to query, such as the asset alias, access control attributes, and custom data. | 631 632**Return value** 633 634| Type | Description | 635| ------------------------ | ------------------------------------- | 636| Array\<AssetMap> | Array of query results.| 637 638**Error codes** 639 640For details about the error codes, see [Asset Store Service Error Codes](errorcode-asset.md). 641 642| ID| Error Message | 643| -------- | ---------------------------------------------------------- | 644| 401 | Parameter error. Possible causes: <br> 1. Incorrect parameter types. <br> 2. Parameter verification failed. | 645| 24000001 | The ASSET service is unavailable. | 646| 24000002 | The asset is not found. | 647| 24000004 | Access denied. | 648| 24000005 | The screen lock status does not match. | 649| 24000006 | Insufficient memory. | 650| 24000007 | The asset is corrupted. | 651| 24000008 | The database operation failed. | 652| 24000009 | The cryptography operation failed. | 653| 24000010 | IPC failed. | 654| 24000011 | Calling the Bundle Manager service failed. | 655| 24000012 | Calling the OS Account service failed. | 656| 24000013 | Calling the Access Token service failed. | 657| 24000017 | The capability is not supported. | 658 659**Example** 660 661```typescript 662import { asset } from '@kit.AssetStoreKit'; 663import { util } from '@kit.ArkTS'; 664import { BusinessError } from '@kit.BasicServicesKit'; 665 666function stringToArray(str: string): Uint8Array { 667 let textEncoder = new util.TextEncoder(); 668 return textEncoder.encodeInto(str); 669} 670 671let query: asset.AssetMap = new Map(); 672query.set(asset.Tag.ALIAS, stringToArray('demo_alias')); 673try { 674 let res: Array<asset.AssetMap> = asset.querySync(query); 675 let accessibility: number; 676 for (let i = 0; i < res.length; i++) { 677 // parse the attribute. 678 if (res[i] != null) { 679 accessibility = res[i].get(asset.Tag.ACCESSIBILITY) as number; 680 } 681 } 682} catch (error) { 683 let err = error as BusinessError; 684 console.error(`Failed to query Asset. Code is ${err.code}, message is ${err.message}`); 685} 686``` 687 688## asset.postQuery 689 690postQuery(handle: AssetMap): Promise\<void> 691 692Performs postprocessing for the asset query. This API is used when user authentication is required for the access to the asset. This API must be used with [asset.preQuery](#assetprequery) together. This API uses a promise to return the result. 693 694**Atomic service API**: This API can be used in atomic services since API version 14. 695 696**System capability**: SystemCapability.Security.Asset 697 698**Parameters** 699 700| Name| Type | Mandatory| Description | 701| ------ | -------- | ---- | ------------------------------------------------------------ | 702| handle | [AssetMap](#assetmap) | Yes | Handle of the query operation, including the challenge value returned by [asset.preQuery](#assetprequery).| 703 704**Return value** 705 706| Type | Description | 707| ------------- | ----------------------- | 708| Promise\<void> | Promise that returns no value.| 709 710**Error codes** 711 712For details about the error codes, see [Asset Store Service Error Codes](errorcode-asset.md). 713 714| ID| Error Message | 715| -------- | ---------------------------------------------------------- | 716| 401 | Parameter error. Possible causes: <br> 1. Mandatory parameters are left unspecified. <br> 2. Incorrect parameter types. <br> 3. Parameter verification failed. | 717| 24000001 | The ASSET service is unavailable. | 718| 24000006 | Insufficient memory. | 719| 24000010 | IPC failed. | 720| 24000011 | Calling the Bundle Manager service failed. | 721| 24000012 | Calling the OS Account service failed. | 722| 24000013 | Calling the Access Token service failed. | 723 724**Example** 725 726```typescript 727import { asset } from '@kit.AssetStoreKit'; 728import { BusinessError } from '@kit.BasicServicesKit'; 729 730let handle: asset.AssetMap = new Map(); 731// The new Uint8Array(32) is only an example. Pass in the challenge value returned by asset.preQuery. 732handle.set(asset.Tag.AUTH_CHALLENGE, new Uint8Array(32)); 733try { 734 asset.postQuery(handle).then(() => { 735 console.info(`Succeeded in post-querying Asset.`); 736 }).catch ((err: BusinessError) => { 737 console.error(`Failed to post-query Asset. Code is ${err.code}, message is ${err.message}`); 738 }); 739} catch (error) { 740 let err = error as BusinessError; 741 console.error(`Failed to post-query Asset. Code is ${err.code}, message is ${err.message}`); 742} 743``` 744 745## asset.postQuerySync<sup>12+</sup> 746 747postQuerySync(handle: AssetMap): void 748 749Performs postprocessing for the asset query. This API is used when user authentication is required for the access to the asset. This API must be used with [asset.preQuerySync](#assetprequerysync12) together. This API returns the result synchronously. 750 751**Atomic service API**: This API can be used in atomic services since API version 14. 752 753**System capability**: SystemCapability.Security.Asset 754 755**Parameters** 756 757| Name| Type | Mandatory| Description | 758| ------ | -------- | ---- | ------------------------------------------------------------ | 759| handle | [AssetMap](#assetmap) | Yes | Handle of the query operation, including the challenge value returned by [asset.preQuerySync](#assetprequerysync12).| 760 761**Error codes** 762 763For details about the error codes, see [Asset Store Service Error Codes](errorcode-asset.md). 764 765| ID| Error Message | 766| -------- | ---------------------------------------------------------- | 767| 401 | Parameter error. Possible causes: <br> 1. Mandatory parameters are left unspecified. <br> 2. Incorrect parameter types. <br> 3. Parameter verification failed. | 768| 24000001 | The ASSET service is unavailable. | 769| 24000006 | Insufficient memory. | 770| 24000010 | IPC failed. | 771| 24000011 | Calling the Bundle Manager service failed. | 772| 24000012 | Calling the OS Account service failed. | 773| 24000013 | Calling the Access Token service failed. | 774 775**Example** 776 777```typescript 778import { asset } from '@kit.AssetStoreKit'; 779import { BusinessError } from '@kit.BasicServicesKit'; 780 781let handle: asset.AssetMap = new Map(); 782// The new Uint8Array(32) is only an example. Pass in the challenge value returned by asset.preQuerySync. 783handle.set(asset.Tag.AUTH_CHALLENGE, new Uint8Array(32)); 784try { 785 asset.postQuerySync(handle) 786} catch (error) { 787 let err = error as BusinessError; 788 console.error(`Failed to post-query Asset. Code is ${err.code}, message is ${err.message}`); 789} 790``` 791 792## asset.querySyncResult<sup>20+</sup> 793 794querySyncResult(query: AssetMap): Promise\<SyncResult> 795 796Queries the result of the sync operation. This API uses a promise to return the result. 797 798**System capability**: SystemCapability.Security.Asset 799 800**Parameters** 801 802| Name| Type | Mandatory| Description | 803| ------ | -------- | ---- | ------------------------------------------------------------ | 804| query | [AssetMap](#assetmap) | Yes | Attributes of the sync result to query, such as the group to which the asset belongs and whether the custom attribute information is encrypted.| 805 806**Return value** 807 808| Type | Description | 809| ------------- | ----------------------- | 810| Promise\<[SyncResult](#syncresult20)> | Promise used to return the result.| 811 812**Error codes** 813 814For details about the error codes, see [Asset Store Service Error Codes](errorcode-asset.md). 815 816| ID| Error Message | 817| -------- | ---------------------------------------------------------- | 818| 24000001 | The ASSET service is unavailable. | 819| 24000006 | Insufficient memory. | 820| 24000010 | IPC failed. | 821| 24000011 | Calling the Bundle Manager service failed. | 822| 24000012 | Calling the OS Account service failed. | 823| 24000013 | Calling the Access Token service failed. | 824| 24000014 | The file operation failed. | 825| 24000018 | Parameter verification failed. | 826 827**Example** 828 829```typescript 830import { asset } from '@kit.AssetStoreKit'; 831import { BusinessError } from '@kit.BasicServicesKit'; 832 833let query: asset.AssetMap = new Map(); 834asset.querySyncResult(query).then((res: asset.SyncResult) => { 835 console.info(`sync result: ${JSON.stringify(res)}`); 836}).catch ((err: BusinessError) => { 837 console.error(`Failed to query sync result of Asset. Code is ${err.code}, message is ${err.message}`); 838}); 839``` 840 841## TagType 842 843Enumerates the asset attribute types. 844 845**Atomic service API**: This API can be used in atomic services since API version 14. 846 847**System capability**: SystemCapability.Security.Asset 848 849| Name | Value | Description | 850| ------ | ---------- | ---------------------------------------- | 851| BOOL | 0x01 << 28 | Boolean. | 852| NUMBER | 0x02 << 28 | Number. | 853| BYTES | 0x03 << 28 | Byte array.| 854 855## Tag 856 857Enumerate the keys of asset attributes ([AssetMap](#assetmap)), which are in key-value (KV) pairs. 858 859**System capability**: SystemCapability.Security.Asset 860 861> **NOTE** 862> 863> The following table lists all enums of **Tag**. The specific tags and the value range of tag values vary with the API you use. For details, see [Introduction to Asset Store Kit](../../security/AssetStoreKit/asset-store-kit-overview.md). 864 865| Name| Value | Description | 866| ------------------------- | ------------------------------------------------------------ | ------------------------------------------------------------ | 867| SECRET | TagType.BYTES | 0x01 | Asset plaintext.<br>**Atomic service API**: This API can be used in atomic services since API version 14. | 868| ALIAS | TagType.BYTES | 0x02 | Asset alias, which uniquely identifies an asset.<br>**Atomic service API**: This API can be used in atomic services since API version 14. | 869| ACCESSIBILITY | TagType.NUMBER | 0x03 | Access control based on the lock screen status.<br>**Atomic service API**: This API can be used in atomic services since API version 14. | 870| REQUIRE_PASSWORD_SET | TagType.BOOL | 0x04 | Whether the asset is accessible only when a lock screen password is set.<br>**Atomic service API**: This API can be used in atomic services since API version 14. | 871| AUTH_TYPE | TagType.NUMBER | 0x05 | Type of user authentication required for accessing the asset.<br>**Atomic service API**: This API can be used in atomic services since API version 14. | 872| AUTH_VALIDITY_PERIOD | TagType.NUMBER | 0x06 | Validity period of the user authentication.<br>**Atomic service API**: This API can be used in atomic services since API version 14. | 873| AUTH_CHALLENGE | TagType.BYTES | 0x07 | Challenge for the user authentication.<br>**Atomic service API**: This API can be used in atomic services since API version 14. | 874| AUTH_TOKEN | TagType.BYTES | 0x08 | Authorization token obtained after the user authentication is successful.<br>**Atomic service API**: This API can be used in atomic services since API version 14. | 875| SYNC_TYPE | TagType.NUMBER | 0x10 | Asset sync type.<br>**Atomic service API**: This API can be used in atomic services since API version 14. | 876| IS_PERSISTENT | TagType.BOOL | 0x11 | Whether to retain the asset when the application is uninstalled.| 877| DATA_LABEL_CRITICAL_1 | TagType.BYTES | 0x20 | Additional asset data customized by the service with integrity protection.<br>**Atomic service API**: This API can be used in atomic services since API version 14. | 878| DATA_LABEL_CRITICAL_2 | TagType.BYTES | 0x21 | Additional asset data customized by the service with integrity protection.<br>**Atomic service API**: This API can be used in atomic services since API version 14.| 879| DATA_LABEL_CRITICAL_3 | TagType.BYTES | 0x22 | Additional asset data customized by the service with integrity protection.<br>**Atomic service API**: This API can be used in atomic services since API version 14.| 880| DATA_LABEL_CRITICAL_4 | TagType.BYTES | 0x23 | Additional asset data customized by the service with integrity protection.<br>**Atomic service API**: This API can be used in atomic services since API version 14.| 881| DATA_LABEL_NORMAL_1 | TagType.BYTES | 0x30 | Additional asset data customized by the service without integrity protection.<br>**Atomic service API**: This API can be used in atomic services since API version 14. | 882| DATA_LABEL_NORMAL_2 | TagType.BYTES | 0x31 | Additional asset data customized by the service without integrity protection.<br>**Atomic service API**: This API can be used in atomic services since API version 14.| 883| DATA_LABEL_NORMAL_3 | TagType.BYTES | 0x32 | Additional asset data customized by the service without integrity protection.<br>**Atomic service API**: This API can be used in atomic services since API version 14.| 884| DATA_LABEL_NORMAL_4 | TagType.BYTES | 0x33 | Additional asset data customized by the service without integrity protection.<br>**Atomic service API**: This API can be used in atomic services since API version 14.| 885| DATA_LABEL_NORMAL_LOCAL_1<sup>12+</sup> | TagType.BYTES | 0x34 | Local information about the asset. The value is assigned by the service without integrity protection and will not be synced.<br>**Atomic service API**: This API can be used in atomic services since API version 14.| 886| DATA_LABEL_NORMAL_LOCAL_2<sup>12+</sup> | TagType.BYTES | 0x35 | Local information about the asset. The value is assigned by the service without integrity protection and will not be synced.<br>**Atomic service API**: This API can be used in atomic services since API version 14.| 887| DATA_LABEL_NORMAL_LOCAL_3<sup>12+</sup> | TagType.BYTES | 0x36 | Local information about the asset. The value is assigned by the service without integrity protection and will not be synced.<br>**Atomic service API**: This API can be used in atomic services since API version 14.| 888| DATA_LABEL_NORMAL_LOCAL_4<sup>12+</sup> | TagType.BYTES | 0x37 | Local information about the asset. The value is assigned by the service without integrity protection and will not be synced.<br>**Atomic service API**: This API can be used in atomic services since API version 14.| 889| RETURN_TYPE | TagType.NUMBER | 0x40 | Type of the asset query result to return.<br>**Atomic service API**: This API can be used in atomic services since API version 14. | 890| RETURN_LIMIT | TagType.NUMBER | 0x41 | Maximum number of asset records to return.<br>**Atomic service API**: This API can be used in atomic services since API version 14. | 891| RETURN_OFFSET | TagType.NUMBER | 0x42 | Offset of the asset query result.<br>**NOTE**: This parameter specifies the starting asset record to return in batch asset query.<br>**Atomic service API**: This API can be used in atomic services since API version 14. | 892| RETURN_ORDERED_BY | TagType.NUMBER | 0x43 | Sorting order of the query results. Currently, the results can be sorted only by **ASSET_TAG_DATA_LABEL**.<br>**NOTE**: By default, assets are returned in the order in which they are added.<br>**Atomic service API**: This API can be used in atomic services since API version 14.| 893| CONFLICT_RESOLUTION | TagType.NUMBER | 0x44 | Policy for resolving the conflict (for example, a duplicate alias).<br>**Atomic service API**: This API can be used in atomic services since API version 14. | 894| UPDATE_TIME<sup>12+</sup> | TagType.BYTES | 0x45 | Data update time, in timestamp.<br>**Atomic service API**: This API can be used in atomic services since API version 14.| 895| OPERATION_TYPE<sup>12+</sup> | TagType.NUMBER | 0x46 | Additional operation type.| 896| REQUIRE_ATTR_ENCRYPTED<sup>14+</sup> | TagType.BOOL | 0x47 | Whether to encrypt the additional asset information customized by the service.<br>**Atomic service API**: This API can be used in atomic services since API version 14.| 897| GROUP_ID<sup>18+</sup> | TagType.BYTES | 0x48 | Group to which the asset belongs.<br>| 898| WRAP_TYPE<sup>18+</sup> | TagType.NUMBER | 0x49 | Encrypted import/export type supported by the asset.<br>| 899 900## Value 901 902type Value = boolean | number | Uint8Array 903 904Represents the value of each attribute in [AssetMap](#assetmap). 905 906**Atomic service API**: This API can be used in atomic services since API version 14. 907 908**System capability**: SystemCapability.Security.Asset 909 910| Type | Description | 911| ------- | ------------------------------------------------| 912| boolean | The value is a Boolean value, that is, **true** or **false**. | 913| number | The value is a number. It can be an enumerated value or a numeric value.| 914| Uint8Array | The value is a byte array, and the content is defined by the service. | 915 916## AssetMap 917 918type AssetMap = Map\<Tag, Value> 919 920Represents a set of asset attributes in the form of KV pairs. 921 922**Atomic service API**: This API can be used in atomic services since API version 14. 923 924**System capability**: SystemCapability.Security.Asset 925 926| Type | Description | 927| ---------------- | ------------------------------------------------------------------| 928| Map\<Tag, Value> | The value type is Map. For details about the range of the KV pair, see [Tag](#tag) and [Value](#value).| 929 930## Accessibility 931 932Enumerates the types of access control based on the lock screen status. 933 934**Atomic service API**: This API can be used in atomic services since API version 14. 935 936**System capability**: SystemCapability.Security.Asset 937 938| Name | Value | Description | 939| --------------------- | ---- | ------------------------------------------------------------ | 940| DEVICE_POWERED_ON | 0 | The asset can be accessed after the device is powered on. | 941| DEVICE_FIRST_UNLOCKED | 1 | The asset can be accessed only after the device is unlocked for the first time.<br>**NOTE**: If no lock screen password is set, this option is equivalent to **DEVICE_POWERED_ON**.| 942| DEVICE_UNLOCKED | 2 | The asset can be accessed only when the device is unlocked.<br>**NOTE**: If no lock screen password is set, this option is equivalent to **DEVICE_POWERED_ON**.| 943 944## AuthType 945 946Enumerates the types of user authentication supported by an asset. 947 948**Atomic service API**: This API can be used in atomic services since API version 14. 949 950**System capability**: SystemCapability.Security.Asset 951 952| Name| Value | Description | 953| ---- | ---- | ------------------------------------------------------------ | 954| NONE | 0x00 | No user authentication is required before the asset is accessed. | 955| ANY | 0xFF | The asset can be accessed if any user authentication (such as PIN, facial, or fingerprint authentication) is successful.| 956 957## SyncType 958 959Enumerates the sync types supported by an asset. 960 961> **NOTE** 962> 963> This field is an embedded parameter. Currently, asset sync is not supported. 964 965**Atomic service API**: This API can be used in atomic services since API version 14. 966 967**System capability**: SystemCapability.Security.Asset 968 969| Name | Value | Description | 970| ----------------------------- | ------ | ------------------------------------------------ | 971| NEVER | 0 | Asset sync is not allowed. | 972| THIS_DEVICE | 1 << 0 | Asset sync is allowed only on the local device, for example, in data restore on the local device.| 973| TRUSTED_DEVICE | 1 << 1 | Asset sync is allowed only between trusted devices, for example, in the case of cloning. | 974| TRUSTED_ACCOUNT<sup>12+</sup> | 1 << 2 | Asset sync is allowed only between the devices that are logged in with trusted accounts, for example, in cloud sync scenarios.| 975 976## ReturnType 977 978Enumerates the type of information returned by an asset query operation. 979 980**Atomic service API**: This API can be used in atomic services since API version 14. 981 982**System capability**: SystemCapability.Security.Asset 983 984| Name | Value | Description | 985| ---------- | ---- | ------------------------------------------------------------ | 986| ALL | 0 | The query result contains the asset in plaintext and its attributes.<br>**NOTE**: Use this option when you need to query the plaintext of a single asset.| 987| ATTRIBUTES | 1 | The query result contains only the asset attributes.<br>**NOTE**: Use this option when you need to query attributes of multiple assets.| 988 989## ConflictResolution 990 991Enumerates the policies for resolving conflicts (for example, a duplicate alias) when an asset is added. 992 993**Atomic service API**: This API can be used in atomic services since API version 14. 994 995**System capability**: SystemCapability.Security.Asset 996 997| Name | Value | Description | 998| ----------- | ---- | ---------------------------- | 999| OVERWRITE | 0 | Overwrite the original asset. | 1000| THROW_ERROR | 1 | Throw an exception for the service to perform subsequent processing.| 1001 1002## OperationType<sup>12+</sup> 1003 1004Enumerates the types of additional operation to perform. 1005 1006**System capability**: SystemCapability.Security.Asset 1007 1008| Name | Value | Description | 1009| ----------- | ---- | ------------------ | 1010| NEED_SYNC | 0 | Sync.| 1011| NEED_LOGOUT | 1 | Logout.| 1012 1013## WrapType<sup>18+</sup> 1014 1015Enumerates the encrypted import/export types supported by the asset. 1016 1017**System capability**: SystemCapability.Security.Asset 1018 1019| Name | Value | Description | 1020| ----------- | ---- | ------------------ | 1021| NEVER | 0 | Encrypted import/export is not allowed for the asset.| 1022| TRUSTED_ACCOUNT | 1 | Encrypted import/export is allowed for the asset only on devices where a trusted account is logged in.| 1023 1024## SyncResult<sup>20+</sup> 1025 1026Represents the sync result of an asset. 1027 1028**System capability**: SystemCapability.Security.Asset 1029 1030| Name | Type | Read-Only| Optional|Description | 1031| ----------- | ---- | ---- | ---- | ------------------ | 1032| resultCode | number | Yes| No| Sync result code of an asset. If the sync is successful, the result code is **0**. If the sync fails, see [ErrorCode](#errorcode) for the result code.| 1033| totalCount | number | Yes| Yes| Total number of assets to be synced.| 1034| failedCount | number | Yes| Yes| Number of assets that fail to be synced.| 1035 1036## ErrorCode 1037 1038Enumerates the error codes. 1039 1040**System capability**: SystemCapability.Security.Asset 1041 1042| Name | Value | Description| 1043| -------------------------- | ----- | ---- | 1044| PERMISSION_DENIED | 201 |The caller does not have the permission.| 1045| NOT_SYSTEM_APPLICATION<sup>12+</sup> | 202 |The caller is not a system application.| 1046| INVALID_ARGUMENT | 401 |Incorrect parameters are detected.<br>**Atomic service API**: This API can be used in atomic services since API version 14.| 1047| SERVICE_UNAVAILABLE | 24000001 |The asset service is unavailable.<br>**Atomic service API**: This API can be used in atomic services since API version 14.| 1048| NOT_FOUND | 24000002 |Failed to find the asset.<br>**Atomic service API**: This API can be used in atomic services since API version 14.| 1049| DUPLICATED | 24000003 |The specified asset already exists.<br>**Atomic service API**: This API can be used in atomic services since API version 14.| 1050| ACCESS_DENIED | 24000004 |The access to the asset is denied.<br>**Atomic service API**: This API can be used in atomic services since API version 14.| 1051| STATUS_MISMATCH | 24000005 |The screen lock status does not match.<br>**Atomic service API**: This API can be used in atomic services since API version 14.| 1052| OUT_OF_MEMORY | 24000006 |The system memory is insufficient.<br>**Atomic service API**: This API can be used in atomic services since API version 14.| 1053| DATA_CORRUPTED | 24000007 |The asset is corrupted.<br>**Atomic service API**: This API can be used in atomic services since API version 14.| 1054| DATABASE_ERROR | 24000008 |The database operation failed.<br>**Atomic service API**: This API can be used in atomic services since API version 14.| 1055| CRYPTO_ERROR | 24000009 |The crypto operation failed.<br>**Atomic service API**: This API can be used in atomic services since API version 14.| 1056| IPC_ERROR | 24000010 |IPC failed.<br>**Atomic service API**: This API can be used in atomic services since API version 14.| 1057| BMS_ERROR | 24000011 |The Bundle Manager service is abnormal.<br>**Atomic service API**: This API can be used in atomic services since API version 14.| 1058| ACCOUNT_ERROR | 24000012 |The account service is abnormal.<br>**Atomic service API**: This API can be used in atomic services since API version 14.| 1059| ACCESS_TOKEN_ERROR | 24000013 |The Access Token service is abnormal.<br>**Atomic service API**: This API can be used in atomic services since API version 14.| 1060| FILE_OPERATION_ERROR | 24000014 |The file operation failed.<br>**Atomic service API**: This API can be used in atomic services since API version 14.| 1061| GET_SYSTEM_TIME_ERROR | 24000015 |Failed to obtain the system time.<br>**Atomic service API**: This API can be used in atomic services since API version 14.| 1062| LIMIT_EXCEEDED | 24000016 |The number of cached records exceeds the upper limit.<br>**Atomic service API**: This API can be used in atomic services since API version 14.| 1063| UNSUPPORTED | 24000017 |The feature is not supported.<br>**Atomic service API**: This API can be used in atomic services since API version 14.| 1064| PARAM_VERIFICATION_FAILED<sup>20+</sup> | 24000018 |Parameter verification failed.<br>**Atomic service API**: This API can be used in atomic services since API version 20.| 1065