@@ -443,6 +443,91 @@ public void registerFeedback(
443
443
registerFeedback (feedbackEvent .getEventName (), occurredAt , identifiers , dryRun );
444
444
}
445
445
446
+ /**
447
+ * Shares feedback about a risk decision, improving the quality of risk assessments. Check <a
448
+ * href="https://dash.incognia.com/api-reference#operation/feedbacks-post">the docs</a><br>
449
+ * Example:
450
+ *
451
+ * <pre>{@code
452
+ * IncogniaAPI api = new IncogniaAPI("client-id", "client-secret");
453
+ * try {
454
+ * Instant occurredAt = Instant.parse("2024-07-22T15:20:00Z");
455
+ * Instant expiresAt = Instant.parse("2024-07-30T15:20:00Z");
456
+ * api.registerFeedback(
457
+ * FeedbackEvent.ACCOUNT_TAKEOVER,
458
+ * occurredAt,
459
+ * expiresAt,
460
+ * FeedbackIdentifiers.builder()
461
+ * .installationId("installation-id")
462
+ * .accountId("account-id")
463
+ * .build());
464
+ * } catch (IncogniaAPIException e) {
465
+ * //Some api error happened (invalid data, invalid credentials)
466
+ * } catch (IncogniaException e) {
467
+ * //Something unexpected happened
468
+ * }
469
+ * }</pre>
470
+ *
471
+ * @param feedbackEvent type of feedback event
472
+ * @param occurredAt Instant when the fraud or event happened
473
+ * @param expiresAt Instant when the effects of this feedback expires (valid for specific events)
474
+ * @param identifiers the user's identifiers
475
+ * @throws IncogniaAPIException in case of api errors
476
+ * @throws IncogniaException in case of unexpected errors
477
+ */
478
+ public void registerFeedback (
479
+ FeedbackEvent feedbackEvent ,
480
+ Instant occurredAt ,
481
+ Instant expiresAt ,
482
+ FeedbackIdentifiers identifiers )
483
+ throws IncogniaException {
484
+ registerFeedback (feedbackEvent , occurredAt , expiresAt , identifiers , false );
485
+ }
486
+
487
+ /**
488
+ * Shares feedback about a risk decision, improving the quality of risk assessments. Check <a
489
+ * href="https://dash.incognia.com/api-reference#operation/feedbacks-post">the docs</a><br>
490
+ * Example:
491
+ *
492
+ * <pre>{@code
493
+ * IncogniaAPI api = new IncogniaAPI("client-id", "client-secret");
494
+ * try {
495
+ * Instant occurredAt = Instant.parse("2024-07-22T15:20:00Z");
496
+ * Instant expiresAt = Instant.parse("2024-07-30T15:20:00Z");
497
+ * api.registerFeedback(
498
+ * FeedbackEvent.ACCOUNT_TAKEOVER,
499
+ * occurredAt,
500
+ * expiresAt,
501
+ * FeedbackIdentifiers.builder()
502
+ * .installationId("installation-id")
503
+ * .accountId("account-id")
504
+ * .build(),
505
+ * false);
506
+ * } catch (IncogniaAPIException e) {
507
+ * //Some api error happened (invalid data, invalid credentials)
508
+ * } catch (IncogniaException e) {
509
+ * //Something unexpected happened
510
+ * }
511
+ * }</pre>
512
+ *
513
+ * @param feedbackEvent type of feedback event
514
+ * @param occurredAt Instant when the fraud or event happened
515
+ * @param expiresAt Instant when the effects of this feedback expires (valid for specific events)
516
+ * @param identifiers the user's identifiers
517
+ * @param dryRun whether this request is a dry-run
518
+ * @throws IncogniaAPIException in case of api errors
519
+ * @throws IncogniaException in case of unexpected errors
520
+ */
521
+ public void registerFeedback (
522
+ FeedbackEvent feedbackEvent ,
523
+ Instant occurredAt ,
524
+ Instant expiresAt ,
525
+ FeedbackIdentifiers identifiers ,
526
+ boolean dryRun )
527
+ throws IncogniaException {
528
+ registerFeedback (feedbackEvent .getEventName (), occurredAt , expiresAt , identifiers , dryRun );
529
+ }
530
+
446
531
/**
447
532
* Shares feedback about a risk decision, improving the quality of risk assessments. Check <a
448
533
* href="https://dash.incognia.com/api-reference#operation/feedbacks-post">the docs</a><br>
@@ -512,12 +597,96 @@ public void registerFeedback(
512
597
public void registerFeedback (
513
598
String feedbackEvent , Instant occurredAt , FeedbackIdentifiers identifiers , boolean dryRun )
514
599
throws IncogniaException {
600
+ registerFeedback (feedbackEvent , occurredAt , null , identifiers , dryRun );
601
+ }
602
+
603
+ /**
604
+ * Shares feedback about a risk decision, improving the quality of risk assessments. Check <a
605
+ * href="https://dash.incognia.com/api-reference#operation/feedbacks-post">the docs</a><br>
606
+ * Example:
607
+ *
608
+ * <pre>{@code
609
+ * IncogniaAPI api = new IncogniaAPI("client-id", "client-secret");
610
+ * try {
611
+ * Instant occurredAt = Instant.parse("2024-07-22T15:20:00Z");
612
+ * Instant expiresAt = Instant.parse("2024-07-30T15:20:00Z");
613
+ * api.registerFeedback(
614
+ * "account_takeover",
615
+ * occurredAt,
616
+ * expiresAt,
617
+ * FeedbackIdentifiers.builder()
618
+ * .installationId("installation-id")
619
+ * .accountId("account-id")
620
+ * .build());
621
+ * } catch (IncogniaAPIException e) {
622
+ * //Some api error happened (invalid data, invalid credentials)
623
+ * } catch (IncogniaException e) {
624
+ * //Something unexpected happened
625
+ * }
626
+ * }</pre>
627
+ *
628
+ * @param feedbackEvent type of feedback event
629
+ * @param occurredAt Instant when the fraud or event happened
630
+ * @param expiresAt Instant when the effects of this feedback expires (valid for specific events)
631
+ * @param identifiers the user's identifiers
632
+ * @throws IncogniaAPIException in case of api errors
633
+ * @throws IncogniaException in case of unexpected errors
634
+ */
635
+ public void registerFeedback (
636
+ String feedbackEvent , Instant occurredAt , Instant expiresAt , FeedbackIdentifiers identifiers )
637
+ throws IncogniaException {
638
+ registerFeedback (feedbackEvent , occurredAt , expiresAt , identifiers , false );
639
+ }
640
+
641
+ /**
642
+ * Shares feedback about a risk decision, improving the quality of risk assessments. Check <a
643
+ * href="https://dash.incognia.com/api-reference#operation/feedbacks-post">the docs</a><br>
644
+ * Example:
645
+ *
646
+ * <pre>{@code
647
+ * IncogniaAPI api = new IncogniaAPI("client-id", "client-secret");
648
+ * try {
649
+ * Instant occurredAt = Instant.parse("2024-07-22T15:20:00Z");
650
+ * Instant expiresAt = Instant.parse("2024-07-30T15:20:00Z");
651
+ * api.registerFeedback(
652
+ * "account_takeover",
653
+ * occurredAt,
654
+ * expiresAt,
655
+ * FeedbackIdentifiers.builder()
656
+ * .installationId("installation-id")
657
+ * .accountId("account-id")
658
+ * .build(),
659
+ * false);
660
+ * } catch (IncogniaAPIException e) {
661
+ * //Some api error happened (invalid data, invalid credentials)
662
+ * } catch (IncogniaException e) {
663
+ * //Something unexpected happened
664
+ * }
665
+ * }</pre>
666
+ *
667
+ * @param feedbackEvent type of feedback event
668
+ * @param occurredAt Instant when the fraud or event happened
669
+ * @param expiresAt Instant when the effects of this feedback expires (valid for specific events)
670
+ * @param identifiers the user's identifiers
671
+ * @param dryRun whether this request is a dry-run
672
+ * @throws IncogniaAPIException in case of api errors
673
+ * @throws IncogniaException in case of unexpected errors
674
+ */
675
+ public void registerFeedback (
676
+ String feedbackEvent ,
677
+ Instant occurredAt ,
678
+ Instant expiresAt ,
679
+ FeedbackIdentifiers identifiers ,
680
+ boolean dryRun )
681
+ throws IncogniaException {
515
682
PostFeedbackRequestBody requestBody =
516
683
PostFeedbackRequestBody .builder ()
517
684
.event (feedbackEvent )
518
685
.occurredAt (occurredAt )
686
+ .expiresAt (expiresAt )
519
687
.installationId (identifiers .getInstallationId ())
520
688
.sessionToken (identifiers .getSessionToken ())
689
+ .requestToken (identifiers .getRequestToken ())
521
690
.accountId (identifiers .getAccountId ())
522
691
.loginId (identifiers .getLoginId ())
523
692
.paymentId (identifiers .getPaymentId ())
0 commit comments