@@ -68,7 +68,7 @@ public IncogniaAPI(String clientId, String clientSecret) {
68
68
* Example:
69
69
*
70
70
* <pre>{@code
71
- * IncogniaAPI api = new IncogniaAPI("client-id", "client-secret", Region.BR );
71
+ * IncogniaAPI api = new IncogniaAPI("client-id", "client-secret");
72
72
* try {
73
73
* Address address = Address address =
74
74
* Address.builder()
@@ -128,7 +128,7 @@ public SignupAssessment registerSignup(RegisterSignupRequest request) throws Inc
128
128
* Example:
129
129
*
130
130
* <pre>{@code
131
- * IncogniaAPI api = new IncogniaAPI("client-id", "client-secret", Region.BR );
131
+ * IncogniaAPI api = new IncogniaAPI("client-id", "client-secret");
132
132
* try {
133
133
* RegisterLoginRequest loginRequest = RegisterLoginRequest.builder()
134
134
* .installationId("installation-id")
@@ -183,7 +183,7 @@ public TransactionAssessment registerLogin(RegisterLoginRequest request)
183
183
* Example:
184
184
*
185
185
* <pre>{@code
186
- * IncogniaAPI api = new IncogniaAPI("client-id", "client-secret", Region.BR );
186
+ * IncogniaAPI api = new IncogniaAPI("client-id", "client-secret");
187
187
* try {
188
188
* RegisterLoginRequest loginRequest = RegisterLoginRequest.builder()
189
189
* .accountId("account-id")
@@ -237,7 +237,7 @@ public TransactionAssessment registerWebLogin(RegisterWebLoginRequest request)
237
237
* Example:
238
238
*
239
239
* <pre>{@code
240
- * IncogniaAPI api = new IncogniaAPI("client-id", "client-secret", Region.BR );
240
+ * IncogniaAPI api = new IncogniaAPI("client-id", "client-secret");
241
241
* try {
242
242
* RegisterWebSignupRequest webSignupRequest = RegisterWebSignupRequest.builder().sessionToken(sessionToken).address(address).build();
243
243
* SignupAssessment assessment = api.registerSignup(webSignupRequest);
@@ -275,7 +275,7 @@ public SignupAssessment registerWebSignup(RegisterWebSignupRequest request)
275
275
* Example:
276
276
*
277
277
* <pre>{@code
278
- * IncogniaAPI api = new IncogniaAPI("client-id", "client-secret", Region.BR );
278
+ * IncogniaAPI api = new IncogniaAPI("client-id", "client-secret");
279
279
* try {
280
280
* Address address = Address address =
281
281
* Address.builder()
@@ -374,19 +374,19 @@ public TransactionAssessment registerPayment(RegisterPaymentRequest request)
374
374
* Example:
375
375
*
376
376
* <pre>{@code
377
- * IncogniaAPI api = new IncogniaAPI("client-id", "client-secret", Region.BR );
377
+ * IncogniaAPI api = new IncogniaAPI("client-id", "client-secret");
378
378
* try {
379
- * Instant timestamp = Instant.now();
379
+ * Instant occurredAt = Instant.now();
380
380
* client.registerFeedback(
381
381
* FeedbackEvent.ACCOUNT_TAKEOVER,
382
- * timestamp ,
382
+ * occurredAt ,
383
383
* FeedbackIdentifiers.builder()
384
384
* .installationId("installation-id")
385
385
* .sessionToken("session-token")
386
386
* .accountId("account-id")
387
387
* .externalId("external-id")
388
388
* .signupId("c9ac2803-c868-4b7a-8323-8a6b96298ebe")
389
- * .build();
389
+ * .build()) ;
390
390
* } catch (IncogniaAPIException e) {
391
391
* //Some api error happened (invalid data, invalid credentials)
392
392
* } catch (IncogniaException e) {
@@ -395,23 +395,136 @@ public TransactionAssessment registerPayment(RegisterPaymentRequest request)
395
395
* }</pre>
396
396
*
397
397
* @param feedbackEvent type of feedback event
398
- * @param timestamp Instant when the fraud or event happened
398
+ * @param occurredAt Instant when the fraud or event happened
399
399
* @param identifiers the user's identifiers
400
400
* @throws IncogniaAPIException in case of api errors
401
401
* @throws IncogniaException in case of unexpected errors
402
402
*/
403
403
public void registerFeedback (
404
- FeedbackEvent feedbackEvent , Instant timestamp , FeedbackIdentifiers identifiers )
404
+ FeedbackEvent feedbackEvent , Instant occurredAt , FeedbackIdentifiers identifiers )
405
405
throws IncogniaException {
406
- registerFeedback (feedbackEvent , timestamp , identifiers , false );
406
+ registerFeedback (feedbackEvent , occurredAt , identifiers , false );
407
407
}
408
408
409
+ /**
410
+ * Shares feedback about a risk decision, improving the quality of risk assessments. Check <a
411
+ * href="https://dash.incognia.com/api-reference#operation/feedbacks-post">the docs</a><br>
412
+ * Example:
413
+ *
414
+ * <pre>{@code
415
+ * IncogniaAPI api = new IncogniaAPI("client-id", "client-secret");
416
+ * try {
417
+ * Instant timestamp = Instant.now();
418
+ * client.registerFeedback(
419
+ * FeedbackEvent.ACCOUNT_TAKEOVER,
420
+ * timestamp,
421
+ * FeedbackIdentifiers.builder()
422
+ * .installationId("installation-id")
423
+ * .sessionToken("session-token")
424
+ * .accountId("account-id")
425
+ * .externalId("external-id")
426
+ * .signupId("c9ac2803-c868-4b7a-8323-8a6b96298ebe")
427
+ * .build(),
428
+ * false);
429
+ * } catch (IncogniaAPIException e) {
430
+ * //Some api error happened (invalid data, invalid credentials)
431
+ * } catch (IncogniaException e) {
432
+ * //Something unexpected happened
433
+ * }
434
+ * }</pre>
435
+ *
436
+ * @param feedbackEvent type of feedback event
437
+ * @param occurredAt Instant when the fraud or event happened
438
+ * @param identifiers the user's identifiers
439
+ * @param dryRun whether this request is a dry-run
440
+ * @throws IncogniaAPIException in case of api errors
441
+ * @throws IncogniaException in case of unexpected errors
442
+ */
409
443
public void registerFeedback (
410
444
FeedbackEvent feedbackEvent ,
411
445
Instant occurredAt ,
412
446
FeedbackIdentifiers identifiers ,
413
447
boolean dryRun )
414
448
throws IncogniaException {
449
+ registerFeedback (feedbackEvent .getEventName (), occurredAt , identifiers , dryRun );
450
+ }
451
+
452
+ /**
453
+ * Shares feedback about a risk decision, improving the quality of risk assessments. Check <a
454
+ * href="https://dash.incognia.com/api-reference#operation/feedbacks-post">the docs</a><br>
455
+ * Example:
456
+ *
457
+ * <pre>{@code
458
+ * IncogniaAPI api = new IncogniaAPI("client-id", "client-secret");
459
+ * try {
460
+ * Instant timestamp = Instant.now();
461
+ * client.registerFeedback(
462
+ * "account_takeover",
463
+ * timestamp,
464
+ * FeedbackIdentifiers.builder()
465
+ * .installationId("installation-id")
466
+ * .sessionToken("session-token")
467
+ * .accountId("account-id")
468
+ * .externalId("external-id")
469
+ * .signupId("c9ac2803-c868-4b7a-8323-8a6b96298ebe")
470
+ * .build(),
471
+ * false);
472
+ * } catch (IncogniaAPIException e) {
473
+ * //Some api error happened (invalid data, invalid credentials)
474
+ * } catch (IncogniaException e) {
475
+ * //Something unexpected happened
476
+ * }
477
+ * }</pre>
478
+ *
479
+ * @param feedbackEvent type of feedback event
480
+ * @param occurredAt Instant when the fraud or event happened
481
+ * @param identifiers the user's identifiers
482
+ * @throws IncogniaAPIException in case of api errors
483
+ * @throws IncogniaException in case of unexpected errors
484
+ */
485
+ public void registerFeedback (
486
+ String feedbackEvent , Instant occurredAt , FeedbackIdentifiers identifiers )
487
+ throws IncogniaException {
488
+ registerFeedback (feedbackEvent , occurredAt , identifiers , false );
489
+ }
490
+
491
+ /**
492
+ * Shares feedback about a risk decision, improving the quality of risk assessments. Check <a
493
+ * href="https://dash.incognia.com/api-reference#operation/feedbacks-post">the docs</a><br>
494
+ * Example:
495
+ *
496
+ * <pre>{@code
497
+ * IncogniaAPI api = new IncogniaAPI("client-id", "client-secret");
498
+ * try {
499
+ * Instant timestamp = Instant.now();
500
+ * client.registerFeedback(
501
+ * "account_takeover",
502
+ * timestamp,
503
+ * FeedbackIdentifiers.builder()
504
+ * .installationId("installation-id")
505
+ * .sessionToken("session-token")
506
+ * .accountId("account-id")
507
+ * .externalId("external-id")
508
+ * .signupId("c9ac2803-c868-4b7a-8323-8a6b96298ebe")
509
+ * .build(),
510
+ * false);
511
+ * } catch (IncogniaAPIException e) {
512
+ * //Some api error happened (invalid data, invalid credentials)
513
+ * } catch (IncogniaException e) {
514
+ * //Something unexpected happened
515
+ * }
516
+ * }</pre>
517
+ *
518
+ * @param feedbackEvent type of feedback event
519
+ * @param occurredAt Instant when the fraud or event happened
520
+ * @param identifiers the user's identifiers
521
+ * @param dryRun whether this request is a dry-run
522
+ * @throws IncogniaAPIException in case of api errors
523
+ * @throws IncogniaException in case of unexpected errors
524
+ */
525
+ public void registerFeedback (
526
+ String feedbackEvent , Instant occurredAt , FeedbackIdentifiers identifiers , boolean dryRun )
527
+ throws IncogniaException {
415
528
PostFeedbackRequestBody requestBody =
416
529
PostFeedbackRequestBody .builder ()
417
530
.event (feedbackEvent )
0 commit comments