karaden-prg-ruby 1.0.1 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +14 -1
- data/lib/karaden/config.rb +2 -2
- data/lib/karaden/exception/bulk_message_create_failed_exception.rb +9 -0
- data/lib/karaden/exception/bulk_message_list_message_retry_limit_exceed_exception.rb +9 -0
- data/lib/karaden/exception/bulk_message_show_retry_limit_exceed_exception.rb +9 -0
- data/lib/karaden/exception/file_download_failed_exception.rb +9 -0
- data/lib/karaden/exception/file_not_found_exception.rb +9 -0
- data/lib/karaden/exception/file_upload_failed_exception.rb +9 -0
- data/lib/karaden/model/bulk_file.rb +34 -0
- data/lib/karaden/model/bulk_message.rb +53 -0
- data/lib/karaden/model/message.rb +4 -0
- data/lib/karaden/model/requestable.rb +7 -0
- data/lib/karaden/net/no_contents_response.rb +80 -0
- data/lib/karaden/net/requestor.rb +2 -2
- data/lib/karaden/net/requestor_interface.rb +1 -1
- data/lib/karaden/net/response.rb +8 -0
- data/lib/karaden/net/response_interface.rb +8 -0
- data/lib/karaden/param/message/bulk/bulk_message_create_params.rb +79 -0
- data/lib/karaden/param/message/bulk/bulk_message_download_params.rb +139 -0
- data/lib/karaden/param/message/bulk/bulk_message_list_message_params.rb +72 -0
- data/lib/karaden/param/message/bulk/bulk_message_params.rb +15 -0
- data/lib/karaden/param/message/bulk/bulk_message_show_params.rb +72 -0
- data/lib/karaden/request_options.rb +2 -0
- data/lib/karaden/service/bulk_message_service.rb +90 -0
- data/lib/karaden/utility.rb +31 -1
- data/lib/karaden.rb +15 -0
- data/mock/2023-12-01.yaml +783 -0
- data/mock/2024-03-01.yaml +1061 -0
- data/mock/latest +1 -1
- metadata +19 -2
@@ -0,0 +1,1061 @@
|
|
1
|
+
openapi: 3.0.3
|
2
|
+
x-stoplight:
|
3
|
+
id: 86da2euinng2g
|
4
|
+
info:
|
5
|
+
title: Karaden API
|
6
|
+
description: This is a Karaden API based on the OpenAPI 3.0 specification.
|
7
|
+
version: '2024-03-01'
|
8
|
+
servers:
|
9
|
+
- url: 'http://localhost:8000/api'
|
10
|
+
- url: 'https://dev.cpaas-karaden.com/api'
|
11
|
+
components:
|
12
|
+
securitySchemes:
|
13
|
+
Bearer:
|
14
|
+
type: http
|
15
|
+
scheme: bearer
|
16
|
+
description: APIにアクセスするためのアクセストークンです。
|
17
|
+
schemas:
|
18
|
+
Message:
|
19
|
+
type: object
|
20
|
+
x-internal: true
|
21
|
+
description: ''
|
22
|
+
title: メッセージ
|
23
|
+
x-examples:
|
24
|
+
example-1:
|
25
|
+
id: 82bdf9de-a532-4bf5-86bc-c9a1366e5f4a
|
26
|
+
object: message
|
27
|
+
service_id: 1
|
28
|
+
billing_address_id: 1
|
29
|
+
to: '09012345678'
|
30
|
+
body: 本文
|
31
|
+
tags:
|
32
|
+
- string
|
33
|
+
is_shorten: true
|
34
|
+
is_shorten_clicked: true
|
35
|
+
result: done
|
36
|
+
status: done
|
37
|
+
sent_result: none
|
38
|
+
carrier: docomo
|
39
|
+
charged_count_per_sent: 0
|
40
|
+
scheduled_at: '2020-01-31T23:59:59+09:00'
|
41
|
+
limited_at: '2020-01-31T23:59:59+09:00'
|
42
|
+
sent_at: '2020-01-31T23:59:59+09:00'
|
43
|
+
received_at: '2020-01-31T23:59:59+09:00'
|
44
|
+
charged_at: '2020-01-31T23:59:59+09:00'
|
45
|
+
created_at: '2020-01-31T23:59:59+09:00'
|
46
|
+
updated_at: '2020-01-31T23:59:59+09:00'
|
47
|
+
properties:
|
48
|
+
id:
|
49
|
+
type: string
|
50
|
+
example: 82bdf9de-a532-4bf5-86bc-c9a1366e5f4a
|
51
|
+
description: メッセージID
|
52
|
+
format: uuid
|
53
|
+
readOnly: true
|
54
|
+
object:
|
55
|
+
type: string
|
56
|
+
default: message
|
57
|
+
example: message
|
58
|
+
description: オブジェクトの型
|
59
|
+
enum:
|
60
|
+
- message
|
61
|
+
readOnly: true
|
62
|
+
service_id:
|
63
|
+
type: integer
|
64
|
+
example: 1
|
65
|
+
description: サービス設定ID
|
66
|
+
billing_address_id:
|
67
|
+
type: integer
|
68
|
+
description: 請求先ID
|
69
|
+
example: 1
|
70
|
+
readOnly: true
|
71
|
+
to:
|
72
|
+
type: string
|
73
|
+
example: '09012345678'
|
74
|
+
description: 送信先電話番号
|
75
|
+
pattern: '^[0-9]{11}$'
|
76
|
+
body:
|
77
|
+
type: string
|
78
|
+
example: 本文
|
79
|
+
description: 本文
|
80
|
+
tags:
|
81
|
+
type: array
|
82
|
+
description: タグ
|
83
|
+
items:
|
84
|
+
type: string
|
85
|
+
readOnly: true
|
86
|
+
'tags[]':
|
87
|
+
type: array
|
88
|
+
description: |
|
89
|
+
タグ
|
90
|
+
items:
|
91
|
+
type: string
|
92
|
+
writeOnly: true
|
93
|
+
is_shorten:
|
94
|
+
type: boolean
|
95
|
+
description: 短縮URL
|
96
|
+
is_shorten_clicked:
|
97
|
+
type: boolean
|
98
|
+
description: 短縮URLへのアクセス有無
|
99
|
+
result:
|
100
|
+
type: string
|
101
|
+
enum:
|
102
|
+
- done
|
103
|
+
- processing
|
104
|
+
description: 結果
|
105
|
+
readOnly: true
|
106
|
+
status:
|
107
|
+
type: string
|
108
|
+
enum:
|
109
|
+
- done
|
110
|
+
- waiting
|
111
|
+
- error
|
112
|
+
- canceled
|
113
|
+
- processing_error
|
114
|
+
description: 状態
|
115
|
+
readOnly: true
|
116
|
+
sent_result:
|
117
|
+
type: string
|
118
|
+
enum:
|
119
|
+
- none
|
120
|
+
- received
|
121
|
+
- unconnected
|
122
|
+
- error
|
123
|
+
- unknown
|
124
|
+
description: 送達結果
|
125
|
+
readOnly: true
|
126
|
+
carrier:
|
127
|
+
type: string
|
128
|
+
enum:
|
129
|
+
- docomo
|
130
|
+
- softbank
|
131
|
+
- au
|
132
|
+
- rakuten
|
133
|
+
- checking
|
134
|
+
- unknown
|
135
|
+
description: キャリア
|
136
|
+
readOnly: true
|
137
|
+
charged_count_per_sent:
|
138
|
+
type: integer
|
139
|
+
description: 課金対象通数
|
140
|
+
example: 1
|
141
|
+
readOnly: true
|
142
|
+
error:
|
143
|
+
$ref: '#/components/schemas/Error'
|
144
|
+
scheduled_at:
|
145
|
+
type: string
|
146
|
+
example: '2020-01-31T23:59:59+09:00'
|
147
|
+
description: 送信予定日時<br>(ISO 8601形式)<br>一括メッセージ送信では使用しません。
|
148
|
+
format: date-time
|
149
|
+
limited_at:
|
150
|
+
example: '2020-01-31T23:59:59+09:00'
|
151
|
+
description: 送信限度日時<br>(ISO 8601形式)
|
152
|
+
format: date-time
|
153
|
+
type: string
|
154
|
+
sent_at:
|
155
|
+
type: string
|
156
|
+
example: '2020-01-31T23:59:59+09:00'
|
157
|
+
description: 送信日時<br>(ISO 8601形式)
|
158
|
+
format: date-time
|
159
|
+
readOnly: true
|
160
|
+
received_at:
|
161
|
+
type: string
|
162
|
+
example: '2020-01-31T23:59:59+09:00'
|
163
|
+
description: 着信日時<br>(ISO 8601形式)
|
164
|
+
format: date-time
|
165
|
+
readOnly: true
|
166
|
+
charged_at:
|
167
|
+
type: string
|
168
|
+
example: '2020-01-31T23:59:59+09:00'
|
169
|
+
description: 課金確定日時<br>(ISO 8601形式)
|
170
|
+
format: date-time
|
171
|
+
readOnly: true
|
172
|
+
created_at:
|
173
|
+
type: string
|
174
|
+
example: '2020-01-31T23:59:59+09:00'
|
175
|
+
description: 受付日時<br>(ISO 8601形式)
|
176
|
+
format: date-time
|
177
|
+
readOnly: true
|
178
|
+
updated_at:
|
179
|
+
type: string
|
180
|
+
description: 更新日時<br>(ISO 8601形式)
|
181
|
+
format: date-time
|
182
|
+
example: '2020-01-31T23:59:59+09:00'
|
183
|
+
readOnly: true
|
184
|
+
required:
|
185
|
+
- service_id
|
186
|
+
- to
|
187
|
+
- body
|
188
|
+
SentMessage:
|
189
|
+
type: object
|
190
|
+
x-internal: true
|
191
|
+
description: ''
|
192
|
+
title: メッセージ
|
193
|
+
x-examples:
|
194
|
+
example-1:
|
195
|
+
id: 82bdf9de-a532-4bf5-86bc-c9a1366e5f4a
|
196
|
+
object: message
|
197
|
+
service_id: 1
|
198
|
+
billing_address_id: 1
|
199
|
+
to: '09012345678'
|
200
|
+
body: 本文
|
201
|
+
tags:
|
202
|
+
- string
|
203
|
+
is_shorten: true
|
204
|
+
is_shorten_clicked: true
|
205
|
+
result: done
|
206
|
+
status: done
|
207
|
+
sent_result: none
|
208
|
+
carrier: docomo
|
209
|
+
charged_count_per_sent: 0
|
210
|
+
scheduled_at: '2020-01-31T23:59:59+09:00'
|
211
|
+
limited_at: '2020-01-31T23:59:59+09:00'
|
212
|
+
sent_at: '2020-01-31T23:59:59+09:00'
|
213
|
+
received_at: '2020-01-31T23:59:59+09:00'
|
214
|
+
charged_at: '2020-01-31T23:59:59+09:00'
|
215
|
+
created_at: '2020-01-31T23:59:59+09:00'
|
216
|
+
updated_at: '2020-01-31T23:59:59+09:00'
|
217
|
+
properties:
|
218
|
+
id:
|
219
|
+
type: string
|
220
|
+
example: 82bdf9de-a532-4bf5-86bc-c9a1366e5f4a
|
221
|
+
description: メッセージID
|
222
|
+
format: uuid
|
223
|
+
object:
|
224
|
+
type: string
|
225
|
+
default: message
|
226
|
+
example: message
|
227
|
+
description: オブジェクトの型
|
228
|
+
enum:
|
229
|
+
- message
|
230
|
+
service_id:
|
231
|
+
type: integer
|
232
|
+
example: 1
|
233
|
+
description: サービス設定ID
|
234
|
+
billing_address_id:
|
235
|
+
type: integer
|
236
|
+
description: 請求先ID
|
237
|
+
example: 1
|
238
|
+
to:
|
239
|
+
type: string
|
240
|
+
example: '09012345678'
|
241
|
+
description: 送信先電話番号
|
242
|
+
pattern: '^[0-9]{11}$'
|
243
|
+
readOnly: true
|
244
|
+
body:
|
245
|
+
type: string
|
246
|
+
example: 本文
|
247
|
+
description: 本文
|
248
|
+
readOnly: true
|
249
|
+
tags:
|
250
|
+
type: array
|
251
|
+
description: タグ
|
252
|
+
items:
|
253
|
+
type: string
|
254
|
+
is_shorten:
|
255
|
+
type: boolean
|
256
|
+
description: 短縮URL
|
257
|
+
result:
|
258
|
+
type: string
|
259
|
+
enum:
|
260
|
+
- done
|
261
|
+
- processing
|
262
|
+
description: 結果
|
263
|
+
status:
|
264
|
+
type: string
|
265
|
+
enum:
|
266
|
+
- done
|
267
|
+
- waiting
|
268
|
+
- error
|
269
|
+
- canceled
|
270
|
+
description: 状態
|
271
|
+
sent_result:
|
272
|
+
type: string
|
273
|
+
enum:
|
274
|
+
- none
|
275
|
+
- received
|
276
|
+
- unconnected
|
277
|
+
- error
|
278
|
+
- unknown
|
279
|
+
description: 送達結果
|
280
|
+
carrier:
|
281
|
+
type: string
|
282
|
+
enum:
|
283
|
+
- docomo
|
284
|
+
- softbank
|
285
|
+
- au
|
286
|
+
- rakuten
|
287
|
+
- checking
|
288
|
+
- unknown
|
289
|
+
description: キャリア
|
290
|
+
charged_count_per_sent:
|
291
|
+
type: integer
|
292
|
+
description: 課金対象通数
|
293
|
+
example: 1
|
294
|
+
scheduled_at:
|
295
|
+
type: string
|
296
|
+
example: '2020-01-31T23:59:59+09:00'
|
297
|
+
description: 送信予定日時<br>(ISO 8601形式)
|
298
|
+
format: date-time
|
299
|
+
limited_at:
|
300
|
+
example: '2020-01-31T23:59:59+09:00'
|
301
|
+
description: 送信限度日時<br>(ISO 8601形式)
|
302
|
+
format: date-time
|
303
|
+
type: string
|
304
|
+
sent_at:
|
305
|
+
type: string
|
306
|
+
example: '2020-01-31T23:59:59+09:00'
|
307
|
+
description: 送信日時<br>(ISO 8601形式)
|
308
|
+
format: date-time
|
309
|
+
received_at:
|
310
|
+
type: string
|
311
|
+
example: '2020-01-31T23:59:59+09:00'
|
312
|
+
description: 着信日時<br>(ISO 8601形式)
|
313
|
+
format: date-time
|
314
|
+
charged_at:
|
315
|
+
type: string
|
316
|
+
example: '2020-01-31T23:59:59+09:00'
|
317
|
+
description: 課金確定日時<br>(ISO 8601形式)
|
318
|
+
format: date-time
|
319
|
+
created_at:
|
320
|
+
type: string
|
321
|
+
example: '2020-01-31T23:59:59+09:00'
|
322
|
+
description: 受付日時<br>(ISO 8601形式)
|
323
|
+
format: date-time
|
324
|
+
updated_at:
|
325
|
+
type: string
|
326
|
+
description: 更新日時<br>(ISO 8601形式)
|
327
|
+
readOnly: true
|
328
|
+
required:
|
329
|
+
- id
|
330
|
+
- object
|
331
|
+
- service_id
|
332
|
+
- billing_address_id
|
333
|
+
- to
|
334
|
+
- body
|
335
|
+
- result
|
336
|
+
- status
|
337
|
+
- sent_result
|
338
|
+
- carrier
|
339
|
+
- charged_count_per_sent
|
340
|
+
- created_at
|
341
|
+
- updated_at
|
342
|
+
Error:
|
343
|
+
type: object
|
344
|
+
x-internal: true
|
345
|
+
x-examples:
|
346
|
+
validation_error:
|
347
|
+
object: error
|
348
|
+
code: validation_error
|
349
|
+
message: バリデーションエラーが発生しました
|
350
|
+
errors:
|
351
|
+
key:
|
352
|
+
- エラー詳細1
|
353
|
+
- エラー詳細2
|
354
|
+
title: エラー
|
355
|
+
properties:
|
356
|
+
object:
|
357
|
+
type: string
|
358
|
+
default: error
|
359
|
+
example: error
|
360
|
+
description: オブジェクトの型
|
361
|
+
enum:
|
362
|
+
- error
|
363
|
+
readOnly: true
|
364
|
+
code:
|
365
|
+
type: string
|
366
|
+
description: エラーコード
|
367
|
+
enum:
|
368
|
+
- unauthentication
|
369
|
+
- invalid_tenant
|
370
|
+
- model_not_found
|
371
|
+
- validation_error
|
372
|
+
- can_not_cancel_message
|
373
|
+
- unknown
|
374
|
+
readOnly: true
|
375
|
+
message:
|
376
|
+
type: string
|
377
|
+
description: エラーメッセージ
|
378
|
+
readOnly: true
|
379
|
+
errors:
|
380
|
+
type: object
|
381
|
+
example:
|
382
|
+
key:
|
383
|
+
- エラー詳細1
|
384
|
+
- エラー詳細2
|
385
|
+
description: |-
|
386
|
+
エラーの詳細をエラーが発生したリソースのプロパティ毎に返します。<br />
|
387
|
+
オブジェクトのプロパティ名は、エラーが発生したリソースのプロパティ名です。<br />
|
388
|
+
オブジェクトの値は、発生したすべてのエラーメッセージ(配列)です。
|
389
|
+
readOnly: true
|
390
|
+
required:
|
391
|
+
- object
|
392
|
+
- code
|
393
|
+
- message
|
394
|
+
description: 発生したエラーの詳細<br>Messageのerrorでは一括メッセージ送信のみ使用します。
|
395
|
+
BulkMessage:
|
396
|
+
title: 一括メッセージ送信
|
397
|
+
x-stoplight:
|
398
|
+
id: cy7hr6o7c2uhh
|
399
|
+
type: object
|
400
|
+
description: 一括メッセージ送信
|
401
|
+
properties:
|
402
|
+
id:
|
403
|
+
type: string
|
404
|
+
example: 82bdf9de-a532-4bf5-86bc-c9a1366e5f4a
|
405
|
+
format: uuid
|
406
|
+
description: 一括メッセージ送信ID
|
407
|
+
object:
|
408
|
+
type: string
|
409
|
+
default: bulk_message
|
410
|
+
enum:
|
411
|
+
- bulk_message
|
412
|
+
description: オブジェクトの型
|
413
|
+
readOnly: true
|
414
|
+
status:
|
415
|
+
type: string
|
416
|
+
enum:
|
417
|
+
- done
|
418
|
+
- waiting
|
419
|
+
- processing
|
420
|
+
- error
|
421
|
+
description: '一括メッセージ送信状態<br>done: 完了<br>waiting: 処理待ち<br>error: 処理エラー<br>processing: 処理中'
|
422
|
+
readOnly: true
|
423
|
+
error:
|
424
|
+
$ref: '#/components/schemas/Error'
|
425
|
+
created_at:
|
426
|
+
type: string
|
427
|
+
example: '2020-01-31T23:59:59+09:00'
|
428
|
+
description: 受付日時
|
429
|
+
format: date-time
|
430
|
+
updated_at:
|
431
|
+
type: string
|
432
|
+
example: '2020-01-31T23:59:59+09:00'
|
433
|
+
description: 更新日時
|
434
|
+
format: date-time
|
435
|
+
required:
|
436
|
+
- object
|
437
|
+
- status
|
438
|
+
- created_at
|
439
|
+
- updated_at
|
440
|
+
BulkFile:
|
441
|
+
title: 一括送信ファイル
|
442
|
+
x-stoplight:
|
443
|
+
id: 6znyfj60gkowh
|
444
|
+
type: object
|
445
|
+
description: 一括送信する際のファイルのアップロード先に関する情報
|
446
|
+
properties:
|
447
|
+
id:
|
448
|
+
type: string
|
449
|
+
example: 82bdf9de-a532-4bf5-86bc-c9a1366e5f4a
|
450
|
+
format: uuid
|
451
|
+
description: 一括送信ファイルID
|
452
|
+
object:
|
453
|
+
type: string
|
454
|
+
default: bulk_file
|
455
|
+
example: bulk_file
|
456
|
+
description: オブジェクトの型
|
457
|
+
enum:
|
458
|
+
- bulk_file
|
459
|
+
readOnly: true
|
460
|
+
url:
|
461
|
+
type: string
|
462
|
+
format: uri
|
463
|
+
example: https://example.com
|
464
|
+
description: アップロード先URL
|
465
|
+
readOnly: true
|
466
|
+
created_at:
|
467
|
+
type: string
|
468
|
+
format: date-time
|
469
|
+
example: '2020-01-31T23:59:59+09:00'
|
470
|
+
description: 受付日時<br>ISO8601形式
|
471
|
+
readOnly: true
|
472
|
+
expires_at:
|
473
|
+
type: string
|
474
|
+
format: date-time
|
475
|
+
example: '2020-01-31T23:59:59+09:00'
|
476
|
+
description: アップロード先URLの有効期限<br>ISO8601形式
|
477
|
+
readOnly: true
|
478
|
+
parameters:
|
479
|
+
ApiVersion:
|
480
|
+
name: Karaden-Version
|
481
|
+
in: header
|
482
|
+
schema:
|
483
|
+
type: string
|
484
|
+
default: '2024-03-01'
|
485
|
+
example: '2024-03-01'
|
486
|
+
description: APIバージョン<br />指定されない場合、空電で管理するAPIバージョンで処理されます。
|
487
|
+
TenantId:
|
488
|
+
name: tenant_id
|
489
|
+
in: path
|
490
|
+
required: true
|
491
|
+
schema:
|
492
|
+
type: string
|
493
|
+
format: uuid
|
494
|
+
description: テナントID
|
495
|
+
MessageId:
|
496
|
+
name: message_id
|
497
|
+
in: path
|
498
|
+
required: true
|
499
|
+
schema:
|
500
|
+
type: string
|
501
|
+
format: uuid
|
502
|
+
description: メッセージID
|
503
|
+
Page:
|
504
|
+
name: page
|
505
|
+
in: query
|
506
|
+
required: false
|
507
|
+
schema:
|
508
|
+
type: integer
|
509
|
+
example: 1
|
510
|
+
description: ページ
|
511
|
+
PerPage:
|
512
|
+
name: per_page
|
513
|
+
in: query
|
514
|
+
required: false
|
515
|
+
schema:
|
516
|
+
type: integer
|
517
|
+
default: 20
|
518
|
+
maximum: 100
|
519
|
+
description: 1ページあたりの取得件数<br>最大100まで
|
520
|
+
Status:
|
521
|
+
name: status
|
522
|
+
in: query
|
523
|
+
schema:
|
524
|
+
type: string
|
525
|
+
enum:
|
526
|
+
- done
|
527
|
+
- waiting
|
528
|
+
- error
|
529
|
+
- canceled
|
530
|
+
description: '状態<br>done: 送信済<br>waiting: 送信待ち<br>error: 送信エラー<br>canceled: 送信キャンセル'
|
531
|
+
Result:
|
532
|
+
name: result
|
533
|
+
in: query
|
534
|
+
required: false
|
535
|
+
schema:
|
536
|
+
type: string
|
537
|
+
enum:
|
538
|
+
- done
|
539
|
+
- processing
|
540
|
+
description: '結果<br>done: 完了<br>processing: 処理中'
|
541
|
+
SentResult:
|
542
|
+
name: sent_result
|
543
|
+
in: query
|
544
|
+
schema:
|
545
|
+
type: string
|
546
|
+
enum:
|
547
|
+
- none
|
548
|
+
- received
|
549
|
+
- unconnected
|
550
|
+
- error
|
551
|
+
- unknown
|
552
|
+
description: '送達結果<br>none: 送達結果なし<br>received: 着信済<br>unconnected: 圏外<br>error: エラー<br>unknown: 不明'
|
553
|
+
responses: {}
|
554
|
+
security:
|
555
|
+
- Bearer: []
|
556
|
+
paths:
|
557
|
+
'/{tenant_id}/messages':
|
558
|
+
post:
|
559
|
+
tags:
|
560
|
+
- メッセージ
|
561
|
+
summary: メッセージ送信
|
562
|
+
description: メッセージ送信する
|
563
|
+
operationId: post-tenant_id-messages-message_id
|
564
|
+
consumes:
|
565
|
+
- application/x-www-form-urlencoded
|
566
|
+
produces:
|
567
|
+
- application/json
|
568
|
+
parameters:
|
569
|
+
- $ref: '#/components/parameters/ApiVersion'
|
570
|
+
responses:
|
571
|
+
'200':
|
572
|
+
description: 正常
|
573
|
+
content:
|
574
|
+
application/json:
|
575
|
+
schema:
|
576
|
+
$ref: '#/components/schemas/Message'
|
577
|
+
examples:
|
578
|
+
example-1:
|
579
|
+
value:
|
580
|
+
id: 82bdf9de-a532-4bf5-86bc-c9a1366e5f4a
|
581
|
+
object: message
|
582
|
+
service_id: 1
|
583
|
+
billing_address_id: 1
|
584
|
+
to: '09012345678'
|
585
|
+
body: 本文
|
586
|
+
tags:
|
587
|
+
- string
|
588
|
+
is_shorten: true
|
589
|
+
is_shorten_clicked: true
|
590
|
+
result: done
|
591
|
+
status: done
|
592
|
+
sent_result: none
|
593
|
+
carrier: docomo
|
594
|
+
charged_count_per_sent: 0
|
595
|
+
scheduled_at: '2020-01-31T23:59:59+09:00'
|
596
|
+
limited_at: '2020-01-31T23:59:59+09:00'
|
597
|
+
sent_at: '2020-01-31T23:59:59+09:00'
|
598
|
+
received_at: '2020-01-31T23:59:59+09:00'
|
599
|
+
charged_at: '2020-01-31T23:59:59+09:00'
|
600
|
+
created_at: '2020-01-31T23:59:59+09:00'
|
601
|
+
updated_at: '2020-01-31T23:59:59+09:00'
|
602
|
+
'400':
|
603
|
+
description: Bad Request
|
604
|
+
content:
|
605
|
+
application/json:
|
606
|
+
schema:
|
607
|
+
$ref: '#/components/schemas/Error'
|
608
|
+
examples:
|
609
|
+
invalid_tenant:
|
610
|
+
value:
|
611
|
+
object: error
|
612
|
+
code: invalid_tenant
|
613
|
+
message: 不正なテナントIDが指定されています
|
614
|
+
errors: null
|
615
|
+
invalid_version:
|
616
|
+
value:
|
617
|
+
object: error
|
618
|
+
code: invalid_version
|
619
|
+
message: 不正なバージョンが指定されています
|
620
|
+
errors: null
|
621
|
+
'401':
|
622
|
+
description: Unauthorized
|
623
|
+
content:
|
624
|
+
application/json:
|
625
|
+
schema:
|
626
|
+
$ref: '#/components/schemas/Error'
|
627
|
+
examples:
|
628
|
+
unauthentication:
|
629
|
+
value:
|
630
|
+
object: error
|
631
|
+
code: unauthentication
|
632
|
+
message: 認証に失敗しました、指定されているトークンは利用できません
|
633
|
+
errors: null
|
634
|
+
'404':
|
635
|
+
description: Not Found
|
636
|
+
content:
|
637
|
+
application/json:
|
638
|
+
schema:
|
639
|
+
$ref: '#/components/schemas/Error'
|
640
|
+
examples:
|
641
|
+
model_not_found:
|
642
|
+
value:
|
643
|
+
object: error
|
644
|
+
code: model_not_found
|
645
|
+
message: 対象となるモデルが見つかりませんでした、または指定されたトークンでは操作できない可能性があります。
|
646
|
+
errors: null
|
647
|
+
'422':
|
648
|
+
description: Unprocessable Entity
|
649
|
+
content:
|
650
|
+
application/json:
|
651
|
+
schema:
|
652
|
+
$ref: '#/components/schemas/Error'
|
653
|
+
examples:
|
654
|
+
validation_error:
|
655
|
+
value:
|
656
|
+
object: error
|
657
|
+
code: validation_error
|
658
|
+
message: バリデーションエラーが発生しました
|
659
|
+
errors:
|
660
|
+
key:
|
661
|
+
- エラー詳細1
|
662
|
+
- エラー詳細2
|
663
|
+
'500':
|
664
|
+
description: Internal Server Error
|
665
|
+
content:
|
666
|
+
application/json:
|
667
|
+
schema:
|
668
|
+
$ref: '#/components/schemas/Error'
|
669
|
+
examples:
|
670
|
+
unknown:
|
671
|
+
value:
|
672
|
+
object: error
|
673
|
+
code: unknown
|
674
|
+
message: 不明なエラーが発生しました
|
675
|
+
errors: null
|
676
|
+
requestBody:
|
677
|
+
content:
|
678
|
+
application/x-www-form-urlencoded:
|
679
|
+
schema:
|
680
|
+
$ref: '#/components/schemas/Message'
|
681
|
+
examples:
|
682
|
+
example-1:
|
683
|
+
value:
|
684
|
+
id: 999
|
685
|
+
object: message
|
686
|
+
service_id: 999
|
687
|
+
to: 0
|
688
|
+
body: 本文
|
689
|
+
'tags[]':
|
690
|
+
- タグ1
|
691
|
+
- タグ2
|
692
|
+
scheduled_at: '2020-01-31T23:59:59+09:00'
|
693
|
+
encoding:
|
694
|
+
'tags[]':
|
695
|
+
style: form
|
696
|
+
explode: true
|
697
|
+
description: ''
|
698
|
+
get:
|
699
|
+
tags:
|
700
|
+
- メッセージ
|
701
|
+
summary: メッセージ取得(一覧)
|
702
|
+
description: メッセージ取得(一覧)する
|
703
|
+
operationId: get-tenant_id-messages
|
704
|
+
responses:
|
705
|
+
'200':
|
706
|
+
description: OK
|
707
|
+
content:
|
708
|
+
application/json:
|
709
|
+
schema:
|
710
|
+
type: object
|
711
|
+
properties:
|
712
|
+
object:
|
713
|
+
type: string
|
714
|
+
default: list
|
715
|
+
example: list
|
716
|
+
description: オブジェクトの型
|
717
|
+
readOnly: true
|
718
|
+
has_more:
|
719
|
+
type: boolean
|
720
|
+
data:
|
721
|
+
type: array
|
722
|
+
uniqueItems: true
|
723
|
+
description: 取得したデータ
|
724
|
+
items:
|
725
|
+
$ref: '#/components/schemas/Message'
|
726
|
+
readOnly: true
|
727
|
+
required:
|
728
|
+
- object
|
729
|
+
- has_more
|
730
|
+
- data
|
731
|
+
readOnly: true
|
732
|
+
examples:
|
733
|
+
example-1:
|
734
|
+
value:
|
735
|
+
object: list
|
736
|
+
has_more: true
|
737
|
+
data:
|
738
|
+
- id: 82bdf9de-a532-4bf5-86bc-c9a1366e5f4a
|
739
|
+
object: message
|
740
|
+
service_id: 1
|
741
|
+
billing_address_id: 1
|
742
|
+
to: '09012345678'
|
743
|
+
body: 本文
|
744
|
+
tags:
|
745
|
+
- string
|
746
|
+
is_shorten: true
|
747
|
+
is_shorten_clicked: true
|
748
|
+
result: done
|
749
|
+
status: done
|
750
|
+
sent_result: none
|
751
|
+
carrier: docomo
|
752
|
+
charged_count_per_sent: 0
|
753
|
+
scheduled_at: '2020-01-31T23:59:59+09:00'
|
754
|
+
limited_at: '2020-01-31T23:59:59+09:00'
|
755
|
+
sent_at: '2020-01-31T23:59:59+09:00'
|
756
|
+
received_at: '2020-01-31T23:59:59+09:00'
|
757
|
+
charged_at: '2020-01-31T23:59:59+09:00'
|
758
|
+
created_at: '2020-01-31T23:59:59+09:00'
|
759
|
+
updated_at: '2020-01-31T23:59:59+09:00'
|
760
|
+
parameters:
|
761
|
+
- $ref: '#/components/parameters/ApiVersion'
|
762
|
+
- schema:
|
763
|
+
type: integer
|
764
|
+
example: 1
|
765
|
+
in: query
|
766
|
+
name: service_id
|
767
|
+
description: サービス設定ID
|
768
|
+
- schema:
|
769
|
+
type: string
|
770
|
+
example: '09012345678'
|
771
|
+
in: query
|
772
|
+
name: to
|
773
|
+
description: 送信先番号
|
774
|
+
- $ref: '#/components/parameters/Status'
|
775
|
+
- $ref: '#/components/parameters/Result'
|
776
|
+
- $ref: '#/components/parameters/SentResult'
|
777
|
+
- schema:
|
778
|
+
type: string
|
779
|
+
in: query
|
780
|
+
name: tag
|
781
|
+
description: タグ
|
782
|
+
- schema:
|
783
|
+
type: string
|
784
|
+
format: date-time
|
785
|
+
example: '2020-01-31T23:59:59+09:00'
|
786
|
+
in: query
|
787
|
+
name: start_at
|
788
|
+
description: 受付日時(開始)<br>(ISO 8601形式)
|
789
|
+
- schema:
|
790
|
+
type: string
|
791
|
+
format: date-time
|
792
|
+
example: '2020-01-31T23:59:59+09:00'
|
793
|
+
in: query
|
794
|
+
name: end_at
|
795
|
+
description: 受付日時(終了)<br>(ISO 8601形式)
|
796
|
+
- $ref: '#/components/parameters/Page'
|
797
|
+
- $ref: '#/components/parameters/PerPage'
|
798
|
+
parameters:
|
799
|
+
- $ref: '#/components/parameters/TenantId'
|
800
|
+
'/{tenant_id}/messages/{message_id}':
|
801
|
+
get:
|
802
|
+
tags:
|
803
|
+
- メッセージ
|
804
|
+
summary: メッセージ取得(単体)
|
805
|
+
description: メッセージ取得(単体)する
|
806
|
+
operationId: get-tenant_id-messages-message_id
|
807
|
+
responses:
|
808
|
+
'200':
|
809
|
+
description: OK
|
810
|
+
content:
|
811
|
+
application/json:
|
812
|
+
schema:
|
813
|
+
$ref: '#/components/schemas/Message'
|
814
|
+
parameters:
|
815
|
+
- $ref: '#/components/parameters/ApiVersion'
|
816
|
+
parameters:
|
817
|
+
- $ref: '#/components/parameters/TenantId'
|
818
|
+
- $ref: '#/components/parameters/MessageId'
|
819
|
+
'/{tenant_id}/messages/{message_id}/cancel':
|
820
|
+
post:
|
821
|
+
tags:
|
822
|
+
- メッセージ
|
823
|
+
summary: メッセージ送信キャンセル
|
824
|
+
description: |-
|
825
|
+
メッセージ送信キャンセルする
|
826
|
+
メッセージは送信予約日時の5分前までキャンセル可能
|
827
|
+
operationId: post-tenant_id-messages-message_id-cancel
|
828
|
+
parameters:
|
829
|
+
- $ref: '#/components/parameters/ApiVersion'
|
830
|
+
responses:
|
831
|
+
'200':
|
832
|
+
description: OK
|
833
|
+
content:
|
834
|
+
application/json:
|
835
|
+
schema:
|
836
|
+
$ref: '#/components/schemas/Message'
|
837
|
+
'400':
|
838
|
+
description: Bad Request
|
839
|
+
content:
|
840
|
+
application/json:
|
841
|
+
schema:
|
842
|
+
$ref: '#/components/schemas/Error'
|
843
|
+
examples:
|
844
|
+
example-1:
|
845
|
+
value:
|
846
|
+
object: error
|
847
|
+
code: can_not_cancel_message
|
848
|
+
message: メッセージのキャンセルができません、予約投稿のメッセージは開始5分前までキャンセル可能です。
|
849
|
+
errors: null
|
850
|
+
parameters:
|
851
|
+
- $ref: '#/components/parameters/TenantId'
|
852
|
+
- $ref: '#/components/parameters/MessageId'
|
853
|
+
/callback/messages/test/sent:
|
854
|
+
post:
|
855
|
+
summary: メッセージ送達結果通知
|
856
|
+
operationId: post-callback-messages-test-sent
|
857
|
+
responses:
|
858
|
+
'200':
|
859
|
+
description: OK
|
860
|
+
description: メッセージを送信した後、serviceに指定されているエンドポイントへ送達結果を通知する
|
861
|
+
security: []
|
862
|
+
parameters:
|
863
|
+
- $ref: '#/components/parameters/ApiVersion'
|
864
|
+
tags:
|
865
|
+
- メッセージ
|
866
|
+
requestBody:
|
867
|
+
content:
|
868
|
+
application/json:
|
869
|
+
schema:
|
870
|
+
$ref: '#/components/schemas/SentMessage'
|
871
|
+
description: ''
|
872
|
+
'/{tenant_id}/messages/bulks/{bulk_message_id}':
|
873
|
+
parameters:
|
874
|
+
- schema:
|
875
|
+
type: string
|
876
|
+
format: uuid
|
877
|
+
name: tenant_id
|
878
|
+
in: path
|
879
|
+
required: true
|
880
|
+
description: テナントID
|
881
|
+
- schema:
|
882
|
+
type: string
|
883
|
+
format: uuid
|
884
|
+
name: bulk_message_id
|
885
|
+
in: path
|
886
|
+
required: true
|
887
|
+
description: 一括メッセージ送信ID
|
888
|
+
get:
|
889
|
+
summary: メッセージの一括送信を取得(単体)
|
890
|
+
tags:
|
891
|
+
- メッセージ
|
892
|
+
responses:
|
893
|
+
'200':
|
894
|
+
description: メッセージの一括送信を返します。
|
895
|
+
headers: {}
|
896
|
+
content:
|
897
|
+
application/json:
|
898
|
+
schema:
|
899
|
+
$ref: '#/components/schemas/BulkMessage'
|
900
|
+
'404':
|
901
|
+
description: Not Found
|
902
|
+
content:
|
903
|
+
application/json:
|
904
|
+
schema:
|
905
|
+
$ref: '#/components/schemas/Error'
|
906
|
+
'500':
|
907
|
+
description: Internal Server Error
|
908
|
+
content:
|
909
|
+
application/json:
|
910
|
+
schema:
|
911
|
+
$ref: '#/components/schemas/Error'
|
912
|
+
operationId: get-tenant_id-messages-bulk-bulk_message_id
|
913
|
+
description: メッセージの一括送信を取得します。
|
914
|
+
parameters:
|
915
|
+
- $ref: '#/components/parameters/ApiVersion'
|
916
|
+
'/{tenant_id}/messages/bulks/{bulk_message_id}/messages':
|
917
|
+
parameters:
|
918
|
+
- schema:
|
919
|
+
type: string
|
920
|
+
format: uuid
|
921
|
+
name: tenant_id
|
922
|
+
in: path
|
923
|
+
required: true
|
924
|
+
description: テナントID
|
925
|
+
- schema:
|
926
|
+
type: string
|
927
|
+
format: uuid
|
928
|
+
name: bulk_message_id
|
929
|
+
in: path
|
930
|
+
required: true
|
931
|
+
description: 一括送信ID
|
932
|
+
get:
|
933
|
+
summary: 一括送信したメッセージ(一覧)の出力取得
|
934
|
+
tags:
|
935
|
+
- メッセージ
|
936
|
+
responses:
|
937
|
+
'202':
|
938
|
+
description: 一括送信したメッセージ(一覧)の出力を返せないときに返します。
|
939
|
+
'302':
|
940
|
+
description: 一括送信したメッセージ(一覧)の出力を終えました。
|
941
|
+
headers:
|
942
|
+
Location:
|
943
|
+
schema:
|
944
|
+
type: string
|
945
|
+
format: uri
|
946
|
+
description: 一括送信したメッセージ(一覧)の出力ダウンロードURL
|
947
|
+
'404':
|
948
|
+
description: Not Found
|
949
|
+
content:
|
950
|
+
application/json:
|
951
|
+
schema:
|
952
|
+
$ref: '#/components/schemas/Error'
|
953
|
+
'500':
|
954
|
+
description: Internal Server Error
|
955
|
+
content:
|
956
|
+
application/json:
|
957
|
+
schema:
|
958
|
+
$ref: '#/components/schemas/Error'
|
959
|
+
operationId: get-tenant_id-messages-bulks-bulk_message_id-messages-exports
|
960
|
+
parameters:
|
961
|
+
- $ref: '#/components/parameters/ApiVersion'
|
962
|
+
description: |-
|
963
|
+
一括送信したメッセージ(一覧)を取得します。<br>
|
964
|
+
このAPIでは出力したファイルをダウンロードできるURLを返します。<br>
|
965
|
+
ファイルのダウンロードURLの有効期限は15分です。
|
966
|
+
'/{tenant_id}/messages/bulks/files':
|
967
|
+
parameters:
|
968
|
+
- schema:
|
969
|
+
type: string
|
970
|
+
format: uuid
|
971
|
+
name: tenant_id
|
972
|
+
in: path
|
973
|
+
required: true
|
974
|
+
description: テナントID
|
975
|
+
post:
|
976
|
+
summary: 一括送信するメッセージ(一覧)のアップロードファイル取得
|
977
|
+
tags:
|
978
|
+
- メッセージ
|
979
|
+
operationId: post-tenant_id-messages-bulks-files
|
980
|
+
responses:
|
981
|
+
'200':
|
982
|
+
description: 一括送信したいメッセージ(一覧)を記述したファイル情報(アップロード先URLなどを含む)を返します。
|
983
|
+
content:
|
984
|
+
application/json:
|
985
|
+
schema:
|
986
|
+
$ref: '#/components/schemas/BulkFile'
|
987
|
+
'404':
|
988
|
+
description: Not Found
|
989
|
+
content:
|
990
|
+
application/json:
|
991
|
+
schema:
|
992
|
+
$ref: '#/components/schemas/Error'
|
993
|
+
'500':
|
994
|
+
description: Internal Server Error
|
995
|
+
content:
|
996
|
+
application/json:
|
997
|
+
schema:
|
998
|
+
$ref: '#/components/schemas/Error'
|
999
|
+
description: |-
|
1000
|
+
一括送信したいメッセージ(一覧)を記述したファイル情報(アップロード先URLを含む)を取得します。<br>
|
1001
|
+
アップロード先URLの有効期限は15分です。
|
1002
|
+
parameters:
|
1003
|
+
- $ref: '#/components/parameters/ApiVersion'
|
1004
|
+
'/{tenant_id}/messages/bulks':
|
1005
|
+
parameters:
|
1006
|
+
- schema:
|
1007
|
+
type: string
|
1008
|
+
format: uuid
|
1009
|
+
name: tenant_id
|
1010
|
+
in: path
|
1011
|
+
required: true
|
1012
|
+
description: テナントID
|
1013
|
+
post:
|
1014
|
+
summary: メッセージの一括送信
|
1015
|
+
tags:
|
1016
|
+
- メッセージ
|
1017
|
+
operationId: post-tenant_id-bulks
|
1018
|
+
responses:
|
1019
|
+
'200':
|
1020
|
+
description: メッセージの一括送信を受け付けました。
|
1021
|
+
content:
|
1022
|
+
application/json:
|
1023
|
+
schema:
|
1024
|
+
$ref: '#/components/schemas/BulkMessage'
|
1025
|
+
'404':
|
1026
|
+
description: Not Found
|
1027
|
+
content:
|
1028
|
+
application/json:
|
1029
|
+
schema:
|
1030
|
+
$ref: '#/components/schemas/Error'
|
1031
|
+
'409':
|
1032
|
+
description: すでに指定されたファイルでメッセージを一括送信しています。
|
1033
|
+
content:
|
1034
|
+
application/json:
|
1035
|
+
schema:
|
1036
|
+
$ref: '#/components/schemas/Error'
|
1037
|
+
'500':
|
1038
|
+
description: Internal Server Error
|
1039
|
+
content:
|
1040
|
+
application/json:
|
1041
|
+
schema:
|
1042
|
+
$ref: '#/components/schemas/Error'
|
1043
|
+
requestBody:
|
1044
|
+
content:
|
1045
|
+
application/x-www-form-urlencoded:
|
1046
|
+
schema:
|
1047
|
+
type: object
|
1048
|
+
properties:
|
1049
|
+
bulk_file_id:
|
1050
|
+
type: string
|
1051
|
+
format: uuid
|
1052
|
+
description: メッセージの一括送信ファイルID
|
1053
|
+
required:
|
1054
|
+
- bulk_file_id
|
1055
|
+
description: ''
|
1056
|
+
description: |-
|
1057
|
+
メッセージを一括送信します。<br>
|
1058
|
+
指定された一括送信したいメッセージ(一覧)のCSVファイルに記述されたメッセージを一括送信します。<br>
|
1059
|
+
一括送信は遅延して実行するため、レスポンスを返した時点では一括送信は完了していません。
|
1060
|
+
parameters:
|
1061
|
+
- $ref: '#/components/parameters/ApiVersion'
|