When I try to add users: In this way I can only add one user, but I will need to add multiple users from the JSON file.
req = [
{
"primaryEmail": "first.user@mydomain.com",
"name": {
"givenName": "UserName",
"familyName": "UserLastName"
},
"suspended": False,
"password": "my password",
"hashFunction": "SHA-1",
"changePasswordAtNextLogin": False,
"agreedToTerms": True,
"ipWhitelisted": False
},
{
"primaryEmail": "second.user@exnesstest.com",
"name": {
"givenName": "FirstName",
"familyName": "LastName"
},
"suspended": False,
"password": "my password",
"hashFunction": "SHA-1",
"changePasswordAtNextLogin": False,
"agreedToTerms": True,
"ipWhitelisted": False
}
]
users = service.users().insert(body=req).execute()
I get some error like:
googleapiclient.errors.HttpError: <HttpError 400 when requesting https://admin.googleapis.com/admin/directory/v1/users?alt=json returned "Invalid Input: primary_user_email">
How can I add multiple users in this way?