共用方式為


取得客戶的產品升級狀態

您可以使用 ProductUpgradeRequest 資源來取得升級至新產品系列的狀態。 當您將客戶從 Microsoft Azure (MS-AZR-0145P) 訂用帳戶升級至 Azure 方案時,就會套用此資源。 成功的請求會傳回 ProductUpgradesEligibility 資源。

先決條件

  • 合作夥伴中心驗證中所述的認證。 此案例支援使用App+User認證進行驗證。 搭配合作夥伴中心 API 使用 App+使用者驗證時,請遵循 安全的應用程式模型

  • 客戶標識碼 (customer-tenant-id)。 如果您不知道客戶的標識碼,可以在 合作夥伴中心 中選擇 客戶 工作區,然後從客戶清單中選取客戶,然後選擇 帳戶來查閱。 在客戶的 [帳戶] 頁面上,在 [客戶帳戶資訊] 區段中尋找 Microsoft 帳號。 Microsoft識別碼與客戶標識碼 (customer-tenant-id) 相同。

  • 產品系列。

  • 升級請求的升級ID。

C#

若要檢查客戶是否有資格升級至 Azure 方案:

  1. 建立 ProductUpgradesRequest 物件,並將客戶標識碼和 “Azure” 指定為產品系列。

  2. 使用 IAggregatePartner.ProductUpgrades 集合。

  3. 呼叫 ById 方法,並傳入 升級識別碼

  4. 呼叫 CheckStatus 方法,並傳入 ProductUpgradesRequest 物件,這會傳回 ProductUpgradeStatus 物件。

// IAggregatePartner partnerOperations;

string selectedCustomerId = "58e2af4f-0ad3-4688-8744-be2357cd939a";

string selectedProductFamily = "azure";

var productUpgradeRequest = new ProductUpgradesRequest
{
    CustomerId = selectedCustomerId,
    ProductFamily = selectedProductFamily
};

ProductUpgradesStatus productUpgradeStatus = partnerOperations.ProductUpgrades.ById(selectedUpgradeId).CheckStatus(productUpgradeRequest);

if (productUpgradeEligibility.IsEligibile)
{
    ....
}

REST 要求

要求的語法

方法 要求 URI
POST {baseURL}/v1/productUpgrades/{upgrade-id}/status HTTP/1.1

URI 參數

使用下列查詢參數來指定您取得產品升級狀態的客戶。

名字 類型 必填 描述
upgrade-id 全域唯一識別碼 (GUID) 是的 值為 GUID 格式的升級標識碼。 您可以使用此識別碼來指定要追蹤的更新。

要求標頭

如需詳細資訊,請參閱 合作夥伴中心 REST 標頭

請求主體

要求的內容必須包含 ProductUpgradeRequest 資源。

要求範例

POST https://api.partnercenter.microsoft.com/v1/productupgrades/42d075a4-bfe7-43e7-af6d-7c68a57edcb4/status  HTTP/1.1
Authorization: Bearer <token>
Accept: application/json
MS-RequestId: c245d5f2-1de3-4ae0-9e42-95e38e3cb8ff
MS-CorrelationId: aaaa0000-bb11-2222-33cc-444444dddddd
X-Locale: en-US
MS-PartnerCenter-Application: Partner Center .NET SDK Samples
Content-Type: application/json
Host: api.partnercenter.microsoft.com
Content-Length: 340
Expect: 100-continue
Connection: Keep-Alive
{
 {
    "customerId": "4c721420-72ad-4708-a0a7-371a2f7b0969",
    "productFamily": "azure"
  }
  "Attributes": {
  "ObjectType": "ProductUpgradeRequest"
  }
}

重要

自 2023 年 6 月起,最新的合作夥伴中心 .NET SDK 3.4.0 版現已封存。 您可以從 GitHub下載 SDK 版本,以及包含實用資訊的 自述檔

鼓勵合作夥伴繼續使用 合作夥伴中心 REST API

REST 回應

如果成功,這個方法會在本文中傳回 ProductUpgradesEligibility 資源。

回應成功和錯誤碼

每個回應都有一個 HTTP 狀態代碼,指出成功或失敗和其他偵錯資訊。 使用網路追蹤工具來讀取此程式代碼、錯誤類型和其他參數。 如需完整清單,請參閱 合作夥伴中心 REST 錯誤碼。

回應範例

HTTP/1.1 200 Ok
Content-Length: 150
MS-CorrelationId: bbbb1111-cc22-3333-44dd-555555eeeeee
MS-RequestId: cb82f7d6-f0d9-44d4-82f9-f6eee6e68390
MS-CV: iqOqN0FnaE2y0HcD.0
MS-ServerId: 030020525
Date: Thu, 04 Oct 2019 20:35:35 GMT

{
    "id": "42d075a4-bfe7-43e7-af6d-7c68a57edcb4",
    "status": "Completed",
    "productFamily": "Azure",
    "lineItems": [
        {
            "sourceProduct": {
                "id": "b1beb621-3cad-4d7a-b360-62db33ce028e",
                "name": "AzureSubscription"
            },
            "targetProduct": {
                "id": "d231908e-31c1-de0e-027b-bc5ce11f09d9",
                "name": "Microsoft Azure plan"
            },
            "upgradedDate": "2019-08-29T23:47:28.8524555Z",
            "status": "Completed"
        }
    ]
}