创建 androidForWorkEnrollmentProfileCreate androidForWorkEnrollmentProfile
2020/11/19
本文内容
命名空间:microsoft.graphNamespace: microsoft.graph
重要说明: /Beta 版本下的 Microsoft Graph Api 可能会发生更改;不支持生产使用。Important: Microsoft Graph APIs under the /beta version are subject to change; production use is not supported.
注意: 适用于 Intune 的 Microsoft Graph API 需要适用于租户的 活动 Intune 许可证。Note: The Microsoft Graph API for Intune requires an active Intune license for the tenant.
先决条件Prerequisites
要调用此 API,需要以下权限之一。要了解详细信息,包括如何选择权限的信息,请参阅权限。One of the following permissions is required to call this API. To learn more, including how to choose permissions, see Permissions.
权限类型Permission type
权限(从最高特权到最低特权)Permissions (from most to least privileged)
委派(工作或学校帐户)Delegated (work or school account)
DeviceManagementConfiguration.ReadWrite.AllDeviceManagementConfiguration.ReadWrite.All
委派(个人 Microsoft 帐户)Delegated (personal Microsoft account)
不支持。Not supported.
应用程序Application
DeviceManagementConfiguration.ReadWrite.AllDeviceManagementConfiguration.ReadWrite.All
HTTP 请求HTTP Request
POST /deviceManagement/androidForWorkEnrollmentProfiles
请求标头Request headers
标头Header
值Value
AuthorizationAuthorization
Bearer 。必需。Bearer Required.
接受Accept
application/jsonapplication/json
请求正文Request body
在请求正文中,提供 androidForWorkEnrollmentProfile 对象的 JSON 表示形式。In the request body, supply a JSON representation for the androidForWorkEnrollmentProfile object.
下表显示创建 androidForWorkEnrollmentProfile 时所需的属性。The following table shows the properties that are required when you create the androidForWorkEnrollmentProfile.
属性Property
类型Type
描述Description
accountIdaccountId
StringString
注册配置文件隶属的租户 GUID。Tenant GUID the enrollment profile belongs to.
idid
StringString
注册配置文件的唯一 GUID。Unique GUID for the enrollment profile.
displayNamedisplayName
StringString
注册配置文件的显示名称。Display name for the enrollment profile.
descriptiondescription
StringString
注册配置文件的说明。Description for the enrollment profile.
createdDateTimecreatedDateTime
DateTimeOffsetDateTimeOffset
注册配置文件的创建日期/时间。Date time the enrollment profile was created.
lastModifiedDateTimelastModifiedDateTime
DateTimeOffsetDateTimeOffset
上次修改注册配置文件的日期/时间。Date time the enrollment profile was last modified.
tokenValuetokenValue
StringString
为此注册配置文件最新创建的令牌的值。Value of the most recently created token for this enrollment profile.
tokenExpirationDateTimetokenExpirationDateTime
DateTimeOffsetDateTimeOffset
最新创建的令牌的到期日期/时间。Date time the most recently created token will expire.
enrolledDeviceCountenrolledDeviceCount
Int32Int32
已使用此注册配置文件进行注册的 Android 设备总数。Total number of Android devices that have enrolled using this enrollment profile.
qrCodeContentqrCodeContent
StringString
用于生成此令牌的 QR 码的字符串。String used to generate a QR code for the token.
qrCodeImageqrCodeImage
用于生成此令牌的 QR 码的字符串。String used to generate a QR code for the token.
响应Response
如果成功,此方法在响应正文中返回 201 Created 响应代码和 androidForWorkEnrollmentProfile 对象。If successful, this method returns a 201 Created response code and a androidForWorkEnrollmentProfile object in the response body.
示例Example
请求Request
下面是一个请求示例。Here is an example of the request.
POST https://graph.microsoft.com/beta/deviceManagement/androidForWorkEnrollmentProfiles
Content-type: application/json
Content-length: 496
{
"@odata.type": "#microsoft.graph.androidForWorkEnrollmentProfile",
"accountId": "Account Id value",
"displayName": "Display Name value",
"description": "Description value",
"tokenValue": "Token Value value",
"tokenExpirationDateTime": "2016-12-31T23:59:54.0590989-08:00",
"enrolledDeviceCount": 3,
"qrCodeContent": "Qr Code Content value",
"qrCodeImage": {
"@odata.type": "microsoft.graph.mimeContent",
"type": "Type value",
"value": "dmFsdWU="
}
}
响应Response
下面是一个响应示例。注意:为了简单起见,可能会将此处所示的响应对象截断。将从实际调用中返回所有属性。Here is an example of the response. Note: The response object shown here may be truncated for brevity. All of the properties will be returned from an actual call.
HTTP/1.1 201 Created
Content-Type: application/json
Content-Length: 668
{
"@odata.type": "#microsoft.graph.androidForWorkEnrollmentProfile",
"accountId": "Account Id value",
"id": "e6742553-2553-e674-5325-74e6532574e6",
"displayName": "Display Name value",
"description": "Description value",
"createdDateTime": "2017-01-01T00:02:43.5775965-08:00",
"lastModifiedDateTime": "2017-01-01T00:00:35.1329464-08:00",
"tokenValue": "Token Value value",
"tokenExpirationDateTime": "2016-12-31T23:59:54.0590989-08:00",
"enrolledDeviceCount": 3,
"qrCodeContent": "Qr Code Content value",
"qrCodeImage": {
"@odata.type": "microsoft.graph.mimeContent",
"type": "Type value",
"value": "dmFsdWU="
}
}