File tree Expand file tree Collapse file tree 2 files changed +25
-0
lines changed
intercom-java/src/main/java/io/intercom/api Expand file tree Collapse file tree 2 files changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -584,6 +584,9 @@ userReply.setBody("Mighty fine shindig");
584584userReply. setAttachmentUrls(new String []{" http://www.example.com/attachment.jpg" }); // optional - list of attachments
585585System . out. println(MapperSupport . objectMapper(). writeValueAsString(userReply));
586586Conversation . reply(" 66" , userReply);
587+
588+ // mark conversation as read
589+ Conversation . markAsRead(" 66" );
587590```
588591
589592### Webhooks
Original file line number Diff line number Diff line change 1717@ JsonIgnoreProperties (ignoreUnknown = true )
1818public class Conversation extends TypedData {
1919
20+ @ SuppressWarnings ("UnusedDeclaration" )
21+ @ JsonIgnoreProperties (ignoreUnknown = true )
22+ private static class ConversationRead extends TypedData {
23+
24+ @ JsonProperty ("read" )
25+ private boolean read ;
26+
27+ public ConversationRead () {
28+ this .read = true ;
29+ }
30+ }
31+
2032 private static final HashMap <String , String > SENTINEL = Maps .newHashMap ();
2133 private static final List <String > DISPLAY_AS_FORMATS = Lists .newArrayList ("plaintext" , "html" );
2234 static final String MESSAGE_TYPE_ASSIGNMENT = "assignment" ;
@@ -73,6 +85,16 @@ public static Conversation reply(String id, AdminReply reply) {
7385 .post (Conversation .class , new AdminReply .AdminStringReply (reply ));
7486 }
7587
88+ public static Conversation markAsRead (String id ) {
89+ final URI uri = UriBuilder .newBuilder ()
90+ .path ("conversations" )
91+ .path (id )
92+ .build ();
93+
94+ return new HttpClient (uri )
95+ .put (Conversation .class , new ConversationRead ());
96+ }
97+
7698 public static UserMessage create (UserMessage message ) {
7799 return DataResource .create (message , "messages" , UserMessage .class );
78100 }
You can’t perform that action at this time.
0 commit comments