Search code examples
google-apps-scriptdeploymenthttp-status-code-404google-apis-explorergoogle-apps-script-api

404 error when deploying a Google Apps script via the REST API


I'm trying to deploy a Google Apps script via the Google REST API, and I'm using the API Explorer to perform that.

This is the method I am testing: https://developers.google.com/apps-script/api/reference/rest/v1/projects.deployments/create

Executing the method via the API Explorer returns a 404 error. I have verified that the scriptId in question does exist, and have tried several other scriptIds, to no avail. I have also made sure the permission scopes are properly set.

This is what the API Explorer gives me.

Worth mentioning that the same scriptId works when calling another method such as projects.get.

Is there anything I am missing, or is this an issue on Google's end? In case of the latter, what are the steps to contact Google Apps Script's team and inform them of this issue?


Solution

  • Your versionNumber is incorrect. The Requested entity here refers to the version of your script. You need to go to File>Manage Versions>Save New version to create a new version(or create one with the api1) and use that version number in the request body.