SendUserInvitation 服务操作 - 客户管理

发送电子邮件邀请用户注册Microsoft广告。 邀请限制帐户访问权限和权限。

注意

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

重要

发送邀请后,可以选择限制用户访问客户直接下属的一部分广告客户帐户。 如果现在或将来 () 在邀请用户的客户下设置 代理层次结构 ,并且不限制对特定帐户的访问权限,则用户将有权访问层次结构中的所有帐户。

可以将多个挂起的邀请发送到尚未过期的同一电子邮件地址。 这些邀请也可以指定不同的用户角色,例如,如果使用不正确的用户角色发送了邀请,然后使用正确的用户角色发送了第二个邀请。 收件人可以接受任何邀请,并且可以使用与邀请电子邮件地址不同的凭据进行注册。 Microsoft广告用户可以接受多个客户具有相同凭据的邀请。 有关详细信息,请参阅 多用户凭据 技术指南。

可以按邀请 ID 搜索挂起的 邀请 ,并了解邀请是否已接受或已过期。 SearchUserInvitations 操作将返回所有挂起的邀请,无论它们是否已过期。 接受的邀请不包括在 SearchUserInvitations 响应中。

接受邀请后,可以调用 GetUsersInfoGetUser 来访问Microsoft广告用户详细信息。 但是,由于收件人可以接受邀请并使用不同于邀请电子邮件地址的凭据进行注册,因此无法确定从 UserInvitationUserUserInfo 对象的映射。 使用 GetUsersInfoGetUser 返回的用户 ID 后,可以根据需要调用 DeleteUser 以删除该用户。 必应广告 API 不支持删除挂起的用户邀请的任何操作。 邀请用户后,取消邀请的唯一方法是通过 Microsoft Advertising Web 应用程序。 可以在帐户 & 计费“用户”部分找到挂起的和已接受的邀请。

请求元素

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

注意

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

请求正文元素

元素 说明 数据类型
UserInvitation 要发送的用户邀请。 UserInvitation

请求标头元素

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

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

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

响应元素

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

响应正文元素

元素 说明 数据类型
UserInvitationId 已发送的用户邀请的系统生成的标识符。 long

响应标头元素

元素 说明 数据类型
跟踪 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">SendUserInvitation</Action>
    <AuthenticationToken i:nil="false">ValueHere</AuthenticationToken>
    <DeveloperToken i:nil="false">ValueHere</DeveloperToken>
  </s:Header>
  <s:Body>
    <SendUserInvitationRequest xmlns="https://bingads.microsoft.com/Customer/v13">
      <UserInvitation xmlns:e93="https://bingads.microsoft.com/Customer/v13/Entities" i:nil="false">
        <e93:Id>ValueHere</e93:Id>
        <e93:FirstName i:nil="false">ValueHere</e93:FirstName>
        <e93:LastName i:nil="false">ValueHere</e93:LastName>
        <e93:Email i:nil="false">ValueHere</e93:Email>
        <e93:CustomerId>ValueHere</e93:CustomerId>
        <e93:RoleId>ValueHere</e93:RoleId>
        <e93:AccountIds i:nil="false" xmlns:a1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
          <a1:long>ValueHere</a1:long>
        </e93:AccountIds>
        <e93:ExpirationDate>ValueHere</e93:ExpirationDate>
        <e93:Lcid>ValueHere</e93:Lcid>
      </UserInvitation>
    </SendUserInvitationRequest>
  </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>
    <SendUserInvitationResponse xmlns="https://bingads.microsoft.com/Customer/v13">
      <UserInvitationId>ValueHere</UserInvitationId>
    </SendUserInvitationResponse>
  </s:Body>
</s:Envelope>

代码语法

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

public async Task<SendUserInvitationResponse> SendUserInvitationAsync(
	UserInvitation userInvitation)
{
	var request = new SendUserInvitationRequest
	{
		UserInvitation = userInvitation
	};

	return (await CustomerManagementService.CallAsync((s, r) => s.SendUserInvitationAsync(r), request));
}
static SendUserInvitationResponse sendUserInvitation(
	UserInvitation userInvitation) throws RemoteException, Exception
{
	SendUserInvitationRequest request = new SendUserInvitationRequest();

	request.setUserInvitation(userInvitation);

	return CustomerManagementService.getService().sendUserInvitation(request);
}
static function SendUserInvitation(
	$userInvitation)
{

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

	$request = new SendUserInvitationRequest();

	$request->UserInvitation = $userInvitation;

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

要求

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

请求 URL

https://clientcenter.api.bingads.microsoft.com/CustomerManagement/v13/UserInvitation/Send

请求元素

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

注意

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

请求正文元素

元素 说明 数据类型
UserInvitation 要发送的用户邀请。 UserInvitation

请求标头元素

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

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

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

响应元素

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

响应正文元素

元素 说明 数据类型
UserInvitationId 已发送的用户邀请的系统生成的标识符。 long

响应标头元素

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

请求 JSON

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

{
  "UserInvitation": {
    "AccountIds": [
      "LongValueHere"
    ],
    "CustomerId": "LongValueHere",
    "Email": "ValueHere",
    "ExpirationDate": "ValueHere",
    "FirstName": "ValueHere",
    "Id": "LongValueHere",
    "LastName": "ValueHere",
    "Lcid": "ValueHere",
    "RoleId": IntValueHere
  }
}

响应 JSON

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

{
  "UserInvitationId": "LongValueHere"
}

代码语法

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

public async Task<SendUserInvitationResponse> SendUserInvitationAsync(
	UserInvitation userInvitation)
{
	var request = new SendUserInvitationRequest
	{
		UserInvitation = userInvitation
	};

	return (await CustomerManagementService.CallAsync((s, r) => s.SendUserInvitationAsync(r), request));
}
static SendUserInvitationResponse sendUserInvitation(
	UserInvitation userInvitation) throws RemoteException, Exception
{
	SendUserInvitationRequest request = new SendUserInvitationRequest();

	request.setUserInvitation(userInvitation);

	return CustomerManagementService.getService().sendUserInvitation(request);
}
static function SendUserInvitation(
	$userInvitation)
{

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

	$request = new SendUserInvitationRequest();

	$request->UserInvitation = $userInvitation;

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