protected function _call_api( $method, $url, $params ) {
        $raw_response = $this->_client->$method($url, $params);
        $info = $this->_client->get_info();
        if ($info['http_code'] != null) {
            switch ($info["http_code"]) {
                case 200:
                case 202:
                    $response = json_decode($raw_response);
                    break;
                    /*
                case 400:
                    throw new MalformedRequestException();
                case 401:
                    throw new AuthenticationFailedException();
                case 404:
                    throw new ResourceNotFoundException();
                case 500:
                    throw new InternalServerErrorException();
                case 503:
                    throw new ServiceTemporarilyUnavailableException();
                    */
                default:
                    throw new \Exception("Error: {$info['http_code']}", $info['http_code']);
            }
        }

        return $response;
    }
protected function _call_api( $method, $url, $params ) {
        $raw_response = $this->_client->$method($url, $params);
        $info = $this->_client->get_info();
        if ($info['http_code'] != null) {
            switch ($info["http_code"]) {
                case 200:
                case 202:
                    $response = json_decode($raw_response);
                    break;
                    /*
                case 400:
                    throw new MalformedRequestException();
                case 401:
                    throw new AuthenticationFailedException();
                case 404:
                    throw new ResourceNotFoundException();
                case 500:
                    throw new InternalServerErrorException();
                case 503:
                    throw new ServiceTemporarilyUnavailableException();
                    */
                default:
                    throw new \Exception("Error: {$info['http_code']}", $info['http_code']);
            }
        }

        return $response;
    }
protected function _call_api ( $ method , $ url , $ params ) { $ raw_response = $ this -> _client -> $ method ( $ url , $ params ) ; $ info = $ this -> _client -> get_info ( ) ; if ( $ info [ 'http_code' ] != null ) { switch ( $ info [ "http_code" ] ) { case 200 : case 202 : $ response = json_decode ( $ raw_response ) ; break ; /*
                case 400:
                    throw new MalformedRequestException();
                case 401:
                    throw new AuthenticationFailedException();
                case 404:
                    throw new ResourceNotFoundException();
                case 500:
                    throw new InternalServerErrorException();
                case 503:
                    throw new ServiceTemporarilyUnavailableException();
                    */ default : throw new \ Exception ( "Error: {$info['http_code']}" , $ info [ 'http_code' ] ) ; } } return $ response ; }
Make a call to the Yesmail API

@param string $method Any of {'get', 'put', 'post', 'delete'}
@param string $url The url of the API call
@param mixed $params An object or array of parameters to submit in the request
@return mixed A JSON decoded PHP variable representing the HTTP response.
@access protected
@throws Exception
Make a call to the Yesmail API