Apps脚本执行API显示devMode错误:true
尝试通过 devMode:true
为我的一个项目使用Execution API,但出现以下错误.但是当我使 devMode:false
时,它可以完美地工作.注意:我是所有者,并且使用同一帐户的API(因此应该可以正常使用)
Trying to use Execution API for one of my project with devMode: true
, but getting the following error. But it works flawlessly when I make devMode: false
.
NOTE: I am owner and using the API from same account (so it should work ideally)
- 我已将脚本部署为api可执行文件,访问权限为任何人"
- 我已在开发人员控制台中启用了"Apps Script API"
- oauth和app脚本都共享同一个项目
{错误": {代码":404,"message":未找到请求的实体.",状态":"NOT_FOUND"}}
我也遇到过同样的情况.那么您可以再次确认以下几点吗?
I had also experienced the same situation. So can you confirm the following points again?
- 再次使用保存"按钮保存应用脚本.
- 将应用程序脚本另存为新版本.
- 是否从使用Apps Script API的项目中检索了客户端ID和客户端机密.
- 是否从这些客户端ID和客户端机密中检索访问令牌.
再次确认以上内容后,我始终使用以下curl命令进行测试.使用此curl命令时,请输入访问令牌,函数名称和脚本ID.
After I confirmed above again, I always test using a following curl command. When you use this curl command, please input your access token, function name and script ID.
curl -X POST -L \
-H "Authorization: Bearer ### access token ###" \
-H "Content-Type: application/json" \
-d "{function: '### function name ###',devMode: true}" \
"https://script.googleapis.com/v1/scripts/### script ID ###:run"
在我的环境中,您的问题中的错误已解决.我不知道这些方法是否可以解决您的问题.如果这对您没有用,对不起.
In my environment, the error in your question was solved. I don't know whether these can solve your problem. If this was not useful for you, I'm sorry.