刪除自助原則
本文說明如何更新自助原則。
必要條件
- 認證,如合作夥伴中心驗證所述。 此案例支援使用 Application+User 認證進行驗證。
C#
若要刪除自助原則:
使用實體識別碼呼叫 IAggregatePartner.SelfServePolicies.ById 方法,以擷取原則上作業的介面。
呼叫 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();
如需範例,請參閱下列各項:
- 範例: 主控台測試應用程式
- 專案: PartnerSDK.FeatureSamples
- 類別: DeleteSelfServePolicies.cs
REST 要求
要求語法
方法 | 要求 URI |
---|---|
DELETE | {baseURL} /v1/SelfServePolicy/{id} HTTP/1.1 |
URI 參數
使用下列路徑參數來取得指定的產品。
名稱 | 類型 | 必填 | 描述 |
---|---|---|---|
SelfServePolicy-id | string | Yes | 識別自助原則的字串。 |
要求標頭
- 需要要求識別碼和相互關聯識別碼。
- 如需詳細資訊,請參閱合作夥伴中心 REST 標頭。
要求本文
無。
要求範例
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
意見反應
https://aka.ms/ContentUserFeedback。
即將登場:在 2024 年,我們將逐步淘汰 GitHub 問題作為內容的意見反應機制,並將它取代為新的意見反應系統。 如需詳細資訊,請參閱:提交並檢視相關的意見反應