Skip to content

Commit e4ab557

Browse files
authored
SMSI-666: Add new smart signal: Velocity (#102)
1 parent aad5b45 commit e4ab557

File tree

4 files changed

+124
-3
lines changed

4 files changed

+124
-3
lines changed

examples/get_event_200.json

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,32 @@
277277
"data": {
278278
"result": false
279279
}
280+
},
281+
"velocity": {
282+
"data": {
283+
"distinctIp": {
284+
"intervals": {
285+
"5m": 1,
286+
"1h": 1,
287+
"24h": 1
288+
}
289+
},
290+
"distinctLinkedId": {},
291+
"distinctCountry": {
292+
"intervals": {
293+
"5m": 1,
294+
"1h": 2,
295+
"24h": 2
296+
}
297+
},
298+
"events": {
299+
"intervals": {
300+
"5m": 1,
301+
"1h": 5,
302+
"24h": 5
303+
}
304+
}
305+
}
280306
}
281307
}
282-
}
308+
}

examples/get_event_200_all_errors.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,12 @@
141141
"code": "Failed",
142142
"message": "internal server error"
143143
}
144+
},
145+
"velocity": {
146+
"error": {
147+
"code": "Failed",
148+
"message": "internal server error"
149+
}
144150
}
145151
}
146152
}

examples/webhook.json

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,5 +191,29 @@
191191
},
192192
"remoteControl": {
193193
"result": false
194+
},
195+
"velocity": {
196+
"distinctIp": {
197+
"intervals": {
198+
"5m": 1,
199+
"1h": 1,
200+
"24h": 1
201+
}
202+
},
203+
"distinctLinkedId": {},
204+
"distinctCountry": {
205+
"intervals": {
206+
"5m": 1,
207+
"1h": 2,
208+
"24h": 2
209+
}
210+
},
211+
"events": {
212+
"intervals": {
213+
"5m": 1,
214+
"1h": 5,
215+
"24h": 5
216+
}
217+
}
194218
}
195219
}

schemas/fingerprint-server-api.yaml

Lines changed: 67 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ paths:
250250
tags:
251251
- Events
252252
operationId: 'updateEvent'
253-
summary: Update an event with a given request ID
253+
summary: Update an event with a given request ID
254254
description: |
255255
Change information in existing events specified by `requestId` or *flag suspicious events*.
256256
@@ -635,7 +635,7 @@ paths:
635635
summary: Error response when the secret API key was not provided.
636636
externalValue: '/examples/shared/403_error_token_required.json'
637637
403-wrong-region:
638-
summary: Error response when the API region is different from the region, the calling application is configured with.
638+
summary: Error response when the API region is different from the region, the calling application is configured with.
639639
externalValue: '/examples/shared/403_error_wrong_region.json'
640640

641641
'404':
@@ -918,6 +918,8 @@ components:
918918
$ref: '#/components/schemas/SuspectScoreResult'
919919
remoteControl:
920920
$ref: '#/components/schemas/RemoteControlResult'
921+
velocity:
922+
$ref: '#/components/schemas/VelocityResult'
921923
required:
922924
- visitorId
923925
- $ref: '#/components/schemas/Visit'
@@ -1414,6 +1416,15 @@ components:
14141416
$ref: '#/components/schemas/RemoteControlResult'
14151417
error:
14161418
$ref: '#/components/schemas/ProductError'
1419+
velocity:
1420+
title: SignalResponseVelocity
1421+
type: object
1422+
additionalProperties: false
1423+
properties:
1424+
data:
1425+
$ref: '#/components/schemas/VelocityResult'
1426+
error:
1427+
$ref: '#/components/schemas/ProductError'
14171428
EventResponse:
14181429
description: Contains results from all activated products - Fingerprint Pro, Bot Detection, and others.
14191430
type: object
@@ -1672,6 +1683,33 @@ components:
16721683
example: 0
16731684
required:
16741685
- result
1686+
VelocityResult:
1687+
type: object
1688+
description: >
1689+
Sums key data points for a specific `visitorId` at three distinct time intervals: 5 minutes, 1 hour, and 24 hours as follows:
1690+
1691+
- Number of identification events attributed to the visitor ID
1692+
- Number of distinct IP addresses associated to the visitor ID.
1693+
- Number of distinct countries associated with the visitor ID.
1694+
- Number of distinct `linkedId`s associated with the visitor ID.
1695+
1696+
The `24h` interval of `distinctIp`, `distinctLinkedId`, and `distinctCountry` will be omitted if the number of `events` for the visitor ID in the last 24 hours (`events.intervals.['24h']`) is higher than 20.000.
1697+
1698+
additionalProperties: false
1699+
properties:
1700+
distinctIp:
1701+
$ref: '#/components/schemas/VelocityIntervals'
1702+
distinctLinkedId:
1703+
$ref: '#/components/schemas/VelocityIntervals'
1704+
distinctCountry:
1705+
$ref: '#/components/schemas/VelocityIntervals'
1706+
events:
1707+
$ref: '#/components/schemas/VelocityIntervals'
1708+
required:
1709+
- distinctIp
1710+
- distinctLinkedId
1711+
- distinctCountry
1712+
- events
16751713
RawDeviceAttributesResult:
16761714
type: object
16771715
description: >
@@ -1931,3 +1969,30 @@ components:
19311969
required:
19321970
- code
19331971
- message
1972+
VelocityIntervals:
1973+
type: object
1974+
additionalProperties: false
1975+
properties:
1976+
'intervals':
1977+
$ref: '#/components/schemas/VelocityIntervalResult'
1978+
VelocityIntervalResult:
1979+
type: object
1980+
description: >
1981+
Is absent if the velocity data could not be generated for the visitor ID.
1982+
additionalProperties: false
1983+
properties:
1984+
'5m':
1985+
type: integer
1986+
example: 1
1987+
'1h':
1988+
type: integer
1989+
example: 1
1990+
'24h':
1991+
type: integer
1992+
description: >
1993+
The `24h` interval of `distinctIp`, `distinctLinkedId`, and `distinctCountry` will be omitted if the number of `events`` for the visitor ID in the last 24 hours (`events.intervals.['24h']`) is higher than 20.000.
1994+
example: 1
1995+
required:
1996+
- 5m
1997+
- 1h
1998+

0 commit comments

Comments
 (0)