A partire dall'8 settembre 2025, ogni nuovo elemento pubblicitario dovrà dichiarare se pubblicherà o meno annunci politici dell'Unione Europea (UE). I caricamenti di API Display & Video 360 e SDF che non forniscono dichiarazioni non andranno a buon fine. Consulta la nostra pagina dei ritiri per ulteriori dettagli su come aggiornare l'integrazione per effettuare questa dichiarazione.
Mantieni tutto organizzato con le raccolte
Salva e classifica i contenuti in base alle tue preferenze.
Se ti è stato assegnato il ruolo Amministratore per una risorsa, puoi creare un utente con accesso a quella risorsa o a quelle sottostanti.
Gli utenti vengono creati tramite il metodo user.create.
L'indirizzo email di un nuovo utente deve avere un Account Google corrispondente, che può essere creato per un indirizzo email esistente. La risorsa
dell'utente creata deve includere anche almeno un ruolo utente assegnato.
Ecco un esempio di come creare un nuovo utente con accesso standard a un inserzionista:
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,["Ultimo aggiornamento 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```"]]