通过REST API部署Google Apps脚本时出现404错误 [英] 404 error when deploying a Google Apps script via the REST API

本文介绍了通过REST API部署Google Apps脚本时出现404错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试通过Google REST API部署Google Apps脚本,并且正在使用API​​ Explorer来执行该操作.

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

这是我正在测试的方法: https://developers.google.com/apps-script/api/reference/rest/v1/projects.deployments/create

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

通过API资源管理器执行该方法将返回404错误.我已验证问题中的scriptId确实存在,并尝试了其他几个scriptId,但无济于事.我还确保正确设置了权限范围.

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.

这是API Explorer给我的.

This is what the API Explorer gives me.

值得一提的是,调用另一个方法(例如projects.get)时,相同的scriptId可以工作.

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

我有什么想念的吗?或者这是Google的问题? 如果是后者,应采取什么步骤与Google Apps Script的团队联系并通知他们该问题?

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?

推荐答案

您的versionNumber不正确.此处的Requested entity是指脚本的版本.您需要转到文件>管理版本>保存新版本以创建新版本(或使用api

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.

这篇关于通过REST API部署Google Apps脚本时出现404错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆