First, I just wanted to say your code is very clean and easy to read.
Based on what you shared, and not seeing the entire script, try adding
auth: this.auth, to the deployment request. I don't know if it is required, but it is in your update function.
Also, it shouldn't matter, but there is an extra comma after
manifestFileName: 'appsscript', <-- delete comma.
Also consider adding a description (even if blank).
Also try changing requestBody to resource.
From the API:
// Make sure the client is loaded and sign-in is complete before calling this method.
function execute() {
return gapi.client.script.projects.deployments.create({
"resource": {
"versionNumber": 1,
"manifestFileName": "appsscript",
"description": " "
}
})
Otherwise, from what I can see, your script should work.
Does it work if you manually try the API? (
API)