简体   繁体   中英

ContactsApp.createContact() You do not have permission to perform that action

I'm the admin for my google suite site. As of 2 weeks ago I keep getting the error " You do not have permission to perform that action. " when trying to add any contacts programmatically. I've tried adding apis, removing permissions and reauthorizing, copying and pasting the script into new script files, copying the whole sheets files and nothing works. I've used different emails and names etc. I'm running this from my admin side and it worked fine a couple weeks ago.

This problem only happens with the line ContactsApp.createContact() and all other ContactsApp. methods work fine. I've tried all the suggestions I can find online and nothing is working.

function testthis(){

ContactsApp.createContact('Bob','Burger','testthis@gmail.com');

};

Any help or suggestions or troubleshooting would be greatly appreciated on this!

Make sure that this scope :

www.google.com/m8/feeds

is added and also make sure your Contacts API is enabled in your Google Dev console.

I also had this problem. In my case, the error was originated in the fact that the format of the input data was not correct. For instance, if you are adding to your contacts an email address, check that this field has actually an email format, otherway the script may not perform.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM