Skip to content

Commit 1055d27

Browse files
committed
Modified
1 parent 3220501 commit 1055d27

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

README.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -555,6 +555,32 @@ When you run above curl command, you can retrieve the following values. `fileNam
555555
}
556556
```
557557
558+
#### `pathInfo`: Updated on February 14, 2023
559+
560+
In the current stage, it seems that `pathInfo` can be used with the access token. It supposes that the following sample script is used.
561+
562+
```javascript
563+
function doGet(e) {
564+
return ContentService.createTextOutput(JSON.stringify(e));
565+
}
566+
```
567+
568+
When you log in to your Google account and you access `https://script.google.com/macros/s/###/exec/sample.txt` with your browser, `{"contextPath":"","parameter":{},"pathInfo":"sample.txt","contentLength":-1,"parameters":{},"queryString":""}` can be seen.
569+
570+
In this case, when you access it without logging in Google account, even when Web Apps is deployed as `Execute as: Me` and `Who has access to the app: Anyone`, the log in screen is opened. Please be careful about this.
571+
572+
And, if you want to access with `https://script.google.com/macros/s/###/exec/sample.txt` using a script, please request it by including the access token. The sample curl command is as follows. In this case, the access token can be used as the query parameter. Please include one of the scopes of Drive API in the access token.
573+
574+
```bash
575+
curl -L "https://script.google.com/macros/s/###/exec/sample.txt?access_token=###"
576+
```
577+
578+
By this, the following result is returned.
579+
580+
```json
581+
{"contextPath":"","queryString":"access_token=###"},"pathInfo":"sample.txt","parameters":{"access_token":["###"]},"contentLength":-1}
582+
```
583+
558584
<a name="checklog"></a>
559585
560586
# Logs in Web Apps for Google Apps Script

0 commit comments

Comments
 (0)