Skip to content

Commit

Permalink
Merge pull request #29 from upwork/v1.3.3
Browse files Browse the repository at this point in the history
Add Room Messages API
  • Loading branch information
mnovozhylov committed May 8, 2020
2 parents e5a21ba + 0ca0473 commit 66cef54
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Release History

## 1.3.3
* Add Room Messages API

## 1.3.2
* Add Specialties API
* Add Skills V2 API
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"name": "upwork/php-upwork",
"description": "PHP bindings for Upwork API",
"version": "v1.3.2",
"version": "v1.3.3",
"type": "library",
"keywords": ["upwork", "php", "api"],
"homepage": "http://www.upwork.com",
"time": "2018-05-24",
"time": "2020-05-08",
"license": "Apache-2.0",
"authors": [
{
Expand Down
19 changes: 19 additions & 0 deletions src/Upwork/API/Routers/Messages.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,25 @@ public function getRoomDetails($company, $roomId, $params = array())
return $response;
}

/**
* Get messages from a specific room
*
* @param string $company Company ID
* @param string $roomId Room ID
* @param array $params List of parameters
* @access public
* @return object
*/
public function getRoomMessages($company, $roomId, $params = array())
{
ApiDebug::p(__FUNCTION__);

$response = $this->_client->get('/messages/v3/' . $company . '/rooms/' . $roomId . '/stories', $params);
ApiDebug::p('received data', $response);

return $response;
}

/**
* Get a specific room by offer ID
*
Expand Down
11 changes: 11 additions & 0 deletions tests/Upwork/API/Routers/MessagesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,17 @@ public function testGetRoomDetails()
$this->_checkResponse($response);
}

/**
* @test
*/
public function testGetRoomMessages()
{
$router = new \Upwork\API\Routers\Messages($this->_client);
$response = $router->getRoomMessages('company', 'room-id', array());

$this->_checkResponse($response);
}

/**
* @test
*/
Expand Down

0 comments on commit 66cef54

Please sign in to comment.