Skip to content
This repository has been archived by the owner on May 14, 2020. It is now read-only.

Commit

Permalink
Added support for updating the body text of a thread
Browse files Browse the repository at this point in the history
  • Loading branch information
briandame committed Apr 25, 2014
1 parent ef2d11c commit afb9931
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 5 deletions.
5 changes: 3 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#### 1.3.12 (March 4, 2014)
#### 1.3.13 (April 25, 2014)

* Added support for updating the body text of a thread. See [developer docs](http://developer.helpscout.net/) for more information.

* Added support for conversation and customer search endpoints. See [developer docs](http://developer.helpscout.net/) for more information.

#### 1.3.11 (February 4, 2014)

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Help Scout Java Wrapper
=======================
Java Wrapper for the Help Scout API. More information on our developer site: [http://developer.helpscout.net](http://developer.helpscout.net).

Version 1.3.12 Released
Version 1.3.13 Released
---------------------
Please see the [Changelog](https://github.com/helpscout/helpscout-api-java/blob/master/CHANGELOG.md) for details.

Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<groupId>net.helpscout</groupId>
<artifactId>helpscout-api</artifactId>
<packaging>jar</packaging>
<version>1.3.12</version>
<version>1.3.13</version>
<name>helpscout-api</name>
<url>http://maven.apache.org</url>

Expand Down
21 changes: 20 additions & 1 deletion src/main/java/net/helpscout/api/ApiClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

public class ApiClient {

private final static String BASE_URL = "https://api.helpscout.net/v1/";
private final static String BASE_URL = "https://api.helpscout.net/v1/";
private final static String METHOD_GET = "GET";
private final static String METHOD_POST = "POST";
private final static String METHOD_PUT = "PUT";
Expand Down Expand Up @@ -719,6 +719,25 @@ public void createConversationThread(Long conversationId, ConversationThread thr
}
}

/**
* Update the body text of the specified thread.
*
* @param conversationId
* @param threadId
* @param text
* @return
* @throws ApiException
*/
public void updateConversationThreadText(Long conversationId, Long threadId, String text) throws ApiException {
Map<String,String> threadBody = new HashMap<String, String>();
threadBody.put("body", text);

GsonBuilder builder = new GsonBuilder();
String json = builder.create().toJson(threadBody);

doPut("conversations/" + conversationId + "/threads/" + threadId + ".json", json, HTTP_STATUS_OK);
}

/**
* Deletes the specified conversation.
*
Expand Down

0 comments on commit afb9931

Please sign in to comment.