title: Google Execution API calling Google-Apps-Script = Error 403 (Forbidden)
body: <p>I have a Power Shell script importing data into Google Spreadsheet. Works just as expected: set up the Project Credentials, Scope, Token refresh...
  After the data is imported I need to call a Google Apps Script that belongs to the Spreadsheet. I've followed the steps from:
  <a href="https://developers.google.com/apps-script/guides/rest/api" rel="nofollow noreferrer">https://developers.google.com/apps-script/guides/rest/api</a>
  (deployed, same project, enabled API, same user...)</p>
  
  <p>Unfortunately, PS Script says (403 = Forbidden):</p>
  
  <pre><code>Invoke-RestMethod : The remote server returned an error: (403) Forbidden.
  At S:\projekte\controlling\ctlac.ps1:163 char:12
  + ...   $result = Invoke-RestMethod -Headers @{Authorization = "Bearer $acc ...
  +                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      + CategoryInfo          : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestMethod], WebException
      + FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand
  </code></pre>
  
  <p>This is the line of code giving the error:</p>
  
  <pre><code>$result = Invoke-RestMethod -Headers @{Authorization = "Bearer $accessToken"} -Uri $requestUrl -Method Post -ContentType "application/json" -Body $request |ConvertTo-Json With $request being: { "function": "fnTest" }
  </code></pre>
  
  <p>what am I missing? Is it supposed to work at all?</p>
  
  <p>TIA</p>