يجب أن يكون لعنوان البريد الإلكتروني للمستخدم الجديد حساب Google مقابل، والذي يمكن أن
أن يتم إنشائها لعنوان بريد إلكتروني حالي. المستخدِم
المورد الذي تم إنشاؤه يجب أن يتضمن أيضًا دور مستخدم واحدًا على الأقل.
في ما يلي مثال على كيفية إنشاء مستخدم جديد لديه إذن وصول عادي إلى
المعلِن:
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']);
تاريخ التعديل الأخير: 2024-09-10 (حسب التوقيت العالمي المتفَّق عليه)
[[["يسهُل فهم المحتوى.","easyToUnderstand","thumb-up"],["ساعَدني المحتوى في حلّ مشكلتي.","solvedMyProblem","thumb-up"],["غير ذلك","otherUp","thumb-up"]],[["لا يحتوي على المعلومات التي أحتاج إليها.","missingTheInformationINeed","thumb-down"],["الخطوات معقدة للغاية / كثيرة جدًا.","tooComplicatedTooManySteps","thumb-down"],["المحتوى قديم.","outOfDate","thumb-down"],["ثمة مشكلة في الترجمة.","translationIssue","thumb-down"],["مشكلة في العيّنات / التعليمات البرمجية","samplesCodeIssue","thumb-down"],["غير ذلك","otherDown","thumb-down"]],["تاريخ التعديل الأخير: 2024-09-10 (حسب التوقيت العالمي المتفَّق عليه)"],[[["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"]]