質問編集履歴

2

その他に組み合わせ画像を追加

2021/12/31 07:36

投稿

k.a_teratail
k.a_teratail

スコア845

test CHANGED
File without changes
test CHANGED
@@ -91,3 +91,11 @@
91
91
  $ {"test":"check"}
92
92
 
93
93
  ```
94
+
95
+
96
+
97
+
98
+
99
+ 組み合わせ
100
+
101
+ ![イメージ説明](ccac1063af3791ace9e81fc1b0ec53f7.png)

1

正しい質問内容を記載

2021/12/31 07:36

投稿

k.a_teratail
k.a_teratail

スコア845

test CHANGED
File without changes
test CHANGED
@@ -1,4 +1,4 @@
1
- ### 前提・実現したいこと
1
+ ### 実現したいこと
2
2
 
3
3
  GASのウェブアプリ・実行可能APIのどちらかで、実行時にGoogleアカウントのユーザ認証を行いたいです。
4
4
 
@@ -42,7 +42,15 @@
42
42
 
43
43
  ```sh
44
44
 
45
- $ curl
45
+ # パラメータを渡しているが特に意味はない
46
+
47
+ $ curl -H "Content-Type: application/json" -d '{"test":"check"}' -L https://script.google.com/macros/s/AKfycbwip-qVOCYRmiBZVbkkH9n-7P9YRir9I5VZGOoLbdmGKKNnWvdKTmOkZfViGuvQY24E-Q/exec
48
+
49
+ # なぜかHTMLコードが返ってくる
50
+
51
+ $ <!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. */
52
+
53
+ .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">&nbsp;ドライブ</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>
46
54
 
47
55
  ```
48
56
 
@@ -52,24 +60,34 @@
52
60
 
53
61
 
54
62
 
55
- ```ここに言語名を入力
63
+ ```gs
56
64
 
57
- ソースコード
65
+ function doPost(e) {
66
+
67
+ return ContentService.createTextOutput(JSON.stringify({"test":"check"}))
68
+
69
+ }
58
70
 
59
71
  ```
60
72
 
61
73
 
62
74
 
75
+
76
+
63
- ### 試したこと
77
+ ### その他
78
+
79
+ 正常実行時
80
+
81
+ > 「実行者」が「自分」で
82
+
83
+ > 「アクセスできるユーザ」が「全員」の時
64
84
 
65
85
 
66
86
 
67
- ここに問題に対して試したことを記載してください。
87
+ ```sh
68
88
 
89
+ $ curl -H "Content-Type: application/json" -d '{"test":"check"}' -L https://script.google.com/macros/s/AKfycbwip-qVOCYRmiBZVbkkH9n-7P9YRir9I5VZGOoLbdmGKKNnWvdKTmOkZfViGuvQY24E-Q/exec
69
90
 
91
+ $ {"test":"check"}
70
92
 
71
- ### 補足情報(FW/ツールのバージョンなど)
72
-
73
-
74
-
75
- ここにより詳細な情報を記載してください。
93
+ ```