Skip to content

Commit

Permalink
(Data Success) Updated Documentation, remove deprecated fields, added…
Browse files Browse the repository at this point in the history
… missing message fields (#26)

* Updated docs

* Added missing fields to Message.java

* Updated version to 2.0.1

* Removed old V204 events

* Added extra comment to changeS

* Added Nick's requested changes
  • Loading branch information
admiral-akk authored Apr 6, 2018
1 parent bd1daf7 commit 639a53a
Show file tree
Hide file tree
Showing 7 changed files with 58 additions and 121 deletions.
22 changes: 17 additions & 5 deletions CHANGES.MD
Original file line number Diff line number Diff line change
@@ -1,10 +1,22 @@
2.0 (2018-03-28)
2.0.1 (2018-04-06)
=================

- Add content level decisions in ApplyDecisionFieldSet.java.
- Add support for V205 content events
- Removed support for send message and submit review events.
- Add support for filtering get decisions by entity type SESSION.
- Improved documentation in CHANGES.MD and README.md.
- Added missing fields to Message.java
- Removed deprecated files.

2.0 (2018-03-30)
=================

- Adds support for Sift Science API Version 205, including new [`$create_content`](https://siftscience.com/developers/docs/curl/events-api/reserved-events/create-content) and [`$update_content`](https://siftscience.com/developers/docs/curl/events-api/reserved-events/update-content) formats
- V205 APIs are now called -- **this is an incompatible change**
- Adds support for content decisions to [Decisions API](https://siftscience.com/developers/docs/curl/decisions-api)


INCOMPATIBLE CHANGES INTRODUCED IN API V205:
- `$create_content` and `$update_content` have significantly changed, and the old format will be rejected
- `$send_message` and `$submit_review` events are no longer valid
- V205 improves server-side event data validation. In V204 and earlier, server-side validation accepted some events that did not conform to the published APIs in our [developer documentation](https://siftscience.com/developers/docs/curl/events-api). V205 does not modify existing event APIs other than those mentioned above, but may reject invalid event data that were previously accepted. **Please test your integration on V205 in sandbox before using in production.**


1.5 (2018-02-09)
Expand Down
21 changes: 18 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Sift Science Java API

The official Java bindings for the latest version (v204) of the [Sift Science API](https://siftscience.com/developers/docs/java/apis-overview) .
The official Java bindings for the latest version (v205) of the [Sift Science API](https://siftscience.com/developers/docs/java/apis-overview) .

## Requirements
Java 1.7 or later.
Expand All @@ -11,13 +11,13 @@ Java 1.7 or later.
<dependency>
<groupId>com.siftscience</groupId>
<artifactId>sift-java</artifactId>
<version>1.5</version>
<version>2.0.1</version>
</dependency>
```
### Gradle
```
dependencies {
compile 'com.siftscience:sift-java:1.5'
compile 'com.siftscience:sift-java:2.0.1'
}
```
### Other
Expand Down Expand Up @@ -241,6 +241,21 @@ ApplyDecisionRequest request = client.buildRequest(
);
```

To apply a decision to a piece of content, create a request with accountId, userId, contentId and ApplyDecisionFieldSet.
```java
ApplyDecisionRequest request = client.buildRequest(
new ApplyDecisionFieldSet()
.setAccountId("your_account_id")
.setUserId("a_user_id")
.setContentId("a_content_id")
.setDecisionId("decision_id")
.setSource(DecisionSource.MANUAL_REVIEW)
.setAnalyst("[email protected]")
.setDescription("description of decision applied")
);
```


#### Get decisions

[API Docs](https://siftscience.com/developers/docs/java/decisions-api/get-decisions)
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ apply plugin: 'signing'
apply plugin: 'java-library-distribution'

group = 'com.siftscience'
version = '2.0'
version = '2.0.1'
sourceCompatibility = 1.7
targetCompatibility = 1.7

Expand Down
18 changes: 18 additions & 0 deletions src/main/java/com/siftscience/model/Message.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ public class Message {
@Expose @SerializedName("$body") private String body;
@Expose @SerializedName("$contact_email") private String contactEmail;
@Expose @SerializedName("$recipient_user_ids") private List<String> recipientUserIds;
@Expose @SerializedName("$root_content_id") private String rootContentId;
@Expose @SerializedName("$images") private List<Image> images;
@Expose @SerializedName("$subject") private String subject;

public String getBody() {
return body;
Expand Down Expand Up @@ -46,4 +48,20 @@ public Message setRecipientUserIds(List<String> recipientUserIds) {
this.recipientUserIds = recipientUserIds;
return this;
}

public String getSubject() { return subject; }

public Message setSubject(String subject) {
this.subject = subject;
return this;
}

public String getRootContentId() {
return rootContentId;
}

public Message setRootContentId(String rootContentId) {
this.rootContentId = rootContentId;
return this;
}
}
46 changes: 0 additions & 46 deletions src/main/java/com/siftscience/model/SendMessageFieldSet.java

This file was deleted.

66 changes: 0 additions & 66 deletions src/main/java/com/siftscience/model/SubmitReviewFieldSet.java

This file was deleted.

4 changes: 4 additions & 0 deletions src/test/java/com/siftscience/ContentEventTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -873,6 +873,8 @@ public void testUpdateMessage() throws Exception {
" \"$body\": \"Let's meet at 5pm\",\n" +
" \"$contact_email\": \"[email protected]\",\n" +
" \"$recipient_user_ids\": [\"fy9h989sjphh71\"],\n" +
" \"$subject\": \"Hello world\",\n" +
" \"$root_content_id\": \"posting-123\",\n" +
" \"$images\": [{\n" +
" \"$md5_hash\": \"aflshdfbalsubdf3234sfdkjb\",\n" +
" \"$link\": \"https://www.domain.com/file.png\",\n" +
Expand Down Expand Up @@ -911,6 +913,8 @@ public void testUpdateMessage() throws Exception {
.setBody("Let's meet at 5pm")
.setContactEmail("[email protected]")
.setRecipientUserIds(Collections.singletonList("fy9h989sjphh71"))
.setSubject("Hello world")
.setRootContentId("posting-123")
.setImages(images);

// Build and execute the request against the mock server.
Expand Down

0 comments on commit 639a53a

Please sign in to comment.