forked from line/line-openapi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinsight.yml
844 lines (823 loc) · 29.3 KB
/
insight.yml
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
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
---
openapi: 3.0.0
info:
title: LINE Messaging API(Insight)
version: "0.0.1"
description:
This document describes LINE Messaging API(Insight).
servers:
- url: "https://api.line.me"
security:
- Bearer: []
tags:
- name: insight
paths:
"/v2/bot/insight/demographic":
get:
externalDocs:
url: https://developers.line.biz/en/reference/messaging-api/#get-demographic
tags:
- insight
operationId: getFriendsDemographics
description: |+
Retrieves the demographic attributes for a LINE Official Account's
friends.You can only retrieve information about friends for LINE Official
Accounts created by users in Japan (JP), Thailand (TH), Taiwan (TW) and Indonesia
(ID).
responses:
"200":
content:
"application/json":
schema:
$ref: "#/components/schemas/GetFriendsDemographicsResponse"
example:
available: true
genders:
- gender: unknown
percentage: 37.6
- gender: male
percentage: 31.8
- gender: female
percentage: 30.6
ages:
- age: unknown
percentage: 37.6
- age: from50
percentage: 17.3
areas:
- area: unknown
percentage: 42.9
- area: 徳島
percentage: 2.9
appTypes:
- appType: ios
percentage: 62.4
- appType: android
percentage: 27.7
- appType: others
percentage: 9.9
subscriptionPeriods:
- subscriptionPeriod: over365days
percentage: 96.4
- subscriptionPeriod: within365days
percentage: 1.9
- subscriptionPeriod: within180days
percentage: 1.2
- subscriptionPeriod: within90days
percentage: 0.5
- subscriptionPeriod: within30days
percentage: 0.1
- subscriptionPeriod: within7days
percentage: 0
description: "OK"
"/v2/bot/insight/message/delivery":
get:
externalDocs:
url: https://developers.line.biz/en/reference/messaging-api/#get-number-of-delivery-messages
tags:
- insight
operationId: getNumberOfMessageDeliveries
description: |+
Returns the number of messages sent from LINE Official Account
on a specified day.
parameters:
- in: query
name: date
description: |+
Date for which to retrieve number of sent messages.
- Format: yyyyMMdd (e.g. 20191231)
- Timezone: UTC+9
required: true
schema:
type: string
pattern: "^[0-9]{8}$"
minLength: 8
maxLength: 8
responses:
"200":
content:
"application/json":
schema:
$ref: "#/components/schemas/GetNumberOfMessageDeliveriesResponse"
example:
status: ready
broadcast: 5385
targeting: 522
description: "OK"
summary: "Get number of message deliveries"
"/v2/bot/insight/followers":
get:
externalDocs:
url: https://developers.line.biz/en/reference/messaging-api/#get-number-of-followers
tags:
- insight
summary: "Get number of followers"
description: |+
Returns the number of users who have added the LINE Official Account
on or before a specified date.
operationId: getNumberOfFollowers
parameters:
- in: query
name: date
required: false
description: |+
Date for which to retrieve the number of followers.
Format: yyyyMMdd (e.g. 20191231)
Timezone: UTC+9
schema:
type: string
pattern: "^[0-9]{8}$"
maxLength: 8
minLength: 8
responses:
"200":
description: "OK"
content:
"application/json":
schema:
$ref: "#/components/schemas/GetNumberOfFollowersResponse"
example:
status: ready
followers: 7620
targetedReaches: 5848
blocks: 237
"/v2/bot/insight/message/event":
get:
externalDocs:
url: https://developers.line.biz/en/reference/messaging-api/#get-message-event
tags:
- insight
description: |+
Returns statistics about how users interact with narrowcast messages
or broadcast messages sent from your LINE Official Account.
summary: "Get user interaction statistics"
operationId: getMessageEvent
parameters:
- in: query
name: requestId
required: true
description: |+
Request ID of a narrowcast message or broadcast message.
Each Messaging API request has a request ID.
schema:
# TODO maxLength and/or pattern is required for x-line-request-id
type: string
minLength: 1
responses:
"200":
description: "OK"
content:
"application/json":
schema:
$ref: "#/components/schemas/GetMessageEventResponse"
example:
overview:
requestId: f70dd685-499a-4231-a441-f24b8d4fba21
timestamp: 1568214000
delivered: 320
uniqueImpression: 82
uniqueClick: 51
uniqueMediaPlayed:
uniqueMediaPlayed100Percent:
messages:
- seq: 1
impression: 136
mediaPlayed:
mediaPlayed25Percent:
mediaPlayed50Percent:
mediaPlayed75Percent:
mediaPlayed100Percent:
uniqueMediaPlayed:
uniqueMediaPlayed25Percent:
uniqueMediaPlayed50Percent:
uniqueMediaPlayed75Percent:
uniqueMediaPlayed100Percent:
clicks:
- seq: 1
url: https://line.me/
click: 41
uniqueClick: 30
uniqueClickOfRequest: 30
- seq: 1
url: https://www.linebiz.com/
click: 59
uniqueClick: 38
uniqueClickOfRequest: 38
"/v2/bot/insight/message/event/aggregation":
get:
externalDocs:
url: https://developers.line.biz/en/reference/messaging-api/#get-statistics-per-unit
tags:
- insight
description: |+
You can check the per-unit statistics of how users interact with
push messages and multicast messages sent from your LINE Official Account.
operationId: getStatisticsPerUnit
parameters:
- in: query
name: customAggregationUnit
required: true
description: |+
Name of aggregation unit specified when sending the message. Case-sensitive.
For example, `Promotion_a` and `Promotion_A` are regarded as different unit names.
schema:
# https://developers.line.biz/en/reference/messaging-api/#send-push-message-request-body
type: string
pattern: "^[a-zA-Z0-9_]{1,30}$"
minLength: 1
maxLength: 30
- in: query
name: from
required: true
description: |+
Start date of aggregation period.
Format: yyyyMMdd (e.g. 20210301)
Time zone: UTC+9
schema:
type: string
pattern: "^[0-9]{8}$"
example: "20210301"
minLength: 8
maxLength: 8
- in: query
name: to
required: true
description: |+
End date of aggregation period. The end date can be specified for up to 30 days later. For example, if the start date is 20210301, the latest end date is 20210331.
Format: yyyyMMdd (e.g. 20210301)
Time zone: UTC+9
schema:
type: string
pattern: "^[0-9]{8}$"
example: "20210301"
minLength: 8
maxLength: 8
responses:
"200":
description: "OK"
content:
"application/json":
schema:
$ref: "#/components/schemas/GetStatisticsPerUnitResponse"
example:
overview:
uniqueImpression: 40
uniqueClick: 30
uniqueMediaPlayed: 25
uniqueMediaPlayed100Percent: ~
messages:
- seq: 1
impression: 42
mediaPlayed: 30
mediaPlayed25Percent: ~
mediaPlayed50Percent: ~
mediaPlayed75Percent: ~
mediaPlayed100Percent: ~
uniqueMediaPlayed: 25
uniqueMediaPlayed25Percent: ~
uniqueMediaPlayed50Percent: ~
uniqueMediaPlayed75Percent: ~
uniqueMediaPlayed100Percent: ~
clicks:
- seq: 1
url: https://developers.line.biz/
click: 35
uniqueClick: 25
uniqueClickOfRequest: ~
- seq: 1
url: https://www.line-community.me/
click: 29
uniqueClick: ~
uniqueClickOfRequest: ~
components:
securitySchemes:
Bearer:
type: http
scheme: bearer
description: "Channel access token"
schemas:
GetFriendsDemographicsResponse:
externalDocs:
url: https://developers.line.biz/en/reference/messaging-api/#get-demographic
description: "Get friend demographics"
type: object
properties:
available:
type: boolean
description: "true if friend demographic information is available."
genders:
type: array
items:
$ref: "#/components/schemas/GenderTile"
description: "Percentage per gender."
ages:
type: array
items:
$ref: "#/components/schemas/AgeTile"
description: "Percentage per age group."
areas:
type: array
items:
$ref: "#/components/schemas/AreaTile"
description: "Percentage per area."
appTypes:
type: array
items:
$ref: "#/components/schemas/AppTypeTile"
description: "Percentage by OS."
subscriptionPeriods:
items:
$ref: "#/components/schemas/SubscriptionPeriodTile"
type: array
description: "Percentage per friendship duration."
GenderTile:
type: object
properties:
gender:
type: string
enum:
- male
- female
- unknown
description: "users' gender"
percentage:
type: number
format: double
description: "Percentage"
AgeTile:
type: object
properties:
age:
type: string
enum:
- from0to14
- from15to19
- from20to24
- from25to29
- from30to34
- from35to39
- from40to44
- from45to49
- from50
- from50to54
- from55to59
- from60to64
- from65to69
- from70
- unknown
description: "users' age"
percentage:
type: number
format: double
description: "Percentage"
AreaTile:
type: object
properties:
area:
type: string
description: "users' country and region"
percentage:
type: number
format: double
description: "Percentage"
AppTypeTile:
properties:
appType:
type: string
enum:
- ios
- android
- others
description: "users' OS"
percentage:
format: double
type: number
description: "Percentage"
type: object
SubscriptionPeriodTile:
properties:
subscriptionPeriod:
type: string
description: "Subscription period. Possible values: `within7days`, `within90days`, `unknown` etc."
enum:
# Less than 7 days
- within7days
# Equal to or greater than 7 days but less than 30 days
- within30days
# Equal to or greater than 30 days but less than 90 days
- within90days
# Equal to or greater than 90 days but less than 180 days
- within180days
# Equal to or greater than 180 days but less than 365 days
- within365days
# Equal to or greater than 365 days
- over365days
# Unknown
- unknown
percentage:
format: double
type: number
description: "Percentage. Possible values: [0.0,100.0] e.g. 0, 2.9, 37.6."
type: object
GetNumberOfMessageDeliveriesResponse:
externalDocs:
url: https://developers.line.biz/en/reference/messaging-api/#get-number-of-delivery-messages
description: "Get number of message deliveries"
type: object
properties:
status:
type: string
enum:
- ready
- unready
- out_of_service
description: "Status of the counting process."
broadcast:
format: int64
type: integer
description: "Number of messages sent to all of this LINE Official Account's friends (broadcast messages)."
targeting:
format: int64
type: integer
description: "Number of messages sent to some of this LINE Official Account's friends, based on specific attributes (targeted messages)."
autoResponse:
format: int64
type: integer
description: "Number of auto-response messages sent."
welcomeResponse:
format: int64
type: integer
description: "Number of greeting messages sent."
chat:
format: int64
type: integer
description: "Number of messages sent from LINE Official Account Manager [Chat screen](https://www.linebiz.com/jp/manual/OfficialAccountManager/chats/) (only available in Japanese)."
apiBroadcast:
format: int64
type: integer
description: "Number of broadcast messages sent with the `Send broadcast message` Messaging API operation."
apiPush:
format: int64
type: integer
description: "Number of push messages sent with the `Send push message` Messaging API operation."
apiMulticast:
format: int64
type: integer
description: "Number of multicast messages sent with the `Send multicast message` Messaging API operation."
apiNarrowcast:
format: int64
type: integer
description: "Number of narrowcast messages sent with the `Send narrowcast message` Messaging API operation."
apiReply:
format: int64
type: integer
description: "Number of replies sent with the `Send reply message` Messaging API operation."
GetNumberOfFollowersResponse:
externalDocs:
url: https://developers.line.biz/en/reference/messaging-api/#get-number-of-followers
description: "Get number of followers"
type: object
properties:
status:
description: "Calculation status."
type: string
enum:
- ready
- unready
- out_of_service
followers:
type: integer
format: int64
description: |+
The number of times, as of the specified date, that a user added this LINE Official Account as a friend for the first time.
The number doesn't decrease even if a user later blocks the account or when they delete their LINE account.
targetedReaches:
format: int64
type: integer
description: |+
The number of users, as of the specified date, that the LINE Official Account can reach through targeted messages based on gender, age, and/or region.
This number only includes users who are active on LINE or LINE services and whose demographics have a high level of certainty.
blocks:
type: integer
format: int64
description: |+
The number of users blocking the account as of the specified date.
The number decreases when a user unblocks the account.
GetMessageEventResponse:
externalDocs:
url: https://developers.line.biz/en/reference/messaging-api/#get-insight-message-event-response
description: "Statistics about how users interact with narrowcast messages or broadcast messages sent from your LINE Official Account."
properties:
overview:
$ref: "#/components/schemas/GetMessageEventResponseOverview"
messages:
description: "Array of information about individual message bubbles."
type: array
items:
$ref: "#/components/schemas/GetMessageEventResponseMessage"
clicks:
description: "Array of information about opened URLs in the message."
type: array
items:
$ref: "#/components/schemas/GetMessageEventResponseClick"
type: object
GetMessageEventResponseOverview:
description: "Summary of message statistics."
type: object
properties:
requestId:
type: string
description: "Request ID."
timestamp:
format: int64
type: integer
description: "UNIX timestamp for message delivery time in seconds."
delivered:
format: int64
type: integer
description: |+
Number of messages delivered.
This property shows values of less than 20.
However, if all messages have not been sent, it will be null.
uniqueImpression:
format: int64
type: integer
description: "Number of users who opened the message, meaning they displayed at least 1 bubble."
nullable: true
uniqueClick:
format: int64
type: integer
description: "Number of users who opened any URL in the message."
nullable: true
uniqueMediaPlayed:
format: int64
type: integer
description: "Number of users who started playing any video or audio in the message."
nullable: true
uniqueMediaPlayed100Percent:
format: int64
type: integer
description: "Number of users who played the entirety of any video or audio in the message."
nullable: true
GetMessageEventResponseMessage:
type: object
properties:
seq:
format: int32
type: integer
description: "Bubble's serial number."
impression:
format: int64
type: integer
description: "Number of times the bubble was displayed."
nullable: true
mediaPlayed:
format: int64
type: integer
description: "Number of times audio or video in the bubble started playing."
nullable: true
mediaPlayed25Percent:
format: int64
type: integer
description: "Number of times audio or video in the bubble started playing and was played 25% of the total time."
nullable: true
mediaPlayed50Percent:
format: int64
type: integer
description: "Number of times audio or video in the bubble started playing and was played 50% of the total time."
nullable: true
mediaPlayed75Percent:
format: int64
type: integer
description: "Number of times audio or video in the bubble started playing and was played 75% of the total time."
nullable: true
mediaPlayed100Percent:
format: int64
type: integer
description: "Number of times audio or video in the bubble started playing and was played 100% of the total time."
nullable: true
uniqueMediaPlayed:
format: int64
type: integer
description: "Number of users that started playing audio or video in the bubble."
nullable: true
uniqueMediaPlayed25Percent:
format: int64
type: integer
description: "Number of users that started playing audio or video in the bubble and played 25% of the total time."
nullable: true
uniqueMediaPlayed50Percent:
format: int64
type: integer
description: "Number of users that started playing audio or video in the bubble and played 50% of the total time."
nullable: true
uniqueMediaPlayed75Percent:
format: int64
type: integer
description: "Number of users that started playing audio or video in the bubble and played 75% of the total time."
nullable: true
uniqueMediaPlayed100Percent:
format: int64
type: integer
description: "Number of users that started playing audio or video in the bubble and played 100% of the total time."
nullable: true
GetMessageEventResponseClick:
type: object
properties:
seq:
type: integer
format: int32
description: "The URL's serial number."
url:
type: string
description: "URL."
click:
type: integer
format: int64
description: "Number of times the URL was opened."
nullable: true
uniqueClick:
type: integer
format: int64
description: "Number of users that opened the URL."
nullable: true
uniqueClickOfRequest:
type: integer
format: int64
description: "Number of users who opened this url through any link in the message. If a message contains two links to the same URL and a user opens both links, they're counted only once."
nullable: true
GetStatisticsPerUnitResponse:
externalDocs:
url: https://developers.line.biz/en/reference/messaging-api/#get-statistics-per-unit-response
description: "Response object for `get statistics per unit`"
type: object
properties:
overview:
$ref: "#/components/schemas/GetStatisticsPerUnitResponseOverview"
messages:
description: "Array of information about individual message bubbles."
type: array
items:
$ref: "#/components/schemas/GetStatisticsPerUnitResponseMessage"
clicks:
description: "Array of information about opened URLs in the message."
type: array
items:
$ref: "#/components/schemas/GetStatisticsPerUnitResponseClick"
required:
- clicks
- messages
- overview
GetStatisticsPerUnitResponseOverview:
description: "Statistics related to messages."
externalDocs:
url: https://developers.line.biz/en/reference/messaging-api/#get-statistics-per-unit-response
type: object
properties:
uniqueImpression:
format: int64
type: integer
description: "Number of users who opened the message, meaning they displayed at least 1 bubble."
nullable: true
uniqueClick:
format: int64
type: integer
description: "Number of users who opened any URL in the message."
nullable: true
uniqueMediaPlayed:
format: int64
type: integer
description: "Number of users who started playing any video or audio in the message."
nullable: true
uniqueMediaPlayed100Percent:
format: int64
type: integer
description: "Number of users who played the entirety of any video or audio in the message."
nullable: true
GetStatisticsPerUnitResponseMessage:
externalDocs:
url: https://developers.line.biz/en/reference/messaging-api/#get-statistics-per-unit-response
required:
- seq
type: object
properties:
seq:
format: int32
type: integer
description: "Bubble's serial number."
impression:
format: int64
type: integer
description: "Number of times the bubble was displayed."
nullable: true
mediaPlayed:
format: int64
type: integer
description: "Number of times audio or video in the bubble started playing."
nullable: true
mediaPlayed25Percent:
format: int64
type: integer
description: "Number of times audio or video in the bubble started playing and was played 25% of the total time."
nullable: true
mediaPlayed50Percent:
format: int64
type: integer
description: "Number of times audio or video in the bubble started playing and was played 50% of the total time."
nullable: true
mediaPlayed75Percent:
format: int64
type: integer
description: "Number of times audio or video in the bubble started playing and was played 75% of the total time."
nullable: true
mediaPlayed100Percent:
format: int64
type: integer
description: "Number of times audio or video in the bubble started playing and was played 100% of the total time."
nullable: true
uniqueImpression:
format: int64
type: integer
description: "Number of users the bubble was displayed."
nullable: true
uniqueMediaPlayed:
format: int64
type: integer
description: "Number of users that started playing audio or video in the bubble."
nullable: true
uniqueMediaPlayed25Percent:
format: int64
type: integer
description: "Number of users that started playing audio or video in the bubble and played 25% of the total time."
nullable: true
uniqueMediaPlayed50Percent:
format: int64
type: integer
description: "Number of users that started playing audio or video in the bubble and played 50% of the total time."
nullable: true
uniqueMediaPlayed75Percent:
format: int64
type: integer
description: "Number of users that started playing audio or video in the bubble and played 75% of the total time."
nullable: true
uniqueMediaPlayed100Percent:
format: int64
type: integer
description: "Number of users that started playing audio or video in the bubble and played 100% of the total time."
nullable: true
GetStatisticsPerUnitResponseClick:
externalDocs:
url: https://developers.line.biz/en/reference/messaging-api/#get-statistics-per-unit-response
type: object
properties:
seq:
format: int64
type: integer
description: "The URL's serial number."
url:
type: string
description: "URL."
click:
format: int64
type: integer
description: "Number of times the URL in the bubble was opened."
nullable: true
uniqueClick:
format: int64
type: integer
description: "Number of users that opened the URL in the bubble."
nullable: true
uniqueClickOfRequest:
format: int64
type: integer
description: |+
Number of users who opened this url through any link in the message.
If another message bubble contains the same URL and a user opens both links, it's counted only once.
nullable: true
required:
- seq
- url
ErrorResponse:
externalDocs:
url: https://developers.line.biz/en/reference/messaging-api/#error-responses
type: object
required:
- message
properties:
message:
type: string
description: "Message containing information about the error."
details:
type: array
items:
$ref: "#/components/schemas/ErrorDetail"
description: "An array of error details. If the array is empty, this property will not be included in the response."
ErrorDetail:
type: object
properties:
message:
type: string
description: "Details of the error. Not included in the response under certain situations."
property:
type: string
description: "Location of where the error occurred. Returns the JSON field name or query parameter name of the request. Not included in the response under certain situations."