Skip to content

Commit 66cef54

Browse files
authored
Merge pull request #29 from upwork/v1.3.3
Add Room Messages API
2 parents e5a21ba + 0ca0473 commit 66cef54

File tree

4 files changed

+35
-2
lines changed

4 files changed

+35
-2
lines changed

CHANGES.md

+3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# Release History
22

3+
## 1.3.3
4+
* Add Room Messages API
5+
36
## 1.3.2
47
* Add Specialties API
58
* Add Skills V2 API

composer.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
22
"name": "upwork/php-upwork",
33
"description": "PHP bindings for Upwork API",
4-
"version": "v1.3.2",
4+
"version": "v1.3.3",
55
"type": "library",
66
"keywords": ["upwork", "php", "api"],
77
"homepage": "http://www.upwork.com",
8-
"time": "2018-05-24",
8+
"time": "2020-05-08",
99
"license": "Apache-2.0",
1010
"authors": [
1111
{

src/Upwork/API/Routers/Messages.php

+19
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,25 @@ public function getRoomDetails($company, $roomId, $params = array())
7777
return $response;
7878
}
7979

80+
/**
81+
* Get messages from a specific room
82+
*
83+
* @param string $company Company ID
84+
* @param string $roomId Room ID
85+
* @param array $params List of parameters
86+
* @access public
87+
* @return object
88+
*/
89+
public function getRoomMessages($company, $roomId, $params = array())
90+
{
91+
ApiDebug::p(__FUNCTION__);
92+
93+
$response = $this->_client->get('/messages/v3/' . $company . '/rooms/' . $roomId . '/stories', $params);
94+
ApiDebug::p('received data', $response);
95+
96+
return $response;
97+
}
98+
8099
/**
81100
* Get a specific room by offer ID
82101
*

tests/Upwork/API/Routers/MessagesTest.php

+11
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,17 @@ public function testGetRoomDetails()
3535
$this->_checkResponse($response);
3636
}
3737

38+
/**
39+
* @test
40+
*/
41+
public function testGetRoomMessages()
42+
{
43+
$router = new \Upwork\API\Routers\Messages($this->_client);
44+
$response = $router->getRoomMessages('company', 'room-id', array());
45+
46+
$this->_checkResponse($response);
47+
}
48+
3849
/**
3950
* @test
4051
*/

0 commit comments

Comments
 (0)