Answer the question
In order to leave comments, you need to log in
How to make Google apps script work remotely?
There is a script - it receives a bunch of data and forms letters from them and sends them out. It was created as a separate project.
Google has a function to use scripts via a POST request - I try to apply - it writes an error - what am I doing wrong?
I check the
link to the script through the Directory . It gives a
404 error.
404 OK
- HIDE HEADERS -
cache-control: private
content-encoding: gzip
content-length: 115
content-type: application/json; charset=UTF-8
date: Fri, 09 Oct 2015 07:23:05 GMT
server: ESF
vary: Origin, X-Origin, Referer
{
"error": {
"code": 404,
"message": "Requested entity was not found.",
"status": "NOT_FOUND"
}
}
Answer the question
In order to leave comments, you need to log in
Consider two possible problems:
First. Before sending a request, your application must authorize through and receive a token.
this method requires authorization with an OAuth 2.0 token that includes at least one of the scopes listed in the Authorization section; script projects that do not require authorization cannot be executed through this API.
POST https://script.googleapis.com/v1/scripts/{scriptId}:run
{scriptId}
, this is the unique number of the script itself, which is located in the menu File - Project Properties - Project Key function doPost(e) {
return ContentService.createTextOutput(JSON.stringify({status: 'ok'}))
.setMimeType(ContentService.MimeType.JSON);
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question