Yeni kullanıcının e-posta adresinin, Google Hesabı'nın
mevcut bir e-posta adresi için oluşturulmuş olmalıdır. Kullanıcı
oluşturulan kaynak, en az bir atanmış kullanıcı rolü içermelidir.
Aşağıda,
reklamveren:
Java
// Create the user structure.Useruser=newUser();user.setEmail(email-address);user.setDisplayName(display-name);// Create the assigned user role structure.AssignedUserRoleassignedUserRole=newAssignedUserRole();assignedUserRole.setAdvertiserId(advertiser-id);assignedUserRole.setUserRole("STANDARD");// Add assigned user role list to the user.user.setAssignedUserRoles(ImmutableList.of(assignedUserRole));// Configure the create request.Users.Createrequest=service.users().create(user);// Create the user.Userresponse=request.execute();// Display the user.System.out.printf("User %s was created with email %s.",response.getName(),response.getEmail());
Python
# Create a user object.user_obj={'email':email-address,'displayName':display-name,'assignedUserRoles':[{'advertiserId':advertiser-id,'userRole':'STANDARD'}]}# Build request.request=service.users().create(body=user_obj)# Execute request.response=request.execute()# Display the new user.print('User %s was created with email %s.'%(response['name'],response['email']))
PHP
// Create the user structure.$user = new Google_Service_DisplayVideo_User();$user->setEmail(email-address);$user->setDisplayName(display-name);// Create the assigned user role structure.$assignedUserRole = new Google_Service_DisplayVideo_AssignedUserRole();$assignedUserRole->setAdvertiserId(advertiser-id);$assignedUserRole->setUserRole('STANDARD');// Add assigned user role list to the user.$user->setAssignedUserRoles(array($assignedUserRole));// Call the API, creating the user with the assigned user role.$result = $this->service->users->create($user);// Display the user.printf( 'User %s was created with email %s.\n', $result['name'], $result['email']);
[[["Anlaması kolay","easyToUnderstand","thumb-up"],["Sorunumu çözdü","solvedMyProblem","thumb-up"],["Diğer","otherUp","thumb-up"]],[["İhtiyacım olan bilgiler yok","missingTheInformationINeed","thumb-down"],["Çok karmaşık / çok fazla adım var","tooComplicatedTooManySteps","thumb-down"],["Güncel değil","outOfDate","thumb-down"],["Çeviri sorunu","translationIssue","thumb-down"],["Örnek veya kod sorunu","samplesCodeIssue","thumb-down"],["Diğer","otherDown","thumb-down"]],["Son güncelleme tarihi: 2024-09-10 UTC."],[[["Admins can create users with access to resources they manage, including sub-resources."],["New users require a Google Account and at least one assigned user role for access."],["The `user.create` method enables user creation, potentially adding roles to existing, inaccessible Display & Video 360 users without error."],["Code samples in Java, Python, and PHP demonstrate creating a standard access user for an advertiser."]]],["Users with the Admin role can create new users via the `user.create` method. A new user's email must have a corresponding Google Account and at least one assigned user role. The process involves creating a user object, assigning a user role (e.g., STANDARD), and then executing the creation request. If the email already belongs to a user, roles will be added to it. The examples provided show creating a user with standard access to an advertiser in Java, Python and PHP.\n"]]