質問編集履歴
2
その他に組み合わせ画像を追加
title
CHANGED
File without changes
|
body
CHANGED
@@ -44,4 +44,8 @@
|
|
44
44
|
```sh
|
45
45
|
$ curl -H "Content-Type: application/json" -d '{"test":"check"}' -L https://script.google.com/macros/s/AKfycbwip-qVOCYRmiBZVbkkH9n-7P9YRir9I5VZGOoLbdmGKKNnWvdKTmOkZfViGuvQY24E-Q/exec
|
46
46
|
$ {"test":"check"}
|
47
|
-
```
|
47
|
+
```
|
48
|
+
|
49
|
+
|
50
|
+
組み合わせ
|
51
|
+

|
1
正しい質問内容を記載
title
CHANGED
File without changes
|
body
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
###
|
1
|
+
### 実現したいこと
|
2
2
|
GASのウェブアプリ・実行可能APIのどちらかで、実行時にGoogleアカウントのユーザ認証を行いたいです。
|
3
3
|
|
4
4
|

|
@@ -20,19 +20,28 @@
|
|
20
20
|
### 発生している問題・エラーメッセージ
|
21
21
|
|
22
22
|
```sh
|
23
|
-
|
23
|
+
# パラメータを渡しているが特に意味はない
|
24
|
+
$ curl -H "Content-Type: application/json" -d '{"test":"check"}' -L https://script.google.com/macros/s/AKfycbwip-qVOCYRmiBZVbkkH9n-7P9YRir9I5VZGOoLbdmGKKNnWvdKTmOkZfViGuvQY24E-Q/exec
|
25
|
+
# なぜかHTMLコードが返ってくる
|
26
|
+
$ <!DOCTYPE html><html lang="ja"><head><meta name="description" content="ウェブ ワープロ、プレゼンテーション、スプレッドシート"><meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=0"><link rel="shortcut icon" href="//docs.google.com/favicon.ico"><title>ページが見つかりません</title><meta name="referrer" content="origin"><link href="//fonts.googleapis.com/css?family=Product+Sans" rel="stylesheet" type="text/css" nonce="14ECjqySv4xQyN1NsLGKhw"><style nonce="14ECjqySv4xQyN1NsLGKhw">/* Copyright 2021 Google Inc. All Rights Reserved. */
|
27
|
+
.goog-inline-block{position:relative;display:-moz-inline-box;display:inline-block}* html .goog-inline-block{display:inline}*:first-child+html .goog-inline-block{display:inline}#drive-logo{margin:18px 0;position:absolute;white-space:nowrap}.docs-drivelogo-img{background-image:url('//ssl.gstatic.com/images/branding/googlelogo/1x/googlelogo_color_116x41dp.png');background-size:116px 41px;display:inline-block;height:41px;vertical-align:bottom;width:116px}.docs-drivelogo-text{color:#000;display:inline-block;opacity:0.54;text-decoration:none;font-family:'Product Sans',Arial,Helvetica,sans-serif;font-size:32px;text-rendering:optimizeLegibility;position:relative;top:-6px;left:-7px;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}@media (-webkit-min-device-pixel-ratio:1.5),(min-resolution:144dpi){.docs-drivelogo-img{background-image:url('//ssl.gstatic.com/images/branding/googlelogo/2x/googlelogo_color_116x41dp.png')}}</style><style type="text/css" nonce="14ECjqySv4xQyN1NsLGKhw">body {background-color: #fff; font-family: Arial,sans-serif; font-size: 13px; margin: 0; padding: 0;}a, a:link, a:visited {color: #112ABB;}</style><style type="text/css" nonce="14ECjqySv4xQyN1NsLGKhw">.errorMessage {font-size: 12pt; font-weight: bold; line-height: 150%;}</style></head><body><div id="outerContainer"><div id="innerContainer"><div style="position: absolute; top: -80px;"><div id="drive-logo"><a href="/"><span class="docs-drivelogo-img" title="Google ロゴ"></span><span class="docs-drivelogo-text"> ドライブ</span></a></div></div><div align="center"><p class="errorMessage" style="padding-top: 50px">現在、ファイルを開くことができません。</p><p>アドレスを確認して、もう一度試してください。</p><div style="background: #F0F6FF; border: 1px solid black; margin-top: 35px; padding: 10px 125px; width: 300px;"><p><strong>あれもこれも Google ドライブで</strong></p><p> Google ドライブにはドキュメントやスプレッドシート、プレゼンテーションなどを簡単に作成、保存してオンラインで共有できるアプリが揃っています。</p><p>詳細は<a href="https://drive.google.com/start/apps">drive.google.com/start/apps</a>をご覧ください。</p></div></div></div></div></body><style nonce="14ECjqySv4xQyN1NsLGKhw">html {height: 100%; overflow: auto;}body {height: 100%; overflow: auto;}#outerContainer {margin: auto; max-width: 750px;}#innerContainer {margin-bottom: 20px; margin-left: 40px; margin-right: 40px; margin-top: 80px; position: relative;}</style></html>
|
24
28
|
```
|
25
29
|
|
26
30
|
### 該当のソースコード
|
27
31
|
|
28
|
-
```
|
32
|
+
```gs
|
29
|
-
|
33
|
+
function doPost(e) {
|
34
|
+
return ContentService.createTextOutput(JSON.stringify({"test":"check"}))
|
35
|
+
}
|
30
36
|
```
|
31
37
|
|
32
|
-
### 試したこと
|
33
38
|
|
39
|
+
### その他
|
40
|
+
正常実行時
|
41
|
+
> 「実行者」が「自分」で
|
34
|
-
|
42
|
+
> 「アクセスできるユーザ」が「全員」の時
|
35
43
|
|
44
|
+
```sh
|
45
|
+
$ curl -H "Content-Type: application/json" -d '{"test":"check"}' -L https://script.google.com/macros/s/AKfycbwip-qVOCYRmiBZVbkkH9n-7P9YRir9I5VZGOoLbdmGKKNnWvdKTmOkZfViGuvQY24E-Q/exec
|
36
|
-
|
46
|
+
$ {"test":"check"}
|
37
|
-
|
38
|
-
|
47
|
+
```
|