I created a script for my Google Form that will add a user to Google Admin. It was running fine yesterday, but today when I run it, it gives met the following error:
GoogleJsonResponseException: API call to directory.users.insert failed with error: Domain not found.
Any idea what may have caused this? Here is the relevant snippet of my code:
AdminDirectory.Users.insert(user); //adds user to google admin
Logger.log('User %s created with PW %s.', user.primaryEmail, user.password);
I have also included the following services:
**EDIT: Also, I have Apps Access Control set to unrestricted for Apps Script Runtime, Apps Script API, and Google Drive.