使用合作夥伴中心 REST API 更新新商務的轉移要求
本文涵蓋如何在合作夥伴中心使用 REST API,以接受或取消新商務授權型或 Azure 方案項目的轉移要求。 此範例包含 REST 語法、標頭和 REST 回應。
適當的角色:管理員 代理程式
必要條件
- 認證,如合作夥伴中心驗證所述。 此案例支援使用獨立應用程式和 App+使用者認證進行驗證。
- 客戶識別碼 (
customer-tenant-id
)。 如果您不知道客戶的標識碼,您可以在合作夥伴中心中選取 [客戶] 工作區,然後從客戶清單中查看客戶,然後從 [帳戶]。 在客戶的 [帳戶] 頁面上,尋找 [客戶帳戶資訊] 區段中的 [Microsoft 識別碼]。 Microsoft 識別碼與客戶識別碼 (customer-tenant-id
) 相同。 - 現有傳輸的傳輸標識碼。
REST 要求
要求語法
方法 | 要求 URI |
---|---|
PATCH | {baseURL}/v1/customers/{customer-id}/transfer/{transfer-id} HTTP/1.1 |
URI 參數
使用下列路徑參數來識別客戶,並指定要接受的轉移。
名稱 | 類型 | 必要 | 描述 |
---|---|---|---|
customer-id | 字串 | Yes | 識別客戶的 GUID 格式客戶識別碼 |
transfer-id | 字串 | Yes | 識別傳輸的 GUID 格式傳輸識別碼 |
要求標頭
如需詳細資訊,請參閱合作夥伴中心 REST 標頭。
取消轉移的要求範例
只有在傳輸處於 擱置 狀態時,才能取消傳輸。 只有建立傳輸的目標合作夥伴可以取消傳輸。
PATCH /v1/customers/a624f7f8-408b-49B0-9320-df79e56bed55/transfers/43fb1d3a-79fe-45a9-863e-9a4acf17b630 HTTP/1.1
Authorization: Bearer <token>
Accept: application/json
MS-CorrelationId: aaaa0000-bb11-2222-33cc-444444dddddd
MS-RequestId: 8389053b-731c-4261-9899-1583d7859153
X-Locale: en-US
Content-Type: application/json
Host: api.partnercenter.microsoft.com
Content-Length: 0
{
"id": "43fb1d3a-79fe-45a9-863e-9a4acf17b630",
"status": "Cancel",
"targetPartnerTenantId": "aaaabbbb-0000-cccc-1111-dddd2222eeee",
"sourcePartnerTenantId": "bbbbcccc-1111-dddd-2222-eeee3333fff",
"customerName": "ipdbtrans2"
}
接受轉移的要求範例
接受傳輸包含明細專案。 下表描述 要求本文中的 TransferLineItem 屬性。
屬性 | 型別 | 必要 | 描述 |
---|---|---|---|
識別碼 | string | No | 傳輸明細專案的唯一標識符;成功建立 transferEntity 時套用 |
subscriptionID | 字串 | Yes | 訂用帳戶標識碼 |
productType | 字串 | Yes | 要轉移的類型應該是授權型訂用帳戶的 OnlineServicesNCE |
PATCH /v1/customers/a624f7f8-408b-49B0-9320-df79e56bed55/transfers/43fb1d3a-79fe-45a9-863e-9a4acf17b630 HTTP/1.1
Authorization: Bearer <token>
Accept: application/json
MS-CorrelationId: aaaa0000-bb11-2222-33cc-444444dddddd
MS-RequestId: 8389053b-731c-4261-9899-1583d7859153
X-Locale: en-US
Content-Type: application/json
Host: api.partnercenter.microsoft.com
Content-Length: 0
{
"id": "43fb1d3a-79fe-45a9-863e-9a4acf17b630",
"status": "Accept",
"transferType": 3,
"targetPartnerTenantId": "aaaabbbb-0000-cccc-1111-dddd2222eeee",
"sourcePartnerTenantId": "bbbbcccc-1111-dddd-2222-eeee3333fff",
"customerName": "ipdbtrans2",
"lineItems": [{
"id": 0,
"subscriptionId": "aaaa0a0a-bb1b-cc2c-dd3d-eeeeee4e4e4e",
"productType": "OnlineServicesNCE"
}]
}
傳輸更新的 REST 回應
如果成功,這個方法會在響應主體中傳回填入的 TransferSubmitResult 資源。
回應成功和錯誤碼
每個回應都有一個 HTTP 狀態代碼,指出成功或失敗,以及更多偵錯資訊。 使用網路追蹤工具來讀取此程式代碼、錯誤類型等等參數。 如需完整清單,請參閱錯誤碼。
取消傳輸的回應範例
HTTP/1.1 200 OK
Content-Length: 3389
Content-Type: application/json; charset=utf-8
MS-CorrelationId: aaaa0000-bb11-2222-33cc-444444dddddd
MS-RequestId: 8389053b-731c-4261-9899-1583d7859153
X-Locale: en-US
Date: Wed, 25 Mar 2020 19:13:06 GMT
{
"id": "43fb1d3a-79fe-45a9-863e-9a4acf17b630",
"status": "Cancel",
"transferType": 3,
"customerEmailId": "",
"createdTime": "2024-04-30T18:31:41.5133355Z",
"lastModifiedTime": "2024-04-30T18:31:41Z",
"expirationTime": "2024-05-31T00:00:00Z",
"customerName": "ipdbtrans2",
"customerTenantId": "a624f7f8-408b-49B0-9320-df79e56bed55",
"partnertenantid": "aaaabbbb-0000-cccc-1111-dddd2222eeee",
"sourcePartnerName": "Test_Test_IP4_AG",
"sourcePartnerTenantId": "aaaabbbb-0000-cccc-1111-dddd2222eeee",
"targetPartnerName": "Test_Test_DB_AG",
"targetPartnerTenantId": "aaaabbbb-0000-cccc-1111-dddd2222eeee",
"targetPartnerEmailId": "aaaabbbb-0000-cccc-1111-dddd2222eeee",
"transferDirection": 1,
"ignoreEligibilityCheck": false,
"lastModifiedUser": "7ffdaa28-3b1c-4a61-b580-e1aa6ecf833c",
"links": {
"self": {
"uri": "/customers/a624f7f8-408b-49B0-9320-df79e56bed55/transfers/43fb1d3a-79fe-45a9-863e-9a4acf17b630",
"method": "GET",
"headers": []
}
}
}
接受傳輸的回應範例
HTTP/1.1 200 OK
Content-Length: 3389
Content-Type: application/json; charset=utf-8
MS-CorrelationId: aaaa0000-bb11-2222-33cc-444444dddddd
MS-RequestId: 8389053b-731c-4261-9899-1583d7859153
X-Locale: en-US
Date: Wed, 25 Mar 2020 19:13:06 GMT
{
"id": "43fb1d3a-79fe-45a9-863e-9a4acf17b630",
"status": "InProgress",
"transferType": 3,
"customerEmailId": "",
"createdTime": "2024-04-30T18:31:41.5133355Z",
"lastModifiedTime": "2024-05-01T00:51:55Z",
"expirationTime": "2024-05-31T00:00:00Z",
"customerName": "ipdbtrans2",
"customerTenantId": "a624f7f8-408b-49B0-9320-df79e56bed55",
"partnertenantid": "aaaabbbb-0000-cccc-1111-dddd2222eeee",
"sourcePartnerName": "Test_Test_IP4_AG",
"sourcePartnerTenantId": "aaaabbbb-0000-cccc-1111-dddd2222eeee",
"targetPartnerName": "Test_Test_DB_AG",
"targetPartnerTenantId": "aaaabbbb-0000-cccc-1111-dddd2222eeee",
"targetPartnerEmailId": "aaaabbbb-0000-cccc-1111-dddd2222eeee",
"transferDirection": 2,
"ignoreEligibilityCheck": false,
"lastModifiedUser": "1671774b-679f-4543-a152-1f8b14006c0e",
"lineItems": [{
"id": 0,
"subscriptionId": "aaaa0a0a-bb1b-cc2c-dd3d-eeeeee4e4e4e",
"billingCycle": "unknown",
"quantity": 0,
"productType": 5,
"status": "InProgress"
}],
"links": {
"self": {
"uri": "/customers/a624f7f8-408b-49B0-9320-df79e56bed55/transfers/43fb1d3a-79fe-45a9-863e-9a4acf17b630",
"method": "GET",
"headers": []
}
}
}