共用方式為


刪除自助原則

本文說明如何更新自助原則。

必要條件

C#

若要刪除自助原則:

  1. 使用實體識別碼呼叫 IAggregatePartner.SelfServePolicies.ById 方法,以擷取原則上作業的介面。

  2. 呼叫 Delete DeleteAsync 方法來刪除自助原則。

// IAggregatePartner partnerOperations;
string policyId;

// All the operations executed on this partner operation instance will share the same correlation Id but will differ in request Id
IPartner scopedPartnerOperations = partnerOperations.With(RequestContextFactory.Instance.Create(Guid.NewGuid()));

// deletes the self-serve policies
partnerOperations.SelfServePolicies.ById(policyId).Delete();

如需範例,請參閱下列各項:

REST 要求

要求語法

方法 要求 URI
DELETE {baseURL} /v1/SelfServePolicy/{id} HTTP/1.1

URI 參數

使用下列路徑參數來取得指定的產品。

名稱 類型​​ 必填 描述
SelfServePolicy-id string Yes 識別自助原則的字串。

要求標頭

要求本文

無。

要求範例

DELETE https://api.partnercenter.microsoft.com/v1/SelfServePolicy/634f6379-ad54-449b-9821-564f737158ab_0431a72c-7d8a-4393-b25e-ef63f5efb415 HTTP/1.1
Authorization: Bearer <token>
Accept: application/json
MS-RequestId: 94e4e214-6b06-4fb7-96d1-94d559f9b47f
MS-CorrelationId: ab993325-1605-4cf4-bac4-fb584142a31b
X-Locale: en-US
Host: api.partnercenter.microsoft.com
Content-Length: 789
Connection: Keep-Alive

REST 回應

回應成功和錯誤碼

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

回應範例

HTTP/1.1 204 deleted
MS-CorrelationId: ab993325-1605-4cf4-bac4-fb584142a31b
MS-RequestId: 94e4e214-6b06-4fb7-96d1-94d559f9b47f
Date: Tue, 14 Feb 2017 20:06:02 GMT