-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathopenapi.yaml
615 lines (612 loc) · 20.5 KB
/
openapi.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
openapi: 3.0.2
info:
title: RTA in Japan Twitter API
description: ""
version: 1.1.0
externalDocs:
description: Twitter API References
url: https://developer.twitter.com/en/docs/api-reference-index
servers:
- url: https://localhost:3000/
paths:
/statuses/user_timeline:
get:
description: "規定のアカウントのタイムライン(home)を取得する。"
tags:
- statuses
parameters:
- in: header
name: X-Auth
schema:
type: string
example: "ABCDEFG123456"
responses:
200:
description: ""
content:
application/json:
schema:
$ref: '#/components/schemas/statusesResponse'
examples:
response1:
$ref: '#/components/examples/statusResponse1'
response2:
$ref: '#/components/examples/statusResponse2'
response3:
$ref: '#/components/examples/statusResponse3'
response4:
$ref: '#/components/examples/statusResponse4'
response5:
$ref: '#/components/examples/statusResponse5'
503:
description: ""
content:
application/json:
schema:
$ref: '#/components/schemas/errorResponse'
/statuses/mentions_timeline:
get:
description: "規定のアカウントに対するメンションを取得する。"
tags:
- statuses
parameters:
- in: header
name: X-Auth
schema:
type: string
example: "ABCDEFG123456"
responses:
200:
description: ""
content:
application/json:
schema:
$ref: '#/components/schemas/statusesResponse'
503:
description: ""
content:
application/json:
schema:
$ref: '#/components/schemas/errorResponse'
/statuses/hash:
get:
description: "規定のハッシュタグで検索した結果を取得する。"
tags:
- statuses
parameters:
- in: header
name: X-Auth
schema:
type: string
example: "ABCDEFG123456"
responses:
200:
description: ""
content:
application/json:
schema:
$ref: '#/components/schemas/statusesResponse'
503:
description: ""
content:
application/json:
schema:
$ref: '#/components/schemas/errorResponse'
/statuses/update:
post:
description: "ツイート投稿する"
tags:
- statuses
parameters:
- in: header
name: X-Auth
schema:
type: string
example: "ABCDEFG123456"
requestBody:
description: ""
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/requestUpdate'
examples:
request1:
summary: "メディア無し"
value: {
"status": "走者乙wwwwwwwwwwww\nwwwww\nwwwwwwwwwwwwww",
"media_ids": [],
"in_reply_to_tweet_id": null,
"quote_tweet_id": null
}
request2:
summary: "メディア有り"
value: {
"status": "走者乙wwwwwwwwwwww",
"media_ids": [
"710511363345354753"
],
"in_reply_to_tweet_id": null,
"quote_tweet_id": null
}
request2-1:
summary: "メディア4枚"
value: {
"status": "走者乙wwwwwwwwwwww",
"media_ids": [
"1421878566539579392",
"1421878576962367491",
"1421878582134001668",
"1421878586374430724"
],
"in_reply_to_tweet_id": null,
"quote_tweet_id": null
}
request3:
summary: "返信有り"
value: {
"status": "走者乙wwwwwwwwwwww",
"media_ids": [],
"in_reply_to_tweet_id": "1421495434665553924",
"quote_tweet_id": null
}
request4:
summary: "引用有り"
value: {
"status": "走者乙wwwwwwwwwwww",
"media_ids": [],
"in_reply_to_tweet_id": null,
"quote_tweet_id": "1421878914524147713"
}
response5:
summary: "全部盛り"
value: {
"status":"全部\n盛り",
"media_ids":["1421879381006323716"],
"in_reply_to_tweet_id":"1421879119529201664",
"quote_tweet_id":"1421879119529201664"
}
responses:
200:
description: "ツイート投稿後のstatuses/user_timelineに相当するもの"
content:
application/json:
schema:
$ref: '#/components/schemas/statusesResponse'
503:
description: ""
content:
application/json:
schema:
$ref: '#/components/schemas/errorResponse'
/media/upload/:
post:
description: "画像、動画ファイルをアップロードする。"
tags:
- media
parameters:
- in: header
name: X-Auth
schema:
type: string
example: "ABCDEFG123456"
requestBody:
description: ""
required: true
content:
multipart/form-data:
schema:
type: object
properties:
# 'file' will be the field name in this multipart request
file:
type: string
format: binary
responses:
200:
description: ""
content:
application/json:
schema:
type: "object"
properties:
code:
type: "integer"
example: 0
data:
type: "object"
properties:
media_id_string:
type: string
example: "1234567890"
503:
description: ""
content:
application/json:
schema:
$ref: '#/components/schemas/errorResponse'
/statuses/destroy/{id}:
post:
description: "指定したIDのツイートを削除する。"
tags:
- statuses
parameters:
- in: header
name: X-Auth
schema:
type: string
example: "ABCDEFG123456"
- in: path
name: id
schema:
type: string
required: true
description: "削除対象のツイートID"
responses:
200:
description: "処理実行後のstatuses/user_timelineに相当するもの"
content:
application/json:
schema:
$ref: '#/components/schemas/statusesResponse'
503:
description: ""
content:
application/json:
schema:
$ref: '#/components/schemas/errorResponse'
components:
schemas:
statusesResponse:
type: object
properties:
code:
type: integer
data:
type: array
items:
$ref: '#/components/schemas/statuses'
statuses:
type: object
properties:
id:
type: string
example: '1338971066773905408'
text:
type: string
example: >-
💡 Using Twitter data for academic research? Join our next
livestream this Friday @ 9am PT on https://t.co/GrtBOXh5Y1!n
n@SuhemParack will show how to get started with recent search &
filtered stream endpoints on the #TwitterAPI v2, the new Tweet
payload, annotations, & more. https://t.co/IraD2Z7wEg
user:
$ref: '#/components/schemas/user'
created_at:
type: string
format: date-time
example: '2020-12-10T20:00:10Z'
entities:
$ref: '#/components/schemas/statuses_entities'
media:
type: array
items:
$ref: '#/components/schemas/media'
in_reply_to_status:
$ref: '#/components/schemas/statuses'
quoted_status:
$ref: '#/components/schemas/statuses'
required:
- id
- text
- user
- created_at
media:
type: object
properties:
media_key:
type: string
example: '13_1263145212760805376'
type:
type: string
enum:
- animated_gif
- photo
- video
url:
type: string
preview_image_url:
type: string
example: https://pbs.twimg.com/media/EYeX7akWsAIP1_1.jpg
width:
type: integer
example: 1920
height:
type: integer
example: 1080
required:
- media_key
- type
- url
- preview_image_url
- width
- height
statuses_entities:
type: object
properties:
annotations:
type: array
items:
type: object
urls:
type: array
items:
type: object
properties:
start:
type: integer
example: 10
end:
type: integer
example: 33
url:
type: string
example: https://t.co/9BbWekeWq2
expanded_url:
type: string
example: https://twitter.com/TwitterDev/status/1374104599456534531
display_url:
type: string
example: twitter.com/TwitterDev/sta…
required:
- start
- end
- url
- expanded_url
- display_url
hashtags:
type: array
items:
type: object
mentions:
type: array
items:
type: object
properties:
start:
type: number
example: 0
end:
type: number
example: 11
id:
type: string
example: '2244994945'
username:
type: string
example: TwitterDev
required:
- start
- end
- id
- username
cashtags:
type: array
items:
type: object
user:
type: object
properties:
id:
type: string
example: '2244994945'
name:
type: string
example: Twitter Dev
username:
type: string
example: TwitterDev
created_at:
type: string
format: date-time
example: '2013-12-14T04:35:55.000Z'
profile_image_url:
type: string
example: >-
https://pbs.twimg.com/profile_images/1267175364003901441/tBZNFAgA_normal.jpg
required:
- id
- name
- username
- created_at
- profile_image_url
errorResponse:
type: object
properties:
code:
type: integer
error:
type: object
properties:
message:
type: string
example: エラー内容とかをここに
example:
code: 10
error:
message: ヤバイwwwwwwwwwwwwwww
requestUpdate:
type: object
properties:
status:
description: ツイート本文
type: string
example: 走者乙wwwwwwwwwwwwwwwwwwww
media_ids:
description: 事前にアップロードした画像・動画のID
type: array
items:
type: string
example:
- '710511363345354753'
in_reply_to_tweet_id:
description: リプライ先のツイートID
type: string
example: ''
quote_tweet_id:
description: 引用RTの引用元ツイートID
type: string
example: ''
examples:
statusResponse1:
summary: 素のやつ
value:
code: 0
data:
- id: '1578074395490521088'
text: 'じゅげむ じゅげむ ごこうのすりきれ\nかいじゃりすいぎょの すいぎょうまつ\n\nうんらいまつ ふうらいまつ\n\nくうねるところに すむところ\n\nやぶらこうじの ぶらこうじ\n\nパイポパイポ\n\nパイポのシューリンガン\n\nシューリンガンのグーリンダイ\n\nグーリンダイのポンポコピーのポンポコナーの\n\nちょう'
user:
id: '1543882205264355328'
username: dev_cma
name: dev-cma
profile_image_url: https://abs.twimg.com/sticky/default_profile_images/default_profile_normal.png
created_at: '2022-07-04T09:00:38.000Z'
created_at: '2022-10-06T17:27:09.000Z'
statusResponse2:
summary: 返信つき
value:
code: 0
data:
- id: '1581992205912195072'
text: '@TwitterDev こんにちは~~~~~'
created_at: '2022-10-17T12:55:08.000Z'
entities:
mentions:
- start: 0
end: 11
username: TwitterDev
id: '2244994945'
user:
id: '1543882205264355328'
username: dev_cma
name: dev-cma
profile_image_url: https://abs.twimg.com/sticky/default_profile_images/default_profile_normal.png
created_at: '2022-07-04T09:00:38.000Z'
in_reply_to_status:
id: '1578074395490521088'
text: hello, twitter world!
created_at: '2022-10-06T17:27:09.000Z'
user:
id: '2244994945'
name: Twitter Dev
username: TwitterDev
profile_image_url: https://pbs.twimg.com/profile_images/1354494203451961345/d8HkZl6p_normal.jpg
created_at: '2011-10-22T07:20:30.000Z'
statusResponse3:
summary: 引用つき
value:
code: 0
data:
- id: '1582002263043686400'
text: 引用します~~~~~~~~ https://t.co/wNfJxgBNpM
created_at: '2022-10-17T13:35:06.000Z'
user:
id: '1543882205264355328'
username: dev_cma
name: dev-cma
profile_image_url: https://abs.twimg.com/sticky/default_profile_images/default_profile_normal.png
created_at: '2022-07-04T09:00:38.000Z'
entities:
urls:
- start: 14
end: 37
url: https://t.co/wNfJxgBNpM
expanded_url: https://twitter.com/cma2819/status/1580874156110856192
display_url: twitter.com/cma2819/status…
quoted_status:
id: '1578074395490521088'
text: hello, twitter world!
created_at: '2022-10-06T17:27:09.000Z'
user:
id: '2244994945'
name: Twitter Dev
username: TwitterDev
profile_image_url: https://pbs.twimg.com/profile_images/1354494203451961345/d8HkZl6p_normal.jpg
created_at: '2011-10-22T07:20:30.000Z'
statusResponse4:
summary: メディア付き
value:
code: 0
data:
- id: '1581990427372109826'
text: 画像といっしょについーと https://t.co/Z0NNkoat7u
created_at: '2022-10-17T12:48:04.000Z'
user:
id: '1543882205264355328'
username: dev_cma
name: dev-cma
profile_image_url: https://abs.twimg.com/sticky/default_profile_images/default_profile_normal.png
created_at: '2022-07-04T09:00:38.000Z'
entities:
urls:
- start: 13
end: 36
url: https://t.co/Z0NNkoat7u
expanded_url: https://twitter.com/dev_cma/status/1581990427372109826/photo/1
display_url: pic.twitter.com/Z0NNkoat7u
media_key: '3_1581990310632050690'
- start: 13
end: 36
url: https://t.co/Z0NNkoat7u
expanded_url: https://twitter.com/dev_cma/status/1581990427372109826/photo/1
display_url: pic.twitter.com/Z0NNkoat7u
media_key: '3_1581990357591433217'
media:
- media_key: '3_1581990310632050690'
type: photo
url: https://pbs.twimg.com/media/FfRbzkdVUAIy7xK.png
width: 640
height: 480
- media_key: '3_1581990357591433217'
type: photo
url: https://pbs.twimg.com/media/FfRb2TZUoAEmWY_.jpg
width: 400
height: 400
statusResponse5:
summary: 画像・動画つき
value:
code: 0
data:
- id: '1582229831671902208'
text: 動画・画像つきツイートてすてす https://t.co/UVG5ApQDjm https://t.co/vuzbXpzTGm
created_at: '2022-10-18T04:39:22.000Z'
entities:
urls:
- start: 16
end: 39
url: https://t.co/UVG5ApQDjm
expanded_url: https://twitter.com/i/web/status/1582229831671902208
display_url: twitter.com/i/web/status/1…
- start: 40
end: 63
url: https://t.co/vuzbXpzTGm
expanded_url: https://twitter.com/dev_cma/status/1582229831671902208/video/1
display_url: pic.twitter.com/vuzbXpzTGm
media_key: '7_1582229783521288194'
media:
- width: 720
media_key: '7_1582229783521288194'
preview_image_url: https://pbs.twimg.com/ext_tw_video_thumb/1582229783521288194/pu/img/E63l4dXvk1wL6EJm.jpg
type: video
height: 1280
- width: 2048
url: https://pbs.twimg.com/media/FfU1mugVUAA4yum.jpg
media_key: '3_1582229783525543936'
type: photo
height: 1536
user:
id: '1543882205264355328'
name: dev-cma
username: dev_cma
profile_image_url: https://abs.twimg.com/sticky/default_profile_images/default_profile_normal.png
created_at: '2022-07-04T09:00:38.000Z'