共用方式為


SendUserInvitation 服務作業 - 客戶管理

傳送電子郵件邀請,讓用戶註冊 Microsoft Advertising。 邀請會限制帳戶存取權和許可權。

注意事項

只有具有超級 管理員 或標準認證的使用者可以傳送用戶邀請。 標準用戶無法邀請超級 管理員。如需詳細資訊,請參閱使用者角色技術指南。

重要事項

傳送邀請時,您可以選擇限制使用者存取直接在客戶底下的廣告客戶子集。 如果 機構階層 現在或未來) 邀請使用者的客戶之下設定 (,而且如果您不限制特定帳戶的存取權,使用者將可存取階層中的所有帳戶。

可能會有多個擱置的邀請傳送至尚未過期的相同電子郵件位址。 這些邀請也可以指定不同的使用者角色,例如,如果您傳送具有不正確使用者角色的邀請,然後傳送具有正確使用者角色的第二個邀請。 收件者可以接受任何邀請,而且可以使用與邀請電子郵件位址不同的認證進行註冊。 Microsoft Advertising 用戶可以接受邀請給具有相同認證的多位客戶。 如需詳細資訊,請參閱 多使用者認證 技術指南。

您可以依 邀請標識 子搜尋擱置的邀請,並瞭解邀請是否已接受或已過期。 SearchUserInvitations 作業會傳回所有擱置的邀請,無論邀請是否已過期。 接受的邀請不包含在 SearchUserInvitations 回應中。

接受邀請之後,您可以呼叫 GetUsersInfoGetUser 來存取 Microsoft Advertising 使用者詳細數據。 不過,由於收件者可以接受邀請,並以與邀請電子郵件位址不同的認證註冊,因此您無法確定 從UserInvitationUserUserInfo 對象的對應。 使用 GetUsersInfoGetUser 傳回的使用者識別碼,您可以呼叫 DeleteUser 視需要移除使用者。 Bing 廣告 API 不支援刪除擱置中使用者邀請的任何作業。 在您邀請用戶之後,取消邀請的唯一方式是透過 Microsoft Advertising Web 應用程式。 您可以在 [帳戶 & 帳單] 的 [使用者] 區段中找到擱置和接受的邀請。

要求專案

SendUserInvitationRequest 物件會定義服務作業要求的主體標頭元素。 元素的順序必須與 要求SOAP中所示的順序相同。

注意事項

除非下面另有說明,否則所有要求專案都是必要的。

要求本文專案

元素 描述 資料類型
UserInvitation 要傳送的用戶邀請。 UserInvitation

要求標頭元素

元素 描述 資料類型
AuthenticationToken OAuth 存取令牌,代表具有 Microsoft Advertising 帳戶許可權之用戶的認證。

如需詳細資訊,請 參閱使用 OAuth 進行驗證
string
DeveloperToken 用來存取 Bing 廣告 API 的開發人員令牌。

如需詳細資訊 ,請參閱取得開發人員令牌
string
密碼 此元素會保留供內部使用,並會從未來的 API 版本中移除。 您必須使用 AuthenticationToken 元素來設定用戶認證。 string
UserName 此元素會保留供內部使用,並會從未來的 API 版本中移除。 您必須使用 AuthenticationToken 元素來設定用戶認證。 string

Response 元素

SendUserInvitationResponse 物件會定義服務作業響應的主體標頭元素。 這些元素的傳回順序與 回應SOAP中所示的順序相同。

回應本文專案

元素 描述 資料類型
UserInvitationId 已傳送之使用者邀請的系統產生標識碼。

回應標頭元素

元素 描述 資料類型
TrackingId 包含 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:e251="https://bingads.microsoft.com/Customer/v13/Entities" i:nil="false">
        <e251:Id>ValueHere</e251:Id>
        <e251:FirstName i:nil="false">ValueHere</e251:FirstName>
        <e251:LastName i:nil="false">ValueHere</e251:LastName>
        <e251:Email i:nil="false">ValueHere</e251:Email>
        <e251:CustomerId>ValueHere</e251:CustomerId>
        <e251:RoleId>ValueHere</e251:RoleId>
        <e251:AccountIds i:nil="false" xmlns:a1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
          <a1:long>ValueHere</a1:long>
        </e251:AccountIds>
        <e251:ExpirationDate>ValueHere</e251:ExpirationDate>
        <e251:Lcid>ValueHere</e251: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>

程序代碼語法

範例語法可以與 Bing 廣告 SDK 搭配使用。 如需更多範例,請參閱 Bing 廣告 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