按 ID 获取客户的托管服务

适用于:合作伙伴中心 | Microsoft 云服务 (美国政府专用) 合作伙伴中心

获取客户的托管服务。 换句话说,获取指向您已委派管理员权限的所有客户订阅的链接。 您可以使用这些链接向 Microsoft 提供支持和提交服务请求。

先决条件

  • 合作伙伴中心身份验证中所述的凭据。 此方案仅支持使用 App+User 凭据进行身份验证。

  • 客户编号 (customer-tenant-id)。 如果不知道客户的 ID,可以在合作伙伴中心查找,依次选择“客户”工作区,从客户列表中选择客户,然后选择“帐户”。 在客户的“帐户”页上,在“客户帐户信息”部分查找Microsoft ID Microsoft ID 与客户 ID (customer-tenant-id) 相同。

C#(编程语言)

要显示客户的所有托管服务的列表,请使用 IAggregatePartner.Customers 集合并调用 ById() 方法。 然后调用 ManagedServices 属性,后跟 Get()GetAsync() 方法。

// IAggregatePartner partnerOperations;
// var selectedCustomerID as Customer;

ResourceCollection<ManagedService> managedServices = partnerOperations.Customers.ById(selectedCustomerId).ManagedServices.Get();

示例控制台测试应用项目:PartnerCenterSDK.FeaturesSamples :CustomerManagedServices.cs

REST 请求

请求语法

方法 请求 URI
获取 {baseURL}/v1/customers/{customer-tenant-id}/managedservices HTTP/1.1

URI 参数

使用以下查询参数获取客户的托管服务。

名称 类型 必选 DESCRIPTION
customer-tenant-id guid Y 与客户相对应的 GUID。

请求标头

有关详细信息,请参阅合作伙伴中心 REST 标头

请求主体

没有。

请求示例

GET https://api.partnercenter.microsoft.com/v1/customers/<customer-tenant-id>/managedservices HTTP/1.1
Authorization: Bearer <token>
Accept: application/json
MS-RequestId: 4ff57220-f17b-4d8f-8e09-78334c57ba00
MS-CorrelationId: aaaa0000-bb11-2222-33cc-444444dddddd

REST 响应

如果成功,此方法将在响应正文中返回 Managed Service 对象的集合。

成功响应和错误代码

每个响应都附带一个 HTTP 状态代码,指示成功或失败和其他调试信息。 请使用网络跟踪工具来读取此代码、错误类型和其他参数。 要查看更多详细列表,请参阅错误代码

响应示例

HTTP/1.1 200 OK
Content-Length: 10588
Content-Type: application/json
MS-CorrelationId: aaaa0000-bb11-2222-33cc-444444dddddd
MS-RequestId: 4ff57220-f17b-4d8f-8e09-78334c57ba00
Date: Mon, 23 Nov 2015 18:02:12 GMT

{
    "totalCount": 2,
    "items": [{
        "id": "Exchange",
        "name": "Exchange",
        "groupName": "Office",
        "links": {
            "adminService": {
                "uri": "https://portal.office.com/Partner/BeginClientSession.aspx?CTID=<ctid>&CSDEST=Exchange&InitialDomain=<domain>&PrimaryDomain=<domain>",
                "method": "GET",
                "headers": []
            },
            "serviceHealth": {
                "uri": "https://portal.office.com/Partner/BeginClientSession.aspx?CTID=<ctid>&CSDEST=ServiceStatus",
                "method": "GET",
                "headers": []
            },
            "serviceTicket": {
                "uri": "https://portal.office.com/Partner/BeginClientSession.aspx?CTID=<ctid>&CSDEST=Support",
                "method": "GET",
                "headers": []
            }
        },
        "attributes": {
            "objectType": "ManagedService"
        }
    },
    {
        "id": "MicrosoftCommunicationsOnline",
        "name": "SkypeforBusiness",
        "groupName": "Office",
        "links": {
            "adminService": {
                "uri": "https://portal.office.com/Partner/BeginClientSession.aspx?CTID=<ctid>&CSDEST=MicrosoftCommunicationsOnline",
                "method": "GET",
                "headers": []
            },
            "serviceHealth": {
                "uri": "https://portal.office.com/Partner/BeginClientSession.aspx?CTID=<ctid>&CSDEST=ServiceStatus",
                "method": "GET",
                "headers": []
            },
            "serviceTicket": {
                "uri": "https://portal.office.com/Partner/BeginClientSession.aspx?CTID=<ctid>&CSDEST=Support",
                "method": "GET",
                "headers": []
            }
        },
        "attributes": {
            "objectType": "ManagedService"
        }
    }