更新支持配置文件

适用于:合作伙伴中心 | 由世纪互联运营的合作伙伴中心 | 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: 20604323-50bf-4738-9968-c5486ab32be0
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: 20604323-50bf-4738-9968-c5486ab32be0
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"
    }
}