更新支援設定檔
適用于:合作夥伴中心 |由 21Vianet 營運的合作夥伴中心 |適用于 Microsoft Cloud for US Government 的合作夥伴中心
更新使用者的支援設定檔。
必要條件
- 認證,如合作夥伴中心驗證所述。 此案例僅支援使用「應用程式+使用者」認證來進行驗證。
C#
如果要更新您的支援設定檔,請先取得您的支援設定檔,並進行所有必要的變更。 然後,使用 您的 IPartnerOperations.Profiles 集合。 呼叫 SupportProfile 屬性,後面接著 Update () 或 UpdateAsync () 方法。
// IAggregatePartner partnerOperations;
// updated profile
SupportProfile newSupportProfile = new SupportProfile
{
Email = supportProfile.Email,
Website = supportProfile.Website,
Telephone = new Random().Next(10000000, 99999999).ToString(CultureInfo.InvariantCulture)
};
SupportProfile updatedSupportProfile = partnerOperations.Profiles.SupportProfile.Update(newSupportProfile);
範例: 主控台測試應用程式。 專案:PartnerCenterSDK.FeaturesSamples 類別:UpdateSupportProfile.cs
REST 要求
要求的語法
方法 | 要求 URI |
---|---|
PUT | {baseURL}/v1/profiles/supportprofile HTTP/1.1 |
要求標頭
如需詳細資訊,請參閱合作夥伴中心 REST 標頭。
要求本文
完整的支援設定檔資源。
要求範例
PUT https://api.partnercenter.microsoft.com/v1/profiles/supportprofile HTTP/1.1
Authorization: Bearer <token>
Accept: application/json
MS-RequestId: 603f3cd9-01b8-48f2-b65d-855a246f5bfd
MS-CorrelationId: aaaa0000-bb11-2222-33cc-444444dddddd
Content-Type: application/json
Content-Length: 167
Expect: 100-continue
{
"Email": "email@sample.com",
"Telephone": "4255555555",
"Website": "www.microsoft.com",
"ProfileType": "support_profile",
"Attributes": {
"ObjectType": "PartnerSupportProfile"
}
}
REST 回應
如果成功,這個方法會在回應本文中傳回更新的 SupportProfile 物件屬性。
回應成功和錯誤碼
每個回應都隨附 HTTP 狀態碼,會指出成功與否以及其他的偵錯資訊。 請使用網路追蹤工具來讀取此錯誤碼、錯誤類型和其他參數。 如需完整清單,請參閱錯誤碼。
回應範例
HTTP/1.1 200 OK
Content-Length: 502
Content-Type: application/json
MS-CorrelationId: aaaa0000-bb11-2222-33cc-444444dddddd
MS-RequestId: 603f3cd9-01b8-48f2-b65d-855a246f5bfd
Date: Wed, 25 Nov 2015 07:16:18 GMT
{
"email": "email@sample.com",
"telephone": "4255555555",
"website": "www.microsoft.com",
"profileType": "support_profile",
"links": {
"self": {
"uri": "/v1/profiles/support",
"method": "GET",
"headers": []
}
},
"attributes": {
"objectType": "PartnerSupportProfile"
}
}