SevenShores\Hubspot\Resources\Companies::getById PHP Метод

getById() публичный Метод

Returns a company with id $id
См. также: http://developers.hubspot.com/docs/methods/companies/get_company
public getById ( integer $id ) : Response
$id integer
Результат SevenShores\Hubspot\Http\Response
    function getById($id)
    {
        $endpoint = "https://api.hubapi.com/companies/v2/companies/{$id}";
        return $this->client->request('get', $endpoint);
    }

Usage Example

Пример #1
0
 /** @test */
 public function getById()
 {
     //Ensure that we have a company to fetch
     $newCompanyResponse = $this->createCompany();
     $id = $newCompanyResponse['companyId'];
     $response = $this->companies->getById($id);
     $this->assertEquals(200, $response->getStatusCode());
     $this->assertEquals($id, $response['companyId']);
 }