質問編集履歴

2

質問削除の取り消し

2017/11/01 23:32

投稿

cancat
cancat

スコア313

test CHANGED
@@ -1 +1 @@
1
- 回答がない。回答がない。
1
+ Slack APIでファイルを取得するために、認証トークンを取得したです
test CHANGED
@@ -1 +1,105 @@
1
+ こんにちは。
2
+
3
+ Windows10でWPFのアプリケーションを開発しています。
4
+
5
+ Visual Studio 2017 Communityを使っています。
6
+
7
+ ###前提・実現したいこと
8
+
9
+ Slack APIでファイルを取得するために、認証トークンを取得したいです。
10
+
11
+ ###試したこと
12
+
1
- 回答がない。回答がない。回答がな。回答がない。回答がない。回答がない。回答がない。回答がない。回答がない。回答がない。回答がない。回答がない。回答がない。回答がない。回答がない。回答がない。
13
+ client_idと、clientSecret、VerificationTokenを取得し、SlackのTokenも取得しました、ほかにも足りないものあり、それににを入れたらいいかわからずにます
14
+
15
+ state? 状態? どんな…?
16
+
17
+ redirect_uri まあ適当に。
18
+
19
+ ###発生している問題・エラーメッセージ
20
+
21
+ responseはあるが、認証トークンは手にはいっていない。
22
+
23
+ {StatusCode: 200, ReasonPhrase: 'OK', Version: 1.1, Content: System.Net.Http.StreamContent, Headers:
24
+
25
+ {
26
+
27
+ Connection: keep-alive
28
+
29
+ Referrer-Policy: no-referrer
30
+
31
+ Strict-Transport-Security: max-age=31536000; includeSubDomains; preload
32
+
33
+ Vary: Accept-Encoding
34
+
35
+ X-Frame-Options: SAMEORIGIN
36
+
37
+ X-Slack-Backend: h
38
+
39
+ X-XSS-Protection: 0
40
+
41
+ X-Cache: Miss from cloudfront
42
+
43
+ X-Amz-Cf-Id: ******* //<-ひょっとしてこれ?
44
+
45
+ Date: Wed, 19 Jul 2017 02:44:52 GMT
46
+
47
+ Set-Cookie: b=******; expires=Mon, 19-Jul-2027 02:44:52 GMT; Max-Age=315532800; path=/; domain=.slack.com //<-ひょっとしてこのCookie?
48
+
49
+ Server: Apache
50
+
51
+ Via: 1.1 ***********.cloudfront.net (CloudFront)
52
+
53
+ Content-Length: 39
54
+
55
+ Content-Type: text/plain; charset=utf-8
56
+
57
+ }}
58
+
59
+ ###該当のソースコード
60
+
61
+ ```C#
62
+
63
+ string cliend_id = "000000000000.000000000000";
64
+
65
+ string clientSecret = "00000000000000000000000000000";
66
+
67
+ string VerificationToken = "************";
68
+
69
+ static string authorizeurl = "https://slack.com/oauth/authorize";
70
+
71
+ var client = new HttpClient();
72
+
73
+ var content = new FormUrlEncodedContent(new Dictionary<string, string>
74
+
75
+ {
76
+
77
+ { "client_id", cliend_id },
78
+
79
+ { "state", "full" },
80
+
81
+ { "team", "myteam" },
82
+
83
+ { "scope", "read" },
84
+
85
+ { "redirect_uri", "http://cancat.com" }
86
+
87
+ });
88
+
89
+ var response = await client.PostAsync(authorizeurl, content);
90
+
91
+ ```
92
+
93
+ ###補足情報(言語/FW/ツール等のバージョンなど)
94
+
95
+ Microsoft Visual Studio Community 2017
96
+
97
+ Version 15.0.26228.9 D15RTWSVC
98
+
99
+ Microsoft .NET Framework
100
+
101
+ Version 4.6.01586
102
+
103
+ です。
104
+
105
+ よろしくお願いします。

1

回答がない。回答がない。

2017/11/01 23:32

投稿

退会済みユーザー
test CHANGED
@@ -1 +1 @@
1
- Slack APIでファイルを取得するために、認証トークンを取得したです
1
+ 回答がない。回答がない。
test CHANGED
@@ -1,131 +1 @@
1
- こんにちは。
2
-
3
- Windows10でWPFのアプリケーションを開発しています。
4
-
5
- Visual Studio 2017 Communityを使っています。
6
-
7
-
8
-
9
- ###前提・実現したいこと
10
-
11
- Slack APIでファイルを取得するために、認証トークンを取得したいです。
12
-
13
-
14
-
15
- ###試したこと
16
-
17
- client_idと、clientSecret、VerificationTokenを取得し、SlackのTokenも取得しました、ほかにも足りないものあり、それににを入れたらいいかわからずにます
1
+ 回答がない。回答がない。回答がな。回答がない。回答がない。回答がない。回答がない。回答がない。回答がない。回答がない。回答がない。回答がない。回答がない。回答がない。回答がない。回答がない。
18
-
19
- state? 状態? どんな…?
20
-
21
- redirect_uri まあ適当に。
22
-
23
-
24
-
25
- ###発生している問題・エラーメッセージ
26
-
27
- responseはあるが、認証トークンは手にはいっていない。
28
-
29
-
30
-
31
-
32
-
33
- {StatusCode: 200, ReasonPhrase: 'OK', Version: 1.1, Content: System.Net.Http.StreamContent, Headers:
34
-
35
- {
36
-
37
- Connection: keep-alive
38
-
39
- Referrer-Policy: no-referrer
40
-
41
- Strict-Transport-Security: max-age=31536000; includeSubDomains; preload
42
-
43
- Vary: Accept-Encoding
44
-
45
- X-Frame-Options: SAMEORIGIN
46
-
47
- X-Slack-Backend: h
48
-
49
- X-XSS-Protection: 0
50
-
51
- X-Cache: Miss from cloudfront
52
-
53
- X-Amz-Cf-Id: ******* //<-ひょっとしてこれ?
54
-
55
- Date: Wed, 19 Jul 2017 02:44:52 GMT
56
-
57
- Set-Cookie: b=******; expires=Mon, 19-Jul-2027 02:44:52 GMT; Max-Age=315532800; path=/; domain=.slack.com //<-ひょっとしてこのCookie?
58
-
59
- Server: Apache
60
-
61
- Via: 1.1 ***********.cloudfront.net (CloudFront)
62
-
63
- Content-Length: 39
64
-
65
- Content-Type: text/plain; charset=utf-8
66
-
67
- }}
68
-
69
-
70
-
71
-
72
-
73
- ###該当のソースコード
74
-
75
- ```C#
76
-
77
- string cliend_id = "000000000000.000000000000";
78
-
79
- string clientSecret = "00000000000000000000000000000";
80
-
81
- string VerificationToken = "************";
82
-
83
-
84
-
85
- static string authorizeurl = "https://slack.com/oauth/authorize";
86
-
87
-
88
-
89
- var client = new HttpClient();
90
-
91
- var content = new FormUrlEncodedContent(new Dictionary<string, string>
92
-
93
- {
94
-
95
- { "client_id", cliend_id },
96
-
97
- { "state", "full" },
98
-
99
- { "team", "myteam" },
100
-
101
- { "scope", "read" },
102
-
103
- { "redirect_uri", "http://cancat.com" }
104
-
105
- });
106
-
107
-
108
-
109
- var response = await client.PostAsync(authorizeurl, content);
110
-
111
-
112
-
113
- ```
114
-
115
-
116
-
117
- ###補足情報(言語/FW/ツール等のバージョンなど)
118
-
119
- Microsoft Visual Studio Community 2017
120
-
121
- Version 15.0.26228.9 D15RTWSVC
122
-
123
- Microsoft .NET Framework
124
-
125
- Version 4.6.01586
126
-
127
-
128
-
129
- です。
130
-
131
- よろしくお願いします。