1e41f4b71Sopenharmony_ci# @ohos.enterprise.deviceInfo (Device Information Management) 2e41f4b71Sopenharmony_ci 3e41f4b71Sopenharmony_ciThe **deviceInfo** module provides APIs for enterprise device information management, including the API for obtaining device serial numbers. 4e41f4b71Sopenharmony_ci 5e41f4b71Sopenharmony_ci> **NOTE** 6e41f4b71Sopenharmony_ci> 7e41f4b71Sopenharmony_ci> The initial APIs of this module are supported since API version 12. Newly added APIs will be marked with a superscript to indicate their earliest API version. 8e41f4b71Sopenharmony_ci> 9e41f4b71Sopenharmony_ci> The APIs of this module can be used only in the stage model. 10e41f4b71Sopenharmony_ci> 11e41f4b71Sopenharmony_ci> The APIs of this module can be called only by a [device administrator application](../../mdm/mdm-kit-guide.md#introduction) that is enabled. 12e41f4b71Sopenharmony_ci 13e41f4b71Sopenharmony_ci## Modules to Import 14e41f4b71Sopenharmony_ci 15e41f4b71Sopenharmony_ci```ts 16e41f4b71Sopenharmony_ciimport { deviceInfo } from '@kit.MDMKit'; 17e41f4b71Sopenharmony_ci``` 18e41f4b71Sopenharmony_ci 19e41f4b71Sopenharmony_ci## deviceInfo.getDeviceInfo 20e41f4b71Sopenharmony_ci 21e41f4b71Sopenharmony_cigetDeviceInfo(admin: Want, label: string): string 22e41f4b71Sopenharmony_ci 23e41f4b71Sopenharmony_ciObtains device information. 24e41f4b71Sopenharmony_ci 25e41f4b71Sopenharmony_ci**Required permissions**: ohos.permission.ENTERPRISE_GET_DEVICE_INFO 26e41f4b71Sopenharmony_ci 27e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Customization.EnterpriseDeviceManager 28e41f4b71Sopenharmony_ci 29e41f4b71Sopenharmony_ci**Parameters** 30e41f4b71Sopenharmony_ci 31e41f4b71Sopenharmony_ci| Name| Type | Mandatory| Description | 32e41f4b71Sopenharmony_ci| ------ | ------------------------------------------------------- | ---- | ------------------------------------------------------------ | 33e41f4b71Sopenharmony_ci| admin | [Want](../apis-ability-kit/js-apis-app-ability-want.md) | Yes | Device administrator application. | 34e41f4b71Sopenharmony_ci| label | string | Yes | Device information to obtain.<br>- **deviceName**: device name.<br>- **deviceSerial**: device serial number.<br>- **simInfo**: SIM card information.<!--RP1--><!--RP1End-->| 35e41f4b71Sopenharmony_ci 36e41f4b71Sopenharmony_ci**Return value** 37e41f4b71Sopenharmony_ci 38e41f4b71Sopenharmony_ci| Type | Description | 39e41f4b71Sopenharmony_ci| ------ | ------------------------------------------------------------ | 40e41f4b71Sopenharmony_ci| string | Device information obtained.<br>If **label** is **simInfo**, the return value is the SIM card information in a JSON string.<br/>Example:<br/>[{"slotId": 0, "MEID": "", "IMSI": "", "ICCID": "", "IMEI": ""}, {"slotId": 1, "MEID": "", "IMSI": "", "ICCID": "", "IMEI": ""}] <br>In this example, **slotId:0** indicates slot 1, and **slotId:1** indicates slot 2. | 41e41f4b71Sopenharmony_ci 42e41f4b71Sopenharmony_ci**Error codes** 43e41f4b71Sopenharmony_ci 44e41f4b71Sopenharmony_ciFor details about the error codes, see [Enterprise Device Management Error Codes](errorcode-enterpriseDeviceManager.md) and [Universal Error Codes](../errorcode-universal.md). 45e41f4b71Sopenharmony_ci 46e41f4b71Sopenharmony_ci| ID| Error Message | 47e41f4b71Sopenharmony_ci| -------- | ------------------------------------------------------------ | 48e41f4b71Sopenharmony_ci| 9200001 | The application is not an administrator application of the device. | 49e41f4b71Sopenharmony_ci| 9200002 | The administrator application does not have permission to manage the device. | 50e41f4b71Sopenharmony_ci| 201 | Permission verification failed. The application does not have the permission required to call the API. | 51e41f4b71Sopenharmony_ci| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. | 52e41f4b71Sopenharmony_ci 53e41f4b71Sopenharmony_ci**Example** 54e41f4b71Sopenharmony_ci 55e41f4b71Sopenharmony_ci```ts 56e41f4b71Sopenharmony_ciimport { Want } from '@kit.AbilityKit'; 57e41f4b71Sopenharmony_cilet wantTemp: Want = { 58e41f4b71Sopenharmony_ci bundleName: 'com.example.myapplication', 59e41f4b71Sopenharmony_ci abilityName: 'EntryAbility', 60e41f4b71Sopenharmony_ci}; 61e41f4b71Sopenharmony_ci 62e41f4b71Sopenharmony_citry { 63e41f4b71Sopenharmony_ci let result: string = deviceInfo.getDeviceInfo(wantTemp, 'deviceName'); 64e41f4b71Sopenharmony_ci console.info(`Succeeded in getting device name, result : ${result}`); 65e41f4b71Sopenharmony_ci} catch (err) { 66e41f4b71Sopenharmony_ci console.error(`Failed to get device name. Code: ${err.code}, message: ${err.message}`); 67e41f4b71Sopenharmony_ci} 68e41f4b71Sopenharmony_ci``` 69