共用方式為


根據客戶ID取得受控服務

適用於:合作夥伴中心 |美國政府Microsoft雲端合作夥伴中心

取得客戶的管理服務。 換句話說,取得您已委派系統管理員許可權之所有客戶訂用帳戶的連結。 您可以使用這些連結,透過 Microsoft 提供支援和檔案服務要求。

先決條件

  • 合作夥伴中心驗證中所述的認證。 此案例僅支援使用 App+User 認證進行驗證。

  • 客戶標識碼 (customer-tenant-id)。 如果您不知道客戶的標識碼,您可以在 合作夥伴中心 中,選取 [客戶 工作區] ,然後從客戶清單中選擇客戶,接著選擇 帳戶,來查閱標識碼。 在客戶的 [帳戶] 頁面上,在 [客戶帳戶資訊] 區段中尋找 Microsoft ID。 Microsoft識別碼與客戶標識碼 (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 參數

使用下列查詢參數來取得客戶的受控服務。

名字 類型 必填 描述
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"
        }
    }