Skip to content

Commit 88670fa

Browse files
authored
Added missing fields (#160)
* [API-8521] Added missing fields
1 parent 1b41440 commit 88670fa

10 files changed

Lines changed: 94 additions & 5 deletions

File tree

CHANGES.MD

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
3.22.0 (2026-01-05)
2+
=================
3+
- Added support for `$user_email`, `$review.$reviewed_user_id` fields to `$create_content`, `$update_content` events
4+
- Added support for `$brand_name`, `$site_country`, `$site_domain` fields to `$flag_content` event
5+
16
3.21.2 (2025-07-29)
27
=================
38
- Bumped version for `gson` from `2.10` to `2.13.1`

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@ Java 1.7 or later.
1313
<dependency>
1414
<groupId>com.siftscience</groupId>
1515
<artifactId>sift-java</artifactId>
16-
<version>3.21.2</version>
16+
<version>3.22.0</version>
1717
</dependency>
1818
```
1919
### Gradle
2020
```
2121
dependencies {
22-
compile 'com.siftscience:sift-java:3.21.2'
22+
compile 'com.siftscience:sift-java:3.22.0'
2323
}
2424
```
2525
### Other

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ apply plugin: 'signing'
55
apply plugin: 'java-library-distribution'
66

77
group = 'com.siftscience'
8-
version = '3.21.2'
8+
version = '3.22.0'
99

1010
repositories {
1111
mavenCentral()

src/main/java/com/siftscience/Constants.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
public class Constants {
44

55
public static final String API_VERSION = "v205";
6-
public static final String LIB_VERSION = "3.21.2";
6+
public static final String LIB_VERSION = "3.22.0";
77
public static final String USER_AGENT_HEADER = String.format("SiftScience/%s sift-java/%s", API_VERSION, LIB_VERSION);
88
}

src/main/java/com/siftscience/model/BaseContentFieldSet.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ public abstract class BaseContentFieldSet<T extends BaseContentFieldSet<T>>
77
extends BaseAppBrowserSiteBrandFieldSet<T> {
88
@Expose @SerializedName("$content_id") private String contentId;
99
@Expose @SerializedName("$status") private String status;
10+
@Expose @SerializedName(USER_EMAIL) private String userEmail;
1011
@Expose @SerializedName(VERIFICATION_PHONE_NUMBER) private String verificationPhoneNumber;
1112

1213
public String getContentId() {
@@ -35,4 +36,13 @@ public T setVerificationPhoneNumber(String verificationPhoneNumber) {
3536
this.verificationPhoneNumber = verificationPhoneNumber;
3637
return (T) this;
3738
}
39+
40+
public String getUserEmail() {
41+
return userEmail;
42+
}
43+
44+
public T setUserEmail(String userEmail) {
45+
this.userEmail = userEmail;
46+
return (T) this;
47+
}
3848
}

src/main/java/com/siftscience/model/FlagContentFieldSet.java

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,12 @@ public String toString() {
3030
}
3131
}
3232

33+
@Expose @SerializedName("$brand_name") private String brandName;
3334
@Expose @SerializedName("$content_id") private String contentId;
3435
@Expose @SerializedName("$flagged_by") private String flaggedBy;
3536
@Expose @SerializedName("$reason") private String reason;
37+
@Expose @SerializedName("$site_country") private String siteCountry;
38+
@Expose @SerializedName("$site_domain") private String siteDomain;
3639
@Expose @SerializedName(USER_EMAIL) private String userEmail;
3740
@Expose @SerializedName(VERIFICATION_PHONE_NUMBER) private String verificationPhoneNumber;
3841

@@ -85,4 +88,31 @@ public FlagContentFieldSet setVerificationPhoneNumber(String verificationPhoneNu
8588
this.verificationPhoneNumber = verificationPhoneNumber;
8689
return this;
8790
}
91+
92+
public String getSiteDomain() {
93+
return siteDomain;
94+
}
95+
96+
public FlagContentFieldSet setSiteDomain(String siteDomain) {
97+
this.siteDomain = siteDomain;
98+
return this;
99+
}
100+
101+
public String getSiteCountry() {
102+
return siteCountry;
103+
}
104+
105+
public FlagContentFieldSet setSiteCountry(String siteCountry) {
106+
this.siteCountry = siteCountry;
107+
return this;
108+
}
109+
110+
public String getBrandName() {
111+
return brandName;
112+
}
113+
114+
public FlagContentFieldSet setBrandName(String brandName) {
115+
this.brandName = brandName;
116+
return this;
117+
}
88118
}

src/main/java/com/siftscience/model/Review.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ public class Review {
1111
@Expose @SerializedName("$contact_email") private String contactEmail;
1212
@Expose @SerializedName("$locations") private List<Address> locations;
1313
@Expose @SerializedName("$reviewed_content_id") private String reviewedContentId;
14+
@Expose @SerializedName("$reviewed_user_id") private String reviewedUserId;
1415
@Expose @SerializedName("$images") private List<Image> images;
1516
@Expose @SerializedName("$rating") private Double rating;
1617

@@ -76,4 +77,13 @@ public Review setReviewedContentId(String reviewedContentId) {
7677
this.reviewedContentId = reviewedContentId;
7778
return this;
7879
}
80+
81+
public String getReviewedUserId() {
82+
return reviewedUserId;
83+
}
84+
85+
public Review setReviewedUserId(String reviewedUserId) {
86+
this.reviewedUserId = reviewedUserId;
87+
return this;
88+
}
7989
}

src/test/java/com/siftscience/ContentEventTest.java

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ public void testCreateComment() throws Exception {
4848
" \"$session_id\" : \"a234ksjfgn435sfg\",\n" +
4949
" \"$status\" : \"$active\",\n" +
5050
" \"$ip\" : \"255.255.255.0\",\n" +
51+
" \"$user_email\" : \"billjones1@example.com\",\n" +
5152
" \"$comment\" : {\n" +
5253
" \"$body\": \"Congrats on the new role!\",\n" +
5354
" \"$contact_email\": \"alex_301@domain.com\",\n" +
@@ -103,6 +104,7 @@ public void testCreateComment() throws Exception {
103104
.setSessionId("a234ksjfgn435sfg")
104105
.setStatus("$active")
105106
.setIp("255.255.255.0")
107+
.setUserEmail("billjones1@example.com")
106108
.setComment(c)
107109
.setVerificationPhoneNumber("+12345678901"));
108110

@@ -135,6 +137,7 @@ public void testCreateListing() throws Exception {
135137
" \"$session_id\" : \"a234ksjfgn435sfg\",\n" +
136138
" \"$status\" : \"$active\",\n" +
137139
" \"$ip\" : \"255.255.255.0\",\n" +
140+
" \"$user_email\" : \"billjones1@example.com\",\n" +
138141
" \"$listing\" : {\n" +
139142
" \"$subject\": \"2 Bedroom Apartment for Rent\",\n" +
140143
" \"$body\": \"Capitol Hill Seattle brand new condo. 2 bedrooms and 1 full bath.\",\n" +
@@ -232,6 +235,7 @@ public void testCreateListing() throws Exception {
232235
.setSessionId("a234ksjfgn435sfg")
233236
.setStatus("$active")
234237
.setIp("255.255.255.0")
238+
.setUserEmail("billjones1@example.com")
235239
.setListing(l)
236240
.setVerificationPhoneNumber("+12345678901"));
237241

@@ -263,6 +267,7 @@ public void testCreateMessage() throws Exception {
263267
" \"$session_id\" : \"a234ksjfgn435sfg\",\n" +
264268
" \"$status\" : \"$active\",\n" +
265269
" \"$ip\" : \"255.255.255.0\",\n" +
270+
" \"$user_email\" : \"billjones1@example.com\",\n" +
266271
" \"$message\" : {\n" +
267272
" \"$body\": \"Let's meet at 5pm\",\n" +
268273
" \"$contact_email\": \"alex_301@domain.com\",\n" +
@@ -316,6 +321,7 @@ public void testCreateMessage() throws Exception {
316321
.setSessionId("a234ksjfgn435sfg")
317322
.setStatus("$active")
318323
.setIp("255.255.255.0")
324+
.setUserEmail("billjones1@example.com")
319325
.setMessage(m)
320326
.setVerificationPhoneNumber("+12345678901"));
321327

@@ -347,6 +353,7 @@ public void testCreateProfile() throws Exception {
347353
" \"$session_id\" : \"a234ksjfgn435sfg\",\n" +
348354
" \"$status\" : \"$active\",\n" +
349355
" \"$ip\" : \"255.255.255.0\",\n" +
356+
" \"$user_email\" : \"billjones1@example.com\",\n" +
350357
" \"$profile\" : {\n" +
351358
" \"$body\": \"Hi! My name is Alex and I just moved to New London!\",\n" +
352359
" \"$contact_email\": \"alex_301@domain.com\",\n" +
@@ -417,6 +424,7 @@ public void testCreateProfile() throws Exception {
417424
.setSessionId("a234ksjfgn435sfg")
418425
.setStatus("$active")
419426
.setIp("255.255.255.0")
427+
.setUserEmail("billjones1@example.com")
420428
.setProfile(p)
421429
.setVerificationPhoneNumber("+12345678901"));
422430

@@ -448,6 +456,7 @@ public void testCreatePost() throws Exception {
448456
" \"$session_id\" : \"a234ksjfgn435sfg\",\n" +
449457
" \"$status\" : \"$active\",\n" +
450458
" \"$ip\" : \"255.255.255.0\",\n" +
459+
" \"$user_email\" : \"billjones1@example.com\",\n" +
451460
" \"$post\" : {\n" +
452461
" \"$subject\": \"My new apartment!\"," +
453462
" \"$body\": \"Moved into my new apartment yesterday.\",\n" +
@@ -535,6 +544,7 @@ public void testCreatePost() throws Exception {
535544
.setSessionId("a234ksjfgn435sfg")
536545
.setStatus("$active")
537546
.setIp("255.255.255.0")
547+
.setUserEmail("billjones1@example.com")
538548
.setPost(p)
539549
.setVerificationPhoneNumber("+12345678901"));
540550

@@ -566,6 +576,7 @@ public void testCreateReview() throws Exception {
566576
" \"$session_id\" : \"a234ksjfgn435sfg\",\n" +
567577
" \"$status\" : \"$active\",\n" +
568578
" \"$ip\" : \"255.255.255.0\",\n" +
579+
" \"$user_email\" : \"billjones1@example.com\",\n" +
569580
" \"$review\" : {\n" +
570581
" \"$subject\": \"Amazing Tacos!\"," +
571582
" \"$body\": \"I ate the tacos.\",\n" +
@@ -577,6 +588,7 @@ public void testCreateReview() throws Exception {
577588
" \"$zipcode\": \"98112\"\n" +
578589
" }],\n" +
579590
" \"$reviewed_content_id\": \"listing-234234\",\n" +
591+
" \"$reviewed_user_id\": \"fyw3989sjpqr71\",\n" +
580592
" \"$images\": [{\n" +
581593
" \"$md5_hash\": \"aflshdfbalsubdf3234sfdkjb\",\n" +
582594
" \"$link\": \"https://www.domain.com/file.png\",\n" +
@@ -627,6 +639,7 @@ public void testCreateReview() throws Exception {
627639
.setContactEmail("alex_301@domain.com")
628640
.setLocations(Collections.singletonList(locationAddress))
629641
.setReviewedContentId("listing-234234")
642+
.setReviewedUserId("fyw3989sjpqr71")
630643
.setImages(images)
631644
.setRating(4.5);
632645

@@ -637,6 +650,7 @@ public void testCreateReview() throws Exception {
637650
.setSessionId("a234ksjfgn435sfg")
638651
.setStatus("$active")
639652
.setIp("255.255.255.0")
653+
.setUserEmail("billjones1@example.com")
640654
.setReview(r)
641655
.setVerificationPhoneNumber("+12345678901"));
642656

@@ -668,6 +682,7 @@ public void testUpdateComment() throws Exception {
668682
" \"$session_id\" : \"a234ksjfgn435sfg\",\n" +
669683
" \"$status\" : \"$active\",\n" +
670684
" \"$ip\" : \"255.255.255.0\",\n" +
685+
" \"$user_email\" : \"billjones1@example.com\",\n" +
671686
" \"$comment\" : {\n" +
672687
" \"$body\": \"Congrats on the new role!\",\n" +
673688
" \"$contact_email\": \"alex_301@domain.com\",\n" +
@@ -724,6 +739,7 @@ public void testUpdateComment() throws Exception {
724739
.setSessionId("a234ksjfgn435sfg")
725740
.setStatus("$active")
726741
.setIp("255.255.255.0")
742+
.setUserEmail("billjones1@example.com")
727743
.setComment(c)
728744
.setVerificationPhoneNumber("+12345678901"));
729745

@@ -756,6 +772,7 @@ public void testUpdateListing() throws Exception {
756772
" \"$session_id\" : \"a234ksjfgn435sfg\",\n" +
757773
" \"$status\" : \"$active\",\n" +
758774
" \"$ip\" : \"255.255.255.0\",\n" +
775+
" \"$user_email\" : \"billjones1@example.com\",\n" +
759776
" \"$listing\" : {\n" +
760777
" \"$subject\": \"2 Bedroom Apartment for Rent\",\n" +
761778
" \"$body\": \"Capitol Hill Seattle brand new condo. 2 bedrooms and 1 full bath.\",\n" +
@@ -853,6 +870,7 @@ public void testUpdateListing() throws Exception {
853870
.setSessionId("a234ksjfgn435sfg")
854871
.setStatus("$active")
855872
.setIp("255.255.255.0")
873+
.setUserEmail("billjones1@example.com")
856874
.setListing(l)
857875
.setVerificationPhoneNumber("+12345678901"));
858876

@@ -884,6 +902,7 @@ public void testUpdateMessage() throws Exception {
884902
" \"$session_id\" : \"a234ksjfgn435sfg\",\n" +
885903
" \"$status\" : \"$active\",\n" +
886904
" \"$ip\" : \"255.255.255.0\",\n" +
905+
" \"$user_email\" : \"billjones1@example.com\",\n" +
887906
" \"$message\" : {\n" +
888907
" \"$body\": \"Let's meet at 5pm\",\n" +
889908
" \"$contact_email\": \"alex_301@domain.com\",\n" +
@@ -941,6 +960,7 @@ public void testUpdateMessage() throws Exception {
941960
.setSessionId("a234ksjfgn435sfg")
942961
.setStatus("$active")
943962
.setIp("255.255.255.0")
963+
.setUserEmail("billjones1@example.com")
944964
.setMessage(m)
945965
.setVerificationPhoneNumber("+12345678901"));
946966

@@ -972,6 +992,7 @@ public void testUpdateProfile() throws Exception {
972992
" \"$session_id\" : \"a234ksjfgn435sfg\",\n" +
973993
" \"$status\" : \"$active\",\n" +
974994
" \"$ip\" : \"255.255.255.0\",\n" +
995+
" \"$user_email\" : \"billjones1@example.com\",\n" +
975996
" \"$profile\" : {\n" +
976997
" \"$body\": \"Hi! My name is Alex and I just moved to New London!\",\n" +
977998
" \"$contact_email\": \"alex_301@domain.com\",\n" +
@@ -1042,6 +1063,7 @@ public void testUpdateProfile() throws Exception {
10421063
.setSessionId("a234ksjfgn435sfg")
10431064
.setStatus("$active")
10441065
.setIp("255.255.255.0")
1066+
.setUserEmail("billjones1@example.com")
10451067
.setProfile(p)
10461068
.setVerificationPhoneNumber("+12345678901"));
10471069

@@ -1073,6 +1095,7 @@ public void testUpdatePost() throws Exception {
10731095
" \"$session_id\" : \"a234ksjfgn435sfg\",\n" +
10741096
" \"$status\" : \"$active\",\n" +
10751097
" \"$ip\" : \"255.255.255.0\",\n" +
1098+
" \"$user_email\" : \"billjones1@example.com\",\n" +
10761099
" \"$post\" : {\n" +
10771100
" \"$subject\": \"My new apartment!\"," +
10781101
" \"$body\": \"Moved into my new apartment yesterday.\",\n" +
@@ -1160,6 +1183,7 @@ public void testUpdatePost() throws Exception {
11601183
.setSessionId("a234ksjfgn435sfg")
11611184
.setStatus("$active")
11621185
.setIp("255.255.255.0")
1186+
.setUserEmail("billjones1@example.com")
11631187
.setPost(p)
11641188
.setVerificationPhoneNumber("+12345678901"));
11651189

@@ -1191,6 +1215,7 @@ public void testUpdateReview() throws Exception {
11911215
" \"$session_id\" : \"a234ksjfgn435sfg\",\n" +
11921216
" \"$status\" : \"$active\",\n" +
11931217
" \"$ip\" : \"255.255.255.0\",\n" +
1218+
" \"$user_email\" : \"billjones1@example.com\",\n" +
11941219
" \"$review\" : {\n" +
11951220
" \"$subject\": \"Amazing Tacos!\"," +
11961221
" \"$body\": \"I ate the tacos.\",\n" +
@@ -1202,6 +1227,7 @@ public void testUpdateReview() throws Exception {
12021227
" \"$zipcode\": \"98112\"\n" +
12031228
" }],\n" +
12041229
" \"$reviewed_content_id\": \"listing-234234\",\n" +
1230+
" \"$reviewed_user_id\": \"fyw3989sjpqr71\",\n" +
12051231
" \"$images\": [{\n" +
12061232
" \"$md5_hash\": \"aflshdfbalsubdf3234sfdkjb\",\n" +
12071233
" \"$link\": \"https://www.domain.com/file.png\",\n" +
@@ -1252,6 +1278,7 @@ public void testUpdateReview() throws Exception {
12521278
.setContactEmail("alex_301@domain.com")
12531279
.setLocations(Collections.singletonList(locationAddress))
12541280
.setReviewedContentId("listing-234234")
1281+
.setReviewedUserId("fyw3989sjpqr71")
12551282
.setImages(images)
12561283
.setRating(4.5);
12571284

@@ -1262,6 +1289,7 @@ public void testUpdateReview() throws Exception {
12621289
.setSessionId("a234ksjfgn435sfg")
12631290
.setStatus("$active")
12641291
.setIp("255.255.255.0")
1292+
.setUserEmail("billjones1@example.com")
12651293
.setReview(r)
12661294
.setVerificationPhoneNumber("+12345678901"));
12671295

src/test/java/com/siftscience/FlagContentEventTest.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,14 @@ public void testFlagContent() throws Exception {
4040
String expectedRequestBody = "{\n" +
4141
" \"$type\" : \"$flag_content\", \n" +
4242
" \"$api_key\" : \"YOUR_API_KEY\",\n" +
43+
" \"$brand_name\" : \"sift\",\n" +
4344
" \"$user_id\" : \"billy_jones_301\",\n" +
4445
" \"$content_id\" : \"9671500641\",\n" +
4546
"\n" +
4647
" \"$flagged_by\" : \"jamieli89\",\n" +
4748
" \"$reason\" : \"" + this.reason.value + "\",\n" +
49+
" \"$site_country\" : \"US\",\n" +
50+
" \"$site_domain\" : \"sift.com\",\n" +
4851
" \"$user_email\" : \"billy_jones_301@email.com\",\n" +
4952
" \"$verification_phone_number\" : \"+12345678901\"\n" +
5053
"}";
@@ -75,6 +78,9 @@ public void testFlagContent() throws Exception {
7578
.setContentId("9671500641")
7679
.setFlaggedBy("jamieli89")
7780
.setReason(this.reason)
81+
.setBrandName("sift")
82+
.setSiteCountry("US")
83+
.setSiteDomain("sift.com")
7884
.setUserEmail("billy_jones_301@email.com")
7985
.setVerificationPhoneNumber("+12345678901"));
8086

src/test/java/com/siftscience/SiftRequestTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public void testUserAgentHeader() throws Exception {
2929

3030
// then
3131
RecordedRequest recordedRequest = server.takeRequest();
32-
assertEquals("SiftScience/v205 sift-java/3.21.2",
32+
assertEquals("SiftScience/v205 sift-java/3.22.0",
3333
recordedRequest.getHeader("User-Agent"));
3434
}
3535

0 commit comments

Comments
 (0)