Apps Script Execution API showing error with devMode: true

久未见 提交于 2021-02-04 19:44:53

问题


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)

  1. I have deployed the script as api executable with access as "Anyone"
  2. I have enabled the "Apps Script API" in the developer console
  3. Both the oauth and apps script share the same project

{ "error": { "code": 404, "message": "Requested entity was not found.", "status": "NOT_FOUND" } }


回答1:


I had also experienced the same situation. So can you confirm the following points again?

  1. Save the apps script using the save button again.
  2. Save the apps script as a new version.
  3. Whether the client ID and client secret are retrieved from the project that Apps Script API is used.
    • Whether the access token is retrieved from these client ID and client secret.
  4. Whether the scope inclues https://www.googleapis.com/auth/drive, https://www.googleapis.com/auth/drive.scripts and https://www.googleapis.com/auth/script.external_request.

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.



来源:https://stackoverflow.com/questions/47892350/apps-script-execution-api-showing-error-with-devmode-true

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!