public function buy($phoneNumber, $appId = null)
    {
        $response = $this->client->update(
            $this->uri . $phoneNumber . '/',
            ['app_id'=>$appId]
        );

        $responseContents = $response->getContent();
        if(!array_key_exists("error",$responseContents)){
            return new PhoneNumberBuyResponse(
                $responseContents['api_id'],
                $responseContents['message'],
                $responseContents['numbers'][0]['number'],
                $responseContents['numbers'][0]['status'],
                $responseContents['status'],
                $response->getStatusCode()
            );
        } else {
            throw new PlivoResponseException(
                $responseContents['error'],
                0,
                null,
                $response->getContent(),
                $response->getStatusCode()

            );
        }
        
    }