I am pulling from a CSV file email information to create new guest network user.
The file reads like this:
email name password
email@email.com Bob 45646565
However this only works if one line of info is input to the CSV file. If i add additional line items i get an error. Can someone assist? New 🙂
with open('Guest-Test.csv', mode='r') as csv_file:
csv_reader = csv.reader(csv_file, delimiter=',')
header = next(csv_reader)
authorizations = [
{
'ssidNumber': myssidNum,
"expiresAt": expiresTS,
"authorizedByEmail": 'someemail@email.com'}]
emails_list = []
names_list = []
passwords_list = []
for row in csv_reader:
emails_list.append(row[0]),
names_list.append(row[1]),
passwords_list.append(row[2])
# print(emails)
email = ''.join(emails_list)
name = ''.join(names_list)
password = ''.join(passwords_list)
createUser = dashboard.networks.createNetworkMerakiAuthUser(
network_id, emails, names, passwords, authorizations, accountType='Guest', emailPasswordToUser=False)