Google Ads 관리자는 Google Ads에 대한 사용자 액세스 초대를 관리할 수 있습니다. 있습니다.
사용자 초대
다음 과정의 일부로 새 사용자에게 이메일 초대를 보낼 수 있습니다.
Google Ads 계정의 액세스 권한 관리에 대해 자세히 알아보세요.
이렇게 하려면 새로운
CustomerUserAccessInvitation
드림
사용
MutateCustomerUserAccessInvitation
메서드
CustomerUserAccessInvitationService
입니다.
이메일 초대장은 수동으로
초대를 받은 사용자가 수락합니다. 또한 초대장은
사용자가 보조 이메일 주소를 사용하여 수락했습니다. 최대 24일이
시간이 대기 중에서 변경됩니다.
다음 코드 스니펫은 초대를 보내는 방법을 보여줍니다.
자바
// Constructs an access invitation. CustomerUserAccessInvitation invitation = CustomerUserAccessInvitation.newBuilder() .setEmailAddress(emailAddress) .setAccessRole(accessRole) .build(); // Constructs an operation to send the invitation. CustomerUserAccessInvitationOperation operation = CustomerUserAccessInvitationOperation.newBuilder().setCreate(invitation).build(); // Creates a CustomerUserAccessInvitationServiceClient. try (CustomerUserAccessInvitationServiceClient client = googleAdsClient.getLatestVersion().createCustomerUserAccessInvitationServiceClient()) { // Issues the request. MutateCustomerUserAccessInvitationResponse response = client.mutateCustomerUserAccessInvitation(String.valueOf(customerId), operation); // Prints some information about the result. System.out.printf( "Customer user access invitation was sent for customerId = " + "%d to email address = '%s' and access role = '%s'. The invitation resource " + "name is '%s'.%n", customerId, emailAddress, accessRole, response.getResult().getResourceName()); }
C#
MutateCustomerUserAccessInvitationRequest invitationRequest = new MutateCustomerUserAccessInvitationRequest() { CustomerId = customerId.ToString(), Operation = new CustomerUserAccessInvitationOperation() { Create = new CustomerUserAccessInvitation() { EmailAddress = emailAddress, AccessRole = accessRole }, } }; try { var response = service.MutateCustomerUserAccessInvitation(invitationRequest); Console.WriteLine("Customer user access invitation was sent for customerId = " + "{0} to email address = {1} and access role = {2}. The invitation resource " + "name is {3}.", customerId, emailAddress, accessRole, response.Result.ResourceName); } catch (GoogleAdsException e) { Console.WriteLine("Failure:"); Console.WriteLine($"Message: {e.Message}"); Console.WriteLine($"Failure: {e.Failure}"); Console.WriteLine($"Request ID: {e.RequestId}"); throw; }
PHP
// Creates a customer user access invitation. $customerUserAccessInvitation = new CustomerUserAccessInvitation([ 'email_address' => $emailAddress, 'access_role' => AccessRole::value($accessRole) ]); // Creates a customer user access invitation operation. $customerUserAccessInvitationOperation = new CustomerUserAccessInvitationOperation(); $customerUserAccessInvitationOperation->setCreate($customerUserAccessInvitation); // Issues a mutate request to send the customer user access invitation and prints its // information. $customerUserAccessInvitationServiceClient = $googleAdsClient->getCustomerUserAccessInvitationServiceClient(); $response = $customerUserAccessInvitationServiceClient->mutateCustomerUserAccessInvitation( MutateCustomerUserAccessInvitationRequest::build( $customerId, $customerUserAccessInvitationOperation ) ); printf( "Customer user access invitation with resource name '%s' was sent from customer " . "ID %d to email address '%s' with access role '%s'.%s", $response->getResult()->getResourceName(), $customerId, $emailAddress, $accessRole, PHP_EOL );
Python
invitation_operation = client.get_type( "CustomerUserAccessInvitationOperation" ) invitation = invitation_operation.create invitation.email_address = email_address invitation.access_role = client.enums.AccessRoleEnum[access_role].value response = service.mutate_customer_user_access_invitation( customer_id=customer_id, operation=invitation_operation ) print( "Customer user access invitation was sent for " f"customer ID: '{customer_id}', " f"email address {email_address}, and " f"access role {access_role}. The invitation resource name is: " f"{response.result.resource_name}" )
Ruby
operation = client.operation.create_resource.customer_user_access_invitation do |inv| inv.email_address = email_address inv.access_role = access_role end # Issues a mutate request to get the response. response = client.service.customer_user_access_invitation.mutate_customer_user_access_invitation( customer_id: customer_id, operation: operation, ) # Prints out information of the created invitation. puts "Customer user access invitation was sent for customerId = #{customer_id} " \ "email address = '#{email_address}', " \ "access role = '#{access_role}'."
Perl
sub invite_user_with_access_role { my ($api_client, $customer_id, $email_address, $access_role) = @_; # Create the user access invitation. my $user_access_invitation = Google::Ads::GoogleAds::V17::Resources::CustomerUserAccessInvitation->new({ emailAddress => $email_address, accessRole => $access_role }); # Create the user access invitation operation. my $invitation_operation = Google::Ads::GoogleAds::V17::Services::CustomerUserAccessInvitationService::CustomerUserAccessInvitationOperation ->new({create => $user_access_invitation}); # Send the user access invitation. my $invitation_response = $api_client->CustomerUserAccessInvitationService()->mutate({ customerId => $customer_id, operation => $invitation_operation }); printf "Customer user access invitation was sent for customerId = %d " . "to email address = '%s' and access role = '%s'. " . "The invitation resource name is '%s'.\n", $customer_id, $email_address, $access_role, $invitation_response->{result}{resourceName}; return 1; }
초대 취소
다음 명령어를 사용하여 CustomerUserAccessInvitation
를 삭제하면 초대를 취소할 수 있습니다.
MutateCustomerUserAccessInvitation
메서드
CustomerUserAccessInvitationService
입니다.
사용자 초대 검색
대기 중인 사용자 초대 목록을 검색하려면
Google Ads 쿼리 언어 문을 사용하여 모든
항목 CustomerUserAccessInvitation
개
고객 ID와 연결되어 있습니다. 일반적인 쿼리는 다음과 같습니다.
SELECT
customer_user_access_invitation.invitation_id,
customer_user_access_invitation.email_address,
customer_user_access_invitation.access_role,
customer_user_access_invitation.invitation_status,
customer_user_access_invitation.creation_date_time
FROM
customer_user_access_invitation
필터링 조건을 추가하여 초대의 하위 집합을 검색할 수 있습니다.
예를 들어 일반적인 사용 사례는 대기 중인 사용자 목록을 검색하는 것입니다.
초대장 이렇게 하려면
customer_user_access_invitation.invitation_status = PENDING
: