Zadbaj o dobrą organizację dzięki kolekcji
Zapisuj i kategoryzuj treści zgodnie ze swoimi preferencjami.
Po przypisaniu roli administratora do zasobu możesz utworzyć użytkownika
zarówno tych powiązanych, jak i podrzędnych.
Użytkowników tworzy się za pomocą metody user.create.
Z adresem e-mail nowego użytkownika musi być powiązane konto Google, na którym można:
dla istniejącego adresu e-mail. Użytkownik
utworzony zasób musi też zawierać co najmniej 1 przypisaną rolę użytkownika.
Oto przykład tworzenia nowego użytkownika ze standardowym dostępem
reklamodawca:
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']);
[[["Łatwo zrozumieć","easyToUnderstand","thumb-up"],["Rozwiązało to mój problem","solvedMyProblem","thumb-up"],["Inne","otherUp","thumb-up"]],[["Brak potrzebnych mi informacji","missingTheInformationINeed","thumb-down"],["Zbyt skomplikowane / zbyt wiele czynności do wykonania","tooComplicatedTooManySteps","thumb-down"],["Nieaktualne treści","outOfDate","thumb-down"],["Problem z tłumaczeniem","translationIssue","thumb-down"],["Problem z przykładami/kodem","samplesCodeIssue","thumb-down"],["Inne","otherDown","thumb-down"]],["Ostatnia aktualizacja: 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"]]