SendUserInvitation Service Operation - Customer Management

Sends an email invitation for a user to sign up for Microsoft Advertising. The invitation limits account access and permissions.

Note

Only a user with Super Admin or Standard credentials can send user invitations. A Standard user cannot invite a Super Admin. For more information, see the User Roles technical guide.

Important

When the invitation is sent, you can opt to limit user access to a subset of advertiser accounts that are directly under your customer. If an agency hierarchy is setup (now or in the future) under the customer where the user is invited, and if you do not limit access to specific accounts, the user will have access to all accounts in the hierarchy.

It is possible to have multiple pending invitations sent to the same email address, which have not yet expired. It is also possible for those invitations to have specified different user roles, for example if you sent an invitation with an incorrect user role and then sent a second invitation with the correct user role. The recipient can accept any of the invitations, and can sign up with credentials that differ from the invitation email address. Microsoft Advertising users can accept invitations to multiple customers with the same credentials. For more information, see the Multi-User Credentials technical guide.

You can search for pending invitations by invitation ID and find out whether or not the invitation has been accepted or has expired. The SearchUserInvitations operation returns all pending invitations, whether or not they have expired. Accepted invitations are not included in the SearchUserInvitations response.

After the invitation has been accepted, you can call GetUsersInfo and GetUser to access the Microsoft Advertising user details. However, since a recipient can accept the invitation and sign up with credentials that differ from the invitation email address, you cannot determine with certainty the mapping from a UserInvitation to a User or UserInfo object. With the user ID returned by GetUsersInfo or GetUser, you can call DeleteUser to remove the user as needed. The Bing Ads API does not support any operations to delete pending user invitations. After you invite a user, the only way to cancel the invitation is through the Microsoft Advertising web application. You can find both pending and accepted invitations in the Users section of Accounts & Billing.

Request Elements

The SendUserInvitationRequest 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
UserInvitation The user invitation to send. UserInvitation

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 SendUserInvitationResponse 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
UserInvitationId A system-generated identifier for the user invitation that was sent. long

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">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:e263="https://bingads.microsoft.com/Customer/v13/Entities" i:nil="false">
        <e263:Id>ValueHere</e263:Id>
        <e263:FirstName i:nil="false">ValueHere</e263:FirstName>
        <e263:LastName i:nil="false">ValueHere</e263:LastName>
        <e263:Email i:nil="false">ValueHere</e263:Email>
        <e263:CustomerId>ValueHere</e263:CustomerId>
        <e263:RoleId>ValueHere</e263:RoleId>
        <e263:AccountIds i:nil="false" xmlns:a1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
          <a1:long>ValueHere</a1:long>
        </e263:AccountIds>
        <e263:ExpirationDate>ValueHere</e263:ExpirationDate>
        <e263:Lcid>ValueHere</e263:Lcid>
      </UserInvitation>
    </SendUserInvitationRequest>
  </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>
    <SendUserInvitationResponse xmlns="https://bingads.microsoft.com/Customer/v13">
      <UserInvitationId>ValueHere</UserInvitationId>
    </SendUserInvitationResponse>
  </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<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)

Requirements

Service: CustomerManagementService.svc v13
Namespace: https://bingads.microsoft.com/Customer/v13