Search code examples
google-apps-scripthttp-status-code-500google-apps-script-api

Error 500 on POST https://script.googleapis.com/v1/scripts/{scriptId}:run


I have a dummy function inside the Apps Script that I want to execute with Postman.

Apps Script simple dummy function

Every seems to be OK in my postman request, but I always recieve an error 500.

Here's the raw body:

{
  "function": "sendData",
  "parameters": [],  
  "devMode": false
}

The auth token and ScriptId are correct.

This is the response:

{
    "error": {
        "code": 500,
        "message": "Internal error encountered.",
        "status": "INTERNAL"
    }
}

It's driving me crazy. Any help on that?

I'm trying to execute a function that resides in the Apps Script from a Google Sheet.

I'm expecting to recieve an http code 200.


Solution

  • Make sure you are following the steps to execute functions through the Apps Script API, the target script first needs to be deployed as API-executable.