UpdateUser Service Operation - Customer Management
Updates the personal and business contact information about a Microsoft Advertising user.
Note
Only a user with Super Admin or Standard credentials can update users. For more information, see the User Roles technical guide.
Because the update operation requires the time stamp of the most recent user write operation, you must first call the GetUser operation. The GetUser operation returns the user's data, which includes the time stamp. The update call will fail if you use an old time stamp e.g., the user data is updated by your application or another application after you obtained the time stamp.
Request Elements
The UpdateUserRequest object defines the body and header elements of the service operation request. The elements must be in the same order as shown in the Request SOAP.
Note
Unless otherwise noted below, all request elements are required.
Request Body Elements
Element | Description | Data Type |
---|---|---|
User | The user object that contains the updated user information. This operation overwrites the existing user data with the contents of the user object that you pass. This operation performs a full update, not a partial update. The User object must contain the time stamp value from the last time that the User object was written to. To ensure that the time stamp contains the correct value, call the GetUser operation. You can then update the user data as appropriate, and call UpdateUser. |
User |
Request Header Elements
Element | Description | Data Type |
---|---|---|
AuthenticationToken | The OAuth access token that represents the credentials of a user who has permissions to Microsoft Advertising accounts. For more information see Authentication with OAuth. |
string |
DeveloperToken | The developer token used to access the Bing Ads API. For more information see Get a Developer Token. |
string |
Password | This element is reserved for internal use and will be removed from a future version of the API. You must use the AuthenticationToken element to set user credentials. | string |
UserName | This element is reserved for internal use and will be removed from a future version of the API. You must use the AuthenticationToken element to set user credentials. | string |
Response Elements
The UpdateUserResponse object defines the body and header elements of the service operation response. The elements are returned in the same order as shown in the Response SOAP.
Response Body Elements
Element | Description | Data Type |
---|---|---|
LastModifiedTime | The date and time that the user was last updated. The value is in Coordinated Universal Time (UTC). The date and time value reflects the date and time at the server, not the client. For information about the format of the date and time, see the dateTime entry in Primitive XML Data Types. |
dateTime |
Response Header Elements
Element | Description | Data Type |
---|---|---|
TrackingId | The identifier of the log entry that contains the details of the API call. | string |
Request SOAP
This template was generated by a tool to show the order of the body and header elements for the SOAP request. For supported types that you can use with this service operation, see the Request Body Elements reference above.
<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:e589="https://bingads.microsoft.com/Customer/v13/Entities" i:nil="false">
<e589:ContactInfo i:nil="false">
<e589:Address i:nil="false">
<e589:City i:nil="false">ValueHere</e589:City>
<e589:CountryCode i:nil="false">ValueHere</e589:CountryCode>
<e589:Id i:nil="false">ValueHere</e589:Id>
<e589:Line1 i:nil="false">ValueHere</e589:Line1>
<e589:Line2 i:nil="false">ValueHere</e589:Line2>
<e589:Line3 i:nil="false">ValueHere</e589:Line3>
<e589:Line4 i:nil="false">ValueHere</e589:Line4>
<e589:PostalCode i:nil="false">ValueHere</e589:PostalCode>
<e589:StateOrProvince i:nil="false">ValueHere</e589:StateOrProvince>
<e589:TimeStamp i:nil="false">ValueHere</e589:TimeStamp>
<e589:BusinessName i:nil="false">ValueHere</e589:BusinessName>
</e589:Address>
<e589:ContactByPhone i:nil="false">ValueHere</e589:ContactByPhone>
<e589:ContactByPostalMail i:nil="false">ValueHere</e589:ContactByPostalMail>
<e589:Email i:nil="false">ValueHere</e589:Email>
<e589:EmailFormat i:nil="false">ValueHere</e589:EmailFormat>
<e589:Fax i:nil="false">ValueHere</e589:Fax>
<e589:HomePhone i:nil="false">ValueHere</e589:HomePhone>
<e589:Id i:nil="false">ValueHere</e589:Id>
<e589:Mobile i:nil="false">ValueHere</e589:Mobile>
<e589:Phone1 i:nil="false">ValueHere</e589:Phone1>
<e589:Phone2 i:nil="false">ValueHere</e589:Phone2>
</e589:ContactInfo>
<e589:CustomerId i:nil="false">ValueHere</e589:CustomerId>
<e589:Id i:nil="false">ValueHere</e589:Id>
<e589:JobTitle i:nil="false">ValueHere</e589:JobTitle>
<e589:LastModifiedByUserId i:nil="false">ValueHere</e589:LastModifiedByUserId>
<e589:LastModifiedTime i:nil="false">ValueHere</e589:LastModifiedTime>
<e589:Lcid i:nil="false">ValueHere</e589:Lcid>
<e589:Name i:nil="false">
<e589:FirstName i:nil="false">ValueHere</e589:FirstName>
<e589:LastName i:nil="false">ValueHere</e589:LastName>
<e589:MiddleInitial i:nil="false">ValueHere</e589:MiddleInitial>
</e589:Name>
<e589:Password i:nil="false">ValueHere</e589:Password>
<e589:SecretAnswer i:nil="false">ValueHere</e589:SecretAnswer>
<e589:SecretQuestion>ValueHere</e589:SecretQuestion>
<e589:UserLifeCycleStatus i:nil="false">ValueHere</e589:UserLifeCycleStatus>
<e589:TimeStamp i:nil="false">ValueHere</e589:TimeStamp>
<e589:UserName i:nil="false">ValueHere</e589:UserName>
<e589:ForwardCompatibilityMap xmlns:e590="http://schemas.datacontract.org/2004/07/System.Collections.Generic" i:nil="false">
<e590:KeyValuePairOfstringstring>
<e590:key i:nil="false">ValueHere</e590:key>
<e590:value i:nil="false">ValueHere</e590:value>
</e590:KeyValuePairOfstringstring>
</e589:ForwardCompatibilityMap>
<e589:AuthenticationToken i:nil="false">ValueHere</e589:AuthenticationToken>
</User>
</UpdateUserRequest>
</s:Body>
</s:Envelope>
Response SOAP
This template was generated by a tool to show the order of the body and header elements for the SOAP response.
<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>
Code Syntax
The example syntax can be used with Bing Ads SDKs. See Bing Ads API Code Examples for more examples.
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)
Requirements
Service: CustomerManagementService.svc v13
Namespace: https://bingads.microsoft.com/Customer/v13
Request Url
https://clientcenter.api.bingads.microsoft.com/CustomerManagement/v13/User
Request Elements
The UpdateUserRequest object defines the body and header elements of the service operation request.
Note
Unless otherwise noted below, all request elements are required.
Request Body Elements
Element | Description | Data Type |
---|---|---|
User | The user object that contains the updated user information. This operation overwrites the existing user data with the contents of the user object that you pass. This operation performs a full update, not a partial update. The User object must contain the time stamp value from the last time that the User object was written to. To ensure that the time stamp contains the correct value, call the GetUser operation. You can then update the user data as appropriate, and call UpdateUser. |
User |
Request Header Elements
Element | Description | Data Type |
---|---|---|
Authorization | The OAuth access token that represents the credentials of a user who has permissions to Microsoft Advertising accounts. Please ensure that the token is prefixed with "Bearer ", this is necessary for proper authentication. For more information see Authentication with OAuth. |
string |
DeveloperToken | The developer token used to access the Bing Ads API. For more information see Get a Developer Token. |
string |
Password | This element is reserved for internal use and will be removed from a future version of the API. You must use the AuthenticationToken element to set user credentials. | string |
UserName | This element is reserved for internal use and will be removed from a future version of the API. You must use the AuthenticationToken element to set user credentials. | string |
Response Elements
The UpdateUserResponse object defines the body and header elements of the service operation response. The elements are returned in the same order as shown in the Response JSON.
Response Body Elements
Element | Description | Data Type |
---|---|---|
LastModifiedTime | The date and time that the user was last updated. The value is in Coordinated Universal Time (UTC). The date and time value reflects the date and time at the server, not the client. For information about the format of the date and time, see the dateTime entry in Primitive XML Data Types. |
dateTime |
Response Header Elements
Element | Description | Data Type |
---|---|---|
TrackingId | The identifier of the log entry that contains the details of the API call. | string |
Request JSON
This template was generated by a tool to show the body and header elements for the JSON request. For supported types that you can use with this service operation, see the Request Body Elements reference above.
{
"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"
}
}
Response JSON
This template was generated by a tool to show the body and header elements for the JSON response.
{
"LastModifiedTime": "ValueHere"
}
Code Syntax
To call REST API through SDKs, you need to upgrade SDK to a certain version and configure the system parameters.The example syntax can be used with Bing Ads SDKs. See Bing Ads API Code Examples for more examples.
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)