Reputation: 385
By following the Google Apps Script > Rest API Node.js quickstart example I am able to complete the authentication process (follow the link, get a token, store the token)
but the script execution fails with the error message
The API returned an error: Error: Project title may not be empty.
The documentation for project.create() indicates the request body only need contain {title:string} which what the quickstart has.
Double check Google Apps Script API is enabled = yes,but the api enable page shows some html code it shouldn't, and the enable it for use url in the Overview sections of that page is broken.
I pretty sure the API is enabled as I see traffic in console.cloud
The method looks like this.
script.projects.create({
auth,
resource: {
title: 'My Script'
}
});
I also tried auth: auth as that is what I have seen working elsewhere (same error msg)
The error stack looks like this.
In other words, I followed the quick start exactly and checked function documentation to no avail, can some one help?
Upvotes: 0
Views: 954
Reputation: 201553
I think that your request body works. So can you confirm the following points?
var {google} = require('googleapis');
, please modify to var google = require('googleapis');
.If these points were not useful for your situation, I'm sorry.
Upvotes: 1