Kể từ ngày 8 tháng 9 năm 2025, mỗi mục hàng mới sẽ cần phải khai báo xem mục hàng đó có phân phát quảng cáo chính trị ở Liên minh Châu Âu (EU) hay không. Display & Video 360 API và các tệp SDF được tải lên mà không cung cấp thông tin khai báo sẽ không thành công. Hãy xem trang thông báo về những nội dung không dùng nữa để biết thêm thông tin về cách cập nhật quy trình tích hợp để đưa ra nội dung khai báo này.
Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
Nếu được chỉ định vai trò Quản trị viên cho một tài nguyên, bạn có thể tạo một người dùng có quyền truy cập vào tài nguyên đó hoặc các tài nguyên thuộc tài nguyên đó.
Người dùng được tạo thông qua phương thức user.create.
Địa chỉ email của người dùng mới phải có một Tài khoản Google tương ứng. Bạn có thể tạo Tài khoản Google cho một địa chỉ email hiện có. Tài nguyên người dùng được tạo cũng phải bao gồm ít nhất một vai trò người dùng được chỉ định.
Sau đây là ví dụ về cách tạo người dùng mới có quyền truy cập tiêu chuẩn vào một nhà quảng cáo:
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']);
[null,null,["Cập nhật lần gần đây nhất: 2025-07-25 UTC."],[[["\u003cp\u003eAdmins can create users with access to resources they manage, including sub-resources.\u003c/p\u003e\n"],["\u003cp\u003eNew users require a Google Account and at least one assigned user role for access.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003euser.create\u003c/code\u003e method enables user creation, potentially adding roles to existing, inaccessible Display & Video 360 users without error.\u003c/p\u003e\n"],["\u003cp\u003eCode samples in Java, Python, and PHP demonstrate creating a standard access user for an advertiser.\u003c/p\u003e\n"]]],["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"],null,["# Create a user\n\nIf assigned the [Admin](/display-video/api/reference/rest/current/users#UserRole.ENUM_VALUES.ADMIN) role for a resource, you can create a user\nwith access to that resource or those under it.\n\nUsers are created through the [`user.create`](/display-video/api/reference/rest/current/users/create) method.\n| **Note:** If you attempt to create a user with an email address associated with an existing Display \\& Video 360 user that you cannot access, no error will be returned. The new assigned user roles will be added to the existing user resource.\n\nA new user's email address must have a corresponding Google Account, which can\nbe [created for an existing email address](//accounts.google.com/signup/v2/webcreateaccount?flowName=GlifWebSignIn&flowEntry=SignUp). The user\nresource created must also include at least one assigned user role.\n\nHere's an example of how to create a new user with standard access to an\nadvertiser: \n\n### Java\n\n```java\n// Create the user structure.\nUser user = new User();\nuser.setEmail(email-address);\nuser.setDisplayName(display-name);\n\n// Create the assigned user role structure.\nAssignedUserRole assignedUserRole = new AssignedUserRole();\nassignedUserRole.setAdvertiserId(advertiser-id);\nassignedUserRole.setUserRole(\"STANDARD\");\n\n// Add assigned user role list to the user.\nuser.setAssignedUserRoles(ImmutableList.of(assignedUserRole));\n\n// Configure the create request.\nUsers.Create request = service.users().create(user);\n\n// Create the user.\nUser response = request.execute();\n\n// Display the user.\nSystem.out.printf(\"User %s was created with email %s.\",\n response.getName(),\n response.getEmail());\n```\n\n### Python\n\n```python\n# Create a user object.\nuser_obj = {\n 'email': email-address,\n 'displayName': display-name,\n 'assignedUserRoles': [\n {\n 'advertiserId': advertiser-id,\n 'userRole': 'STANDARD'\n }\n ]\n}\n\n# Build request.\nrequest = service.users().create(\n body=user_obj\n)\n\n# Execute request.\nresponse = request.execute()\n\n# Display the new user.\nprint('User %s was created with email %s.'\n % (response['name'], response['email']))\n```\n\n### PHP\n\n```php\n// Create the user structure.\n$user = new Google_Service_DisplayVideo_User();\n$user-\u003esetEmail(\u003cvar translate=\"no\"\u003eemail-address\u003c/var\u003e);\n$user-\u003esetDisplayName(\u003cvar translate=\"no\"\u003edisplay-name\u003c/var\u003e);\n\n// Create the assigned user role structure.\n$assignedUserRole = new Google_Service_DisplayVideo_AssignedUserRole();\n$assignedUserRole-\u003esetAdvertiserId(\u003cvar translate=\"no\"\u003eadvertiser-id\u003c/var\u003e);\n$assignedUserRole-\u003esetUserRole('STANDARD');\n\n// Add assigned user role list to the user.\n$user-\u003esetAssignedUserRoles(array($assignedUserRole));\n\n// Call the API, creating the user with the assigned user role.\n$result = $this-\u003eservice-\u003eusers-\u003ecreate($user);\n\n// Display the user.\nprintf(\n 'User %s was created with email %s.\\n',\n $result['name'],\n $result['email']\n);\n```"]]