取得試用版轉換方案的清單

如何擷取試用版轉換供應專案的清單。

必要條件

C#

若要取得可用的試用版轉換清單,請先使用 IAggregatePartner.Customers.ById 方法搭配客戶識別碼來識別客戶。 然後,使用試用訂用帳戶識別碼呼叫 Subscriptions.ById 方法,以取得訂用帳戶作業的介面。 接下來,使用 Conversions 屬性取得轉換作業的介面,然後呼叫 Get GetAsync 方法來擷取可用 轉換 供應專案的集合。

// IAggregatePartner partnerOperations;
// string customerId;
// string subscriptionId;

// Get the available conversions.
var conversions =
    partnerOperations.Customers.ById(customerId).Subscriptions.ById(subscriptionId).Conversions.Get();

REST 要求

要求語法

方法 要求 URI
GET {baseURL} /v1/customers/{customer-id}/subscriptions/{subscription-id}/conversions HTTP/1.1

URI 參數

使用下列路徑參數來識別客戶和試用訂用帳戶。

名稱 類型​ 必填 描述
customer-id string Yes 識別客戶的 GUID 格式化字串。
subscription-id string Yes 識別試用訂閱的 GUID 格式字串。

要求標頭

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

要求本文

無。

要求範例

GET https://api.partnercenter.microsoft.com/v1/customers/0c39d6d5-c70d-4c55-bc02-f620844f3fd1/subscriptions/488745B5-2086-4912-802C-6ABB9F7C3638/conversions HTTP/1.1
Authorization: Bearer <token>
Accept: application/json
MS-RequestId: e17f5bc6-24bf-4cbe-b632-d7fc6cec3058
MS-CorrelationId: 8daa6d54-72ab-4d6b-9c7d-9266d3734a47
X-Locale: en-US
Host: api.partnercenter.microsoft.com

REST 回應

如果成功,回應本文會包含轉換 資源的集合

回應成功和錯誤碼

每個回應都隨附 HTTP 狀態碼,會指出成功與否以及其他的偵錯資訊。 請使用網路追蹤工具來讀取此錯誤碼、錯誤類型和其他參數。 如需完整清單,請參閱 合作夥伴中心錯誤碼

回應範例

HTTP/1.1 200 OK
Content-Length: 305
Content-Type: application/json; charset=utf-8
MS-CorrelationId: 8daa6d54-72ab-4d6b-9c7d-9266d3734a47
MS-RequestId: e17f5bc6-24bf-4cbe-b632-d7fc6cec3058
MS-CV: feJByqU1X0ObaTQr.0
MS-ServerId: 030011719
Date: Thu, 15 Jun 2017 23:10:01 GMT

 {
    "totalCount": 1,
    "items": [{
            "offerId": "C0BD2E08-11AC-4836-BDC7-3712E744922F",
            "targetOfferId": "031C9E47-4802-4248-838E-778FB1D2CC05",
            "orderId": "D51A052E-043C-4A2A-AA37-2BB938CEF6C1",
            "quantity": 25,
            "billingCycle": "monthly",
            "attributes": {
                "objectType": "Conversion"
            }
        }
    ],
    "attributes": {
        "objectType": "Collection"
    }
}