-
Notifications
You must be signed in to change notification settings - Fork 11
Description
require_once getcwd() .'/sites/all/vendor/piplcom/piplapis-php/src/piplapis/search.php';
$params = array(
'api_key' => 'redacted',
'first_name' => 'Test',
'middle_name' => '',
'last_name' => 'Test',
'city' => 'Beverly Hills',
'country' => 'US',
'state' => 'CA',
'phone' => '8885550123',
'email' => 'test@example.com',
);
$request = new PiplApi_SearchAPIRequest($params);
$request->send(FALSE);
results in the following exception:
PiplApi_SearchAPIError: The query does not contain any valid name/username/phone/email to search by in PiplApi_APIError::from_dict() (line 35 of vendor/piplcom/piplapis-php/src/piplapis/error.php).
I was able to fix the issue. See diff below:
diff --git a/src/piplapis/search.php b/src/piplapis/search.php
index c3266a9..c72c480 100644
--- a/src/piplapis/search.php
+++ b/src/piplapis/search.php
@@ -455,7 +455,7 @@ class PiplApi_SearchAPIRequest
'filter_records_by' => $this->_filter_records_by
);
-
return self::$BASE_URL . http_build_query($query); -
return self::$BASE_URL . http_build_query($query, '', '&');}
public function send($strict_validation=true)
@@ -730,4 +730,4 @@ class PiplApi_SearchAPIError extends PiplApi_APIError
// error.
}
Apparently, my server was using '&' as the default http_build_query separator and this was causing problems with the API.