获取产品列表(按客户)
适用于:合作伙伴中心|由世纪互联运营的合作伙伴中心|适用于Microsoft Cloud for US Government的合作伙伴中心
可以使用以下方法获取现有客户的产品集合。
必备条件
合作伙伴中心身份验证中所述的凭据。 此方案支持使用独立应用和 App+用户凭据进行身份验证。
客户 ID (
customer-tenant-id)。 如果不知道客户的 ID,则可以在合作伙伴中心仪表板中查找它。 从“合作伙伴中心”菜单中选择“CSP” ,然后选择“客户” 。 从客户列表中选择客户,然后选择“帐户” 。 在客户的“帐户”页上的“客户帐户信息” 部分查找 Microsoft ID。 Microsoft ID 与客户 ID (customer-tenant-id) 相同。
REST 请求
请求语法
| 方法 | 请求 URI |
|---|---|
| POST | {baseURL}/v1/customers/{customer-tenant-id}/products?targetView={targetView} HTTP/1.1 |
请求 URI 参数
| 名称 | 类型 | 必需 | 说明 |
|---|---|---|---|
| customer-tenant-id | GUID | 是 | 该值是 GUID 格式的 customer-tenant-id,是一个用于指定客户的标识符。 |
| targetView | 字符串 | 是 | 标识目录的目标视图。 支持的值包括: Azure,其中包括所有 Azure 项 AzureReservations,其中包括所有 Azure 预留项 AzureReservationsVM,其中包括所有虚拟机 (VM) 预留项 AzureReservationsSQL,其中包括所有 SQL 预留项 AzureReservationsCosmosDb,其中包括所有 Cosmos 数据库预留项 MicrosoftAzure,其中包括 Microsoft Azure 订阅的项 (MS-AZR-0145P) 和 Azure 计划 OnlineServices,其中包括所有联机服务项。 此 targetView 包括商业市场、基于许可证的服务以及基于商业许可证的新服务 软件,包括所有软件项 SoftwareSUSELinux,其中包括所有软件 SUSE Linux 项 SoftwarePerpetual,其中包括所有永久性软件项目 SoftwareSubscriptions,其中包括所有软件订阅项 SpecializedOffers,其中包括已提供给某些合作伙伴的专用产品/服务 |
请求标头
有关详细信息,请参阅合作伙伴中心 REST 标头。
请求正文
无。
请求示例
请求获取给定客户可用的基于 Azure 使用情况的产品列表。 Microsoft Azure (MS-AZR-0145P) 和 Azure 计划的产品将返回给公有云中的客户:
GET https://api.partnercenter.microsoft.com/v1/customers/65543400-f8b0-4783-8530-6d35ab8c6801/products?targetView=MicrosoftAzure HTTP/1.1
Authorization: Bearer <token>
Accept: application/json
MS-RequestId: 83643f5e-5dfd-4375-88ed-054412460dc8
MS-CorrelationId: b1939cb2-e83d-4fb0-989f-514fb741b734
基于许可证的新服务
注意
基于许可证的服务的新商业体验涵盖许多新功能,可供所有云解决方案提供商 (CSP) 使用。 有关详细信息,请参阅新商务体验概述。
按照以下示例,在新的商业体验技术预览版中,按国家/地区获取基于新商业许可证的服务的产品列表。 新的基于商业许可证的服务将被 OnlineServicesNCE 的 ID 和 displayNames 值所标识。 请参阅下面的响应示例。
GET https://api.partnercenter.microsoft.com/v1/customers/65543400-f8b0-4783-8530-6d35ab8c6801/products?targetView=OnlineServices HTTP/1.1
Authorization: Bearer
Accept: application/json
MS-RequestId: 031160b2-b0b0-4d40-b2b1-aaa9bb84211d
MS-CorrelationId: 7c1f6619-c176-4040-a88f-2c71f3ba4533
Rest 响应
响应的成功和错误代码
每个响应都带有一个 HTTP 状态代码,用于指示成功或失败以及其他调试信息。 请使用网络跟踪工具来读取此代码、错误类型和其他参数。 有关完整列表,请参阅 合作伙伴中心错误代码。
此方法返回以下错误代码:
| HTTP 状态代码 | 错误代码 | 说明 |
|---|---|---|
| 403 | 400036 | 不允许访问请求的 targetView。 |
Microsoft Azure 和 Azure 计划的响应示例
HTTP/1.1 200 OK
Content-Length: 1909
Content-Type: application/json; charset=utf-8
MS-CorrelationId: cad955c2-8efc-47fe-b112-548ff002ba18
MS-RequestId: ae7288e2-2673-4ad4-8c12-7aad818d5949
{
"totalCount": 2,
"items": [
{
"id": "MS-AZR-0145P",
"productId": "9DEA7946-EC2C-441E-9FFD-E3B275F7E838",
"title": "Microsoft Azure",
"description": "Azure Cloud Solution Provider offer for Partner and Resellers",
"minimumQuantity": 1,
"maximumQuantity": 1,
"isTrial": false,
"supportedBillingCycles": [
"monthly"
],
"purchasePrerequisites": [
"MicrosoftCloudAgreement"
],
"actions": [
"Refund"
],
"dynamicAttributes": {
"isMicrosoftProduct": true,
"billingType": "usage",
"category": "Enterprise",
"isAddon": false,
"prerequisiteSkus": [],
"rank": 1413,
"hasAddOns": false,
"isAutoRenewable": false,
"upgradeTargetOffers": null,
"conversionTargetOffers": [],
"unitType": "Usage-based",
"limitUnitOfMeasure": "None",
"limit": 0,
"reselleeQualifications": [],
"resellerQualifications": []
},
"links": {
"availabilities": {
"uri": "/products/9DEA7946-EC2C-441E-9FFD-E3B275F7E838/skus/MS-AZR-0145P/availabilities?country=US&targetSegment=Commercial",
"method": "GET",
"headers": []
},
"self": {
"uri": "/products/9DEA7946-EC2C-441E-9FFD-E3B275F7E838/skus/MS-AZR-0145P?country=US",
"method": "GET",
"headers": []
}
}
},
{
"id": "0001",
"productId": "DZH318Z0BPS6",
"title": "Microsoft Azure plan",
"description": "Microsoft Azure plan (MS-AZR-0017G)",
"minimumQuantity": 1,
"maximumQuantity": 1,
"isTrial": false,
"supportedBillingCycles": [
"one_time"
],
"purchasePrerequisites": [
"MicrosoftCustomerAgreement"
],
"inventoryVariables": [],
"provisioningVariables": [],
"actions": [
"Refund"
],
"dynamicAttributes": {
"isMicrosoftProduct": true,
"pilotProgram": "modernazurepilot"
},
"links": {
"availabilities": {
"uri": "/products/DZH318Z0BPS6/skus/0001/availabilities?country=US&targetSegment=Commercial",
"method": "GET",
"headers": []
},
"self": {
"uri": "/products/DZH318Z0BPS6/skus/0001?country=US",
"method": "GET",
"headers": []
}
}
}
],
"links": {
"self": {
"uri": "/customers/e2a0c0f3-0f74-4d1c-808c-dfa511481913/products/all/skus?targetView=MicrosoftAzure&targetSegment=Commercial",
"method": "GET",
"headers": []
}
},
"attributes": {
"objectType": "Collection"
}
}
基于新商业许可证的服务的响应示例
注意
基于许可证的服务的新商业体验涵盖许多新功能,可供所有云解决方案提供商 (CSP) 使用。 有关详细信息,请参阅新商务体验概述。
{
"totalCount": 19,
"items": [{
"id": "CFQ7TTC0LH18",
"title": "Microsoft 365 Business Basic",
"description": "Best for businesses that need professional email, cloud file storage, and online meetings & chat. Desktop versions of Office apps like Excel, Word, and PowerPoint not included. For businesses with up to 300 employees.",
"productType": {
"id": "OnlineServicesNCE",
"displayName": "OnlineServicesNCE"
},
"isMicrosoftProduct": true,
"publisherName": "Microsoft Corporation",
"links": {
"skus": {
"uri": "/products/CFQ7TTC0LH18/skus?country=US",
"method": "GET",
"headers": []
},
"self": {
"uri": "/products/CFQ7TTC0LH18?country=US",
"method": "GET",
"headers": []
}
}
},
...
],
"links": {
"self": {
"uri": "/products?country=US&targetView=OnlineServices",
"method": "GET",
"headers": []
}
},
"attributes": {
"objectType": "Collection"
}
}