Skip to content

Commit 7c23516

Browse files
committed
add attachments to admin and user reply
1 parent 806be95 commit 7c23516

File tree

4 files changed

+17
-1
lines changed

4 files changed

+17
-1
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -447,6 +447,7 @@ ConversationCollection openForAdmin = Conversation.list(params);
447447
Admin admin = new Admin().setId("1");
448448
AdminReply adminReply = new AdminReply(admin);
449449
adminReply.setBody("These apples are healthsome");
450+
adminReply.setAttachmentUrls(new String[]{"http://www.example.com/attachment.jpg"}); // optional - list of attachments
450451
Conversation.reply("66", adminReply);
451452

452453
// admin close
@@ -459,6 +460,7 @@ Conversation.reply("66", adminReply);
459460
User user1 = new User().setId("5310d8e8598c9a0b24000005");
460461
UserReply userReply = new UserReply(user1);
461462
userReply.setBody("Mighty fine shindig");
463+
userReply.setAttachmentUrls(new String[]{"http://www.example.com/attachment.jpg"}); // optional - list of attachments
462464
System.out.println(MapperSupport.objectMapper().writeValueAsString(userReply));
463465
Conversation.reply("66", userReply);
464466
```

intercom-java/src/main/java/io/intercom/api/AdminReply.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,11 @@ public String getAdminID() {
4646
public String getAssigneeID() {
4747
return reply.getAssigneeID();
4848
}
49+
50+
@JsonProperty("attachment_urls")
51+
private String[] getAttachmentUrls() {
52+
return reply.getAttachmentUrls();
53+
}
4954
}
5055

5156
@JsonProperty("assignee_id")

intercom-java/src/main/java/io/intercom/api/Reply.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,11 @@ public Reply<T> setBody(String body) {
3232
this.body = body;
3333
return this;
3434
}
35-
35+
36+
public String[] getAttachmentUrls() {
37+
return attachmentUrls;
38+
}
39+
3640
public Reply<T> setAttachmentUrls(String[] attachmentUrls) {
3741
this.attachmentUrls = attachmentUrls;
3842
return this;

intercom-java/src/main/java/io/intercom/api/UserReply.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,11 @@ public String getUserID() {
5151
public String getEmail() {
5252
return reply.getFrom().getEmail();
5353
}
54+
55+
@JsonProperty("attachment_urls")
56+
private String[] getAttachmentUrls() {
57+
return reply.getAttachmentUrls();
58+
}
5459
}
5560

5661
public UserReply(User user) {

0 commit comments

Comments
 (0)