Skip to content

Commit

Permalink
Merge pull request #20 from upwork/v1.3.3
Browse files Browse the repository at this point in the history
Add sendMessageToRooms
  • Loading branch information
mnovozhylov committed Sep 18, 2020
2 parents dcc7e91 + 5d30a1e commit e6024f7
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 1 deletion.
6 changes: 6 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Release History

## 1.3.3
* Send Message to a Batch of Rooms API

## 1.3.2
* Add Room Messages API

## 1.3.1
* Add Specialties API
* Add Skills V2 API
Expand Down
Binary file modified example-android/app/libs/java-upwork.jar
Binary file not shown.
Binary file modified lib/java-upwork.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

<groupId>com.Upwork</groupId>
<artifactId>api</artifactId>
<version>1.3.2</version>
<version>1.3.3</version>
<packaging>jar</packaging>
<name>java-upwork</name>
<description>JAVA bindings for Upwork API</description>
Expand Down
12 changes: 12 additions & 0 deletions src/com/Upwork/api/Routers/Messages.java
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,18 @@ public JSONObject sendMessageToRoom(String company, String roomId, HashMap<Strin
return oClient.post("/messages/v3/" + company + "/rooms/" + roomId + "/stories", params);
}

/**
* Send a message to a batch of rooms
*
* @param company Company ID
* @param params Parameters
* @throws JSONException If error occurred
* @return {@link JSONObject}
*/
public JSONObject sendMessageToRooms(String company, HashMap<String, String> params) throws JSONException {
return oClient.post("/messages/v3/" + company + "/stories/batch", params);
}

/**
* Update a room settings
*
Expand Down
7 changes: 7 additions & 0 deletions test/com/Upwork/api/Routers/MessagesTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,13 @@ public class MessagesTest extends Helper {
assertTrue(json instanceof JSONObject);
}

@Test public void sendMessageToRooms() throws Exception {
Messages messages = new Messages(client);
JSONObject json = messages.sendMessageToRooms("company", new HashMap<String, String>());

assertTrue(json instanceof JSONObject);
}

@Test public void updateRoomSettings() throws Exception {
Messages messages = new Messages(client);
JSONObject json = messages.updateRoomSettings("company", "room-id", "username", new HashMap<String, String>());
Expand Down

0 comments on commit e6024f7

Please sign in to comment.