Skip to content

Commit

Permalink
Merge branch 'v1.4.0' of github.com:upwork/php-upwork into v1.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
mnovozhylov committed Sep 18, 2020
2 parents 3d8cf1e + 7977f29 commit acc8f50
Show file tree
Hide file tree
Showing 5 changed files with 84 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PHP bindings for Upwork API
PHP bindings for Upwork API (OAuth1)
============

[![License](http://img.shields.io/packagist/l/upwork/php-upwork.svg)](http://www.apache.org/licenses/LICENSE-2.0.html)
[![License](https://img.shields.io/github/license/upwork/php-upwork)](http://www.apache.org/licenses/LICENSE-2.0.html)
[![Latest Stable Version](https://poser.pugx.org/upwork/php-upwork/v/stable.svg)](https://github.com/upwork/php-upwork/releases)
[![Package version](http://img.shields.io/packagist/v/upwork/php-upwork.svg)](https://packagist.org/packages/upwork/php-upwork)
[![Build status](https://travis-ci.org/upwork/php-upwork.svg)](http://travis-ci.org/upwork/php-upwork)
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
30 changes: 30 additions & 0 deletions src/Upwork/API/Routers/Metadata.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,36 @@ public function getSkills()
return $response;
}

/**
* Get Skills V2
*
* @return object
*/
public function getSkillsV2()
{
ApiDebug::p(__FUNCTION__);

$response = $this->_client->get('/profiles/v2/metadata/skills');
ApiDebug::p('found response info', $response);

return $response;
}

/**
* Get Specialties
*
* @return object
*/
public function getSpecialties()
{
ApiDebug::p(__FUNCTION__);

$response = $this->_client->get('/profiles/v1/metadata/specialties');
ApiDebug::p('found response info', $response);

return $response;
}

/**
* Get regions
*
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
22 changes: 22 additions & 0 deletions tests/Upwork/API/Routers/MetadataTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,28 @@ public function testGetSkills()
$this->_checkResponse($response);
}

/**
* @test
*/
public function testGetSkillsV2()
{
$router = new \Upwork\API\Routers\Metadata($this->_client);
$response = $router->getSkillsV2();

$this->_checkResponse($response);
}

/**
* @test
*/
public function testGetSpecialties()
{
$router = new \Upwork\API\Routers\Metadata($this->_client);
$response = $router->getSpecialties();

$this->_checkResponse($response);
}

/**
* @test
*/
Expand Down

0 comments on commit acc8f50

Please sign in to comment.