UpdateUser 服务操作 - 客户管理

汇报有关Microsoft广告用户的个人和业务联系信息。

注意

只有具有超级管理员或Standard凭据的用户才能更新用户。 有关详细信息,请参阅 用户角色 技术指南。

由于更新操作需要最近用户写入操作的时间戳,因此必须首先调用 GetUser 操作。 GetUser 操作返回用户的数据,其中包括时间戳。 如果使用旧时间戳,则更新调用将失败,例如,用户数据在获取时间戳后由应用程序或其他应用程序更新。

请求元素

UpdateUserRequest 对象定义服务操作请求的正文标头元素。 元素的顺序必须与 请求 SOAP 中所示的顺序相同。

注意

除非下面另有说明,否则需要所有请求元素。

请求正文元素

元素 说明 数据类型
用户 包含更新的用户信息的用户对象。

此操作使用传递的用户对象的内容覆盖现有用户数据。 此操作执行完全更新,而不是部分更新。 User 对象必须包含上次写入 User 对象的时间戳值。 若要确保时间戳包含正确的值,请调用 GetUser 操作。 然后,可以根据需要更新用户数据,并调用 UpdateUser
用户

请求标头元素

元素 说明 数据类型
AuthenticationToken OAuth 访问令牌,表示有权Microsoft广告帐户的用户的凭据。

有关详细信息,请参阅 使用 OAuth 进行身份验证
string
DeveloperToken 用于访问必应广告 API 的开发人员令牌。

有关详细信息,请参阅 获取开发人员令牌
string
Password 此元素保留供内部使用,将从 API 的未来版本中删除。 必须使用 AuthenticationToken 元素来设置用户凭据。 string
UserName 此元素保留供内部使用,将从 API 的未来版本中删除。 必须使用 AuthenticationToken 元素来设置用户凭据。 string

响应元素

UpdateUserResponse 对象定义服务操作响应的正文标头元素。 元素的返回顺序与 响应 SOAP 中所示的顺序相同。

响应正文元素

元素 说明 数据类型
LastModifiedTime 用户上次更新的日期和时间。 该值以协调世界时 (UTC) 表示。

日期和时间值反映服务器的日期和时间,而不是客户端。 有关日期和时间格式的信息,请参阅 基元 XML 数据类型中的 dateTime 条目。
dateTime

响应标头元素

元素 说明 数据类型
跟踪 ID 包含 API 调用详细信息的日志条目的标识符。 string

请求 SOAP

此模板由一个工具生成,用于显示 SOAP 请求的正文标头元素的顺序。 有关可用于此服务操作的支持类型,请参阅上面的 请求正文元素 参考。

<s:Envelope xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
  <s:Header xmlns="https://bingads.microsoft.com/Customer/v13">
    <Action mustUnderstand="1">UpdateUser</Action>
    <AuthenticationToken i:nil="false">ValueHere</AuthenticationToken>
    <DeveloperToken i:nil="false">ValueHere</DeveloperToken>
  </s:Header>
  <s:Body>
    <UpdateUserRequest xmlns="https://bingads.microsoft.com/Customer/v13">
      <User xmlns:e133="https://bingads.microsoft.com/Customer/v13/Entities" i:nil="false">
        <e133:ContactInfo i:nil="false">
          <e133:Address i:nil="false">
            <e133:City i:nil="false">ValueHere</e133:City>
            <e133:CountryCode i:nil="false">ValueHere</e133:CountryCode>
            <e133:Id i:nil="false">ValueHere</e133:Id>
            <e133:Line1 i:nil="false">ValueHere</e133:Line1>
            <e133:Line2 i:nil="false">ValueHere</e133:Line2>
            <e133:Line3 i:nil="false">ValueHere</e133:Line3>
            <e133:Line4 i:nil="false">ValueHere</e133:Line4>
            <e133:PostalCode i:nil="false">ValueHere</e133:PostalCode>
            <e133:StateOrProvince i:nil="false">ValueHere</e133:StateOrProvince>
            <e133:TimeStamp i:nil="false">ValueHere</e133:TimeStamp>
            <e133:BusinessName i:nil="false">ValueHere</e133:BusinessName>
          </e133:Address>
          <e133:ContactByPhone i:nil="false">ValueHere</e133:ContactByPhone>
          <e133:ContactByPostalMail i:nil="false">ValueHere</e133:ContactByPostalMail>
          <e133:Email i:nil="false">ValueHere</e133:Email>
          <e133:EmailFormat i:nil="false">ValueHere</e133:EmailFormat>
          <e133:Fax i:nil="false">ValueHere</e133:Fax>
          <e133:HomePhone i:nil="false">ValueHere</e133:HomePhone>
          <e133:Id i:nil="false">ValueHere</e133:Id>
          <e133:Mobile i:nil="false">ValueHere</e133:Mobile>
          <e133:Phone1 i:nil="false">ValueHere</e133:Phone1>
          <e133:Phone2 i:nil="false">ValueHere</e133:Phone2>
        </e133:ContactInfo>
        <e133:CustomerId i:nil="false">ValueHere</e133:CustomerId>
        <e133:Id i:nil="false">ValueHere</e133:Id>
        <e133:JobTitle i:nil="false">ValueHere</e133:JobTitle>
        <e133:LastModifiedByUserId i:nil="false">ValueHere</e133:LastModifiedByUserId>
        <e133:LastModifiedTime i:nil="false">ValueHere</e133:LastModifiedTime>
        <e133:Lcid i:nil="false">ValueHere</e133:Lcid>
        <e133:Name i:nil="false">
          <e133:FirstName i:nil="false">ValueHere</e133:FirstName>
          <e133:LastName i:nil="false">ValueHere</e133:LastName>
          <e133:MiddleInitial i:nil="false">ValueHere</e133:MiddleInitial>
        </e133:Name>
        <e133:Password i:nil="false">ValueHere</e133:Password>
        <e133:SecretAnswer i:nil="false">ValueHere</e133:SecretAnswer>
        <e133:SecretQuestion>ValueHere</e133:SecretQuestion>
        <e133:UserLifeCycleStatus i:nil="false">ValueHere</e133:UserLifeCycleStatus>
        <e133:TimeStamp i:nil="false">ValueHere</e133:TimeStamp>
        <e133:UserName i:nil="false">ValueHere</e133:UserName>
        <e133:ForwardCompatibilityMap xmlns:e134="http://schemas.datacontract.org/2004/07/System.Collections.Generic" i:nil="false">
          <e134:KeyValuePairOfstringstring>
            <e134:key i:nil="false">ValueHere</e134:key>
            <e134:value i:nil="false">ValueHere</e134:value>
          </e134:KeyValuePairOfstringstring>
        </e133:ForwardCompatibilityMap>
        <e133:AuthenticationToken i:nil="false">ValueHere</e133:AuthenticationToken>
      </User>
    </UpdateUserRequest>
  </s:Body>
</s:Envelope>

响应 SOAP

此模板由一个工具生成,用于显示 SOAP 响应的 正文标头 元素的顺序。

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
  <s:Header xmlns="https://bingads.microsoft.com/Customer/v13">
    <TrackingId d3p1:nil="false" xmlns:d3p1="http://www.w3.org/2001/XMLSchema-instance">ValueHere</TrackingId>
  </s:Header>
  <s:Body>
    <UpdateUserResponse xmlns="https://bingads.microsoft.com/Customer/v13">
      <LastModifiedTime>ValueHere</LastModifiedTime>
    </UpdateUserResponse>
  </s:Body>
</s:Envelope>

代码语法

示例语法可用于 必应广告 SDK。 有关更多示例,请参阅 必应广告 API 代码示例

public async Task<UpdateUserResponse> UpdateUserAsync(
	User user)
{
	var request = new UpdateUserRequest
	{
		User = user
	};

	return (await CustomerManagementService.CallAsync((s, r) => s.UpdateUserAsync(r), request));
}
static UpdateUserResponse updateUser(
	User user) throws RemoteException, Exception
{
	UpdateUserRequest request = new UpdateUserRequest();

	request.setUser(user);

	return CustomerManagementService.getService().updateUser(request);
}
static function UpdateUser(
	$user)
{

	$GLOBALS['Proxy'] = $GLOBALS['CustomerManagementProxy'];

	$request = new UpdateUserRequest();

	$request->User = $user;

	return $GLOBALS['CustomerManagementProxy']->GetService()->UpdateUser($request);
}
response=customermanagement_service.UpdateUser(
	User=User)

要求

服务: CustomerManagementService.svc v13
命名空间: https://bingads.microsoft.com/Customer/v13

请求 URL

https://clientcenter.api.bingads.microsoft.com/CustomerManagement/v13/User

请求元素

UpdateUserRequest 对象定义服务操作请求的正文标头元素。

注意

除非下面另有说明,否则需要所有请求元素。

请求正文元素

元素 说明 数据类型
用户 包含更新的用户信息的用户对象。

此操作使用传递的用户对象的内容覆盖现有用户数据。 此操作执行完全更新,而不是部分更新。 User 对象必须包含上次写入 User 对象的时间戳值。 若要确保时间戳包含正确的值,请调用 GetUser 操作。 然后,可以根据需要更新用户数据,并调用 UpdateUser
用户

请求标头元素

元素 说明 数据类型
Authorization OAuth 访问令牌,表示有权Microsoft广告帐户的用户的凭据。 请确保令牌的前缀为“持有者”,这是正确身份验证所必需的。

有关详细信息,请参阅 使用 OAuth 进行身份验证
string
DeveloperToken 用于访问必应广告 API 的开发人员令牌。

有关详细信息,请参阅 获取开发人员令牌
string
Password 此元素保留供内部使用,将从 API 的未来版本中删除。 必须使用 AuthenticationToken 元素来设置用户凭据。 string
UserName 此元素保留供内部使用,将从 API 的未来版本中删除。 必须使用 AuthenticationToken 元素来设置用户凭据。 string

响应元素

UpdateUserResponse 对象定义服务操作响应的正文标头元素。 元素的返回顺序与 响应 JSON 中所示的顺序相同。

响应正文元素

元素 说明 数据类型
LastModifiedTime 用户上次更新的日期和时间。 该值以协调世界时 (UTC) 表示。

日期和时间值反映服务器的日期和时间,而不是客户端。 有关日期和时间格式的信息,请参阅 基元 XML 数据类型中的 dateTime 条目。
dateTime

响应标头元素

元素 说明 数据类型
跟踪 ID 包含 API 调用详细信息的日志条目的标识符。 string

请求 JSON

此模板由显示 JSON 请求的 正文标头 元素的工具生成。 有关可用于此服务操作的支持类型,请参阅上面的 请求正文元素 参考。

{
  "User": {
    "AuthenticationToken": "ValueHere",
    "ContactInfo": {
      "Address": {
        "BusinessName": "ValueHere",
        "City": "ValueHere",
        "CountryCode": "ValueHere",
        "Id": "LongValueHere",
        "Line1": "ValueHere",
        "Line2": "ValueHere",
        "Line3": "ValueHere",
        "Line4": "ValueHere",
        "PostalCode": "ValueHere",
        "StateOrProvince": "ValueHere",
        "TimeStamp": "ValueHere"
      },
      "ContactByPhone": "ValueHere",
      "ContactByPostalMail": "ValueHere",
      "Email": "ValueHere",
      "EmailFormat": "ValueHere",
      "Fax": "ValueHere",
      "HomePhone": "ValueHere",
      "Id": "LongValueHere",
      "Mobile": "ValueHere",
      "Phone1": "ValueHere",
      "Phone2": "ValueHere"
    },
    "CustomerId": "LongValueHere",
    "ForwardCompatibilityMap": [
      {
        "key": "ValueHere",
        "value": "ValueHere"
      }
    ],
    "Id": "LongValueHere",
    "JobTitle": "ValueHere",
    "LastModifiedByUserId": "LongValueHere",
    "LastModifiedTime": "ValueHere",
    "Lcid": "ValueHere",
    "Name": {
      "FirstName": "ValueHere",
      "LastName": "ValueHere",
      "MiddleInitial": "ValueHere"
    },
    "Password": "ValueHere",
    "SecretAnswer": "ValueHere",
    "SecretQuestion": "ValueHere",
    "TimeStamp": "ValueHere",
    "UserLifeCycleStatus": "ValueHere",
    "UserName": "ValueHere"
  }
}

响应 JSON

此模板由一个工具生成,用于显示 JSON 响应的 正文标头 元素。

{
  "LastModifiedTime": "ValueHere"
}

代码语法

若要通过 SDK 调用 REST API,需要将 SDK 升级到特定版本并配置系统参数。示例语法可用于 必应广告 SDK。 有关更多示例,请参阅 必应广告 API 代码示例

public async Task<UpdateUserResponse> UpdateUserAsync(
	User user)
{
	var request = new UpdateUserRequest
	{
		User = user
	};

	return (await CustomerManagementService.CallAsync((s, r) => s.UpdateUserAsync(r), request));
}
static UpdateUserResponse updateUser(
	User user) throws RemoteException, Exception
{
	UpdateUserRequest request = new UpdateUserRequest();

	request.setUser(user);

	return CustomerManagementService.getService().updateUser(request);
}
static function UpdateUser(
	$user)
{

	$GLOBALS['Proxy'] = $GLOBALS['CustomerManagementProxy'];

	$request = new UpdateUserRequest();

	$request->User = $user;

	return $GLOBALS['CustomerManagementProxy']->GetService()->UpdateUser($request);
}
response=customermanagement_service.UpdateUser(
	User=User)