Classes/Utility/Api.php
public function execute()
  {
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, $this->getURI());
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_POST, true);
    curl_setopt($ch, CURLOPT_POSTFIELDS, $this->data);

    $response = curl_exec($ch);
    $result = json_decode($response);
    curl_close($ch);

    if (empty($result) || !$result->success) {
      throw new \Exception("Pipedrive API error!");
    }

    return $result;
  }
public function execute()
  {
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, $this->getURI());
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_POST, true);
    curl_setopt($ch, CURLOPT_POSTFIELDS, $this->data);

    $response = curl_exec($ch);
    $result = json_decode($response);
    curl_close($ch);

    if (empty($result) || !$result->success) {
      throw new \Exception("Pipedrive API error!");
    }

    return $result;
  }
public function execute ( ) { $ ch = curl_init ( ) ; curl_setopt ( $ ch , CURLOPT_URL , $ this -> getURI ( ) ) ; curl_setopt ( $ ch , CURLOPT_RETURNTRANSFER , true ) ; curl_setopt ( $ ch , CURLOPT_POST , true ) ; curl_setopt ( $ ch , CURLOPT_POSTFIELDS , $ this -> data ) ; $ response = curl_exec ( $ ch ) ; $ result = json_decode ( $ response ) ; curl_close ( $ ch ) ; if ( empty ( $ result ) || ! $ result -> success ) { throw new \ Exception ( "Pipedrive API error!" ) ; } return $ result ; }
Builds the complete URI to the API endpoint
@return void
Builds the complete URI to the API endpoint