回答編集履歴
2
追記
test
CHANGED
@@ -12,19 +12,17 @@
|
|
12
12
|
|
13
13
|
|
14
14
|
|
15
|
-
とのことなので、クエリ文字列形式でpayload(body)に設定すればよいのではないでしょうか。
|
15
|
+
とのことなので、クエリ文字列形式で`payload(body)`に設定すればよいのではないでしょうか。
|
16
16
|
|
17
17
|
|
18
18
|
|
19
|
-
[UrlFetchApp](https://developers.google.com/apps-script/reference/url-fetch/url-fetch-app#fetch
|
19
|
+
[UrlFetchApp#fetch](https://developers.google.com/apps-script/reference/url-fetch/url-fetch-app#fetch(String,Object))
|
20
|
-
|
21
|
-
|
22
20
|
|
23
21
|
|
24
22
|
|
25
23
|
1, JSON形式で送信する訳ではないので、"Content-Type": "application/json",は不要。
|
26
24
|
|
27
|
-
2, QueryStringを作成する関数を作成
|
25
|
+
2, GASは[URLSearchParams インターフェイス](https://developer.mozilla.org/ja/docs/Web/API/URLSearchParams)を実装していないので、QueryString(クエリ文字列)を作成する関数を作成。
|
28
26
|
|
29
27
|
|
30
28
|
|
1
追記
test
CHANGED
@@ -44,7 +44,9 @@
|
|
44
44
|
|
45
45
|
}
|
46
46
|
|
47
|
-
function getToke(){
|
47
|
+
function getToken(){ // getToke→getToken
|
48
|
+
|
49
|
+
var apiUrl = 'https://sateraito-apps-workflow.appspot.com/〇〇〇/api/public/auth';
|
48
50
|
|
49
51
|
var params = {
|
50
52
|
|
@@ -62,7 +64,7 @@
|
|
62
64
|
|
63
65
|
}
|
64
66
|
|
65
|
-
var res = UrlFetchApp.fetch(apiUrl,Request);
|
67
|
+
var res = UrlFetchApp.fetch(apiUrl, Request);
|
66
68
|
|
67
69
|
txt = res.getContentText();
|
68
70
|
|