获取设备批上传的状态
适用于:合作伙伴中心
如何获取指定客户的设备批上传状态。
相应的角色:全局管理员 | 管理代理 | 销售代理
先决条件
合作伙伴中心身份验证中所述的凭据。 此方案支持使用独立应用和 App+User 凭据进行身份验证。
客户 ID (
customer-tenant-id
)。 如果不知道客户的 ID,可以通过选择“客户”工作区,然后从客户列表中选择客户,然后选择“帐户”,在合作伙伴中心中查找该 ID。 在客户的“帐户”页上的“客户帐户信息”部分查找 Microsoft ID。 Microsoft ID 与客户 ID (customer-tenant-id
) 相同。提交设备批处理时在 Location 标头中返回的批跟踪标识符。 有关详细信息,请参阅 上传指定客户的设备列表。
C#
若要获取设备批处理上传的状态,请先调用 具有客户 ID 的 IAggregatePartner.Customers.ById 方法,以检索指向指定客户的操作的接口。 然后,使用批处理跟踪 ID 调用 BatchUploadStatus.ById 方法,以获取批处理上传状态操作的接口。 最后,调用 Get 或 GetAsync 方法以检索状态。
// IAggregatePartner partnerOperations;
// string selectedCustomerId;
// string selectedTrackingId;
var status =
partnerOperations.Customers.ById(selectedCustomerId).BatchUploadStatus.ById(selectedTrackingId).Get();
示例: 控制台测试应用。 项目:合作伙伴中心 SDK 示例 类:GetBatchUploadStatus.cs
REST 请求
请求语法
方法 | 请求 URI |
---|---|
GET | {baseURL}/v1/customers/{customer-id}/batchJobStatus/{batchtracking-id} HTTP/1.1 |
URI 参数
创建请求时,请使用以下路径参数。
名称 | 类型 | 必须 | 说明 |
---|---|---|---|
customer-id | 字符串 | 是 | 标识客户的 GUID 格式字符串。 |
batchtracking-id | 字符串 | 是 | 用于检索设备批处理上传状态的 GUID 格式标识符。 成功提交设备批处理时,此 ID 在 Location 标头中返回。 |
请求标头
有关详细信息,请参阅合作伙伴中心 REST 标头。
请求正文
无
请求示例
GET https://api.partnercenter.microsoft.com/v1/customers/47021739-3426-40bf-9601-61b4b6d7c793/batchjobstatus/0127ed8e-ff72-4983-a3d8-e8d8bd378932 HTTP/1.1
Authorization: Bearer <token>
Accept: application/json
MS-RequestId: e88d014d-ab70-41de-90a0-f7fd1797267d
MS-CorrelationId: de894e18-f027-4ac0-8b5a-34f0c222af0c
X-Locale: en-US
Host: api.partnercenter.microsoft.com
REST 响应
如果成功,响应将 包含 BatchUploadDetails 资源。
响应的成功和错误代码
每个响应都带有一个 HTTP 状态代码,用于指示成功或失败以及其他调试信息。 请使用网络跟踪工具来读取此代码、错误类型和其他参数。 如需完整列表,请参阅合作伙伴中心 REST 错误代码。
响应示例
HTTP/1.1 200 OK
Content-Length: 400
MS-CorrelationId: 4a5002a2-0c1b-4e57-b491-dbcf19c0e7b8
MS-RequestId: 7b3e2e00-b330-4480-9d84-59ace713427f
MS-CV: YrLe3w6BbUSMt1fi.0
MS-ServerId: 030020344
Date: Tue, 25 Jul 2017 17:52:41 GMT
{
"batchTrackingId": "0127ed8e-ff72-4983-a3d8-e8d8bd378932",
"status": "finished",
"startedTime": "2017-07-25T10:00:00",
"completedTime": "2017-07-25T10:10:00",
"devicesStatus": [{
"serialNumber": "1234567890",
"productKey": "12345-67890-09876-54321-13579",
"status": "finished_with_errors",
"errorCode": "808",
"errorDescription": "ZtdDeviceAssignedToOtherTenant",
"attributes": {
"objectType": "DeviceUploadDetails"
}
}
],
"attributes": {
"objectType": "BatchUploadDetails"
}
}
反馈
https://aka.ms/ContentUserFeedback。
即将发布:在整个 2024 年,我们将逐步淘汰作为内容反馈机制的“GitHub 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈