Square API 通过电子邮件搜索用户 - 旧版 Sandbox 不支持端点
Square API Search user by Email - endpoint is not supported in legacy Sandbox
回顾 this documentation 我在弄清楚如何使搜索功能正常工作时遇到了问题,我遇到了一个错误:
$json = '{}';
$url = 'https://connect.squareup.com/v2/customers/search';
$curl_handle = curl_init($url);
$request_headers = array();
$request_headers[] = 'Accept: application/json';
$request_headers[] = 'Authorization: Bearer '.$token;
$request_headers[] = 'Content-Length: '.strlen($json);
$request_headers[] = 'Content-Type: application/json';
curl_setopt($curl_handle, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($curl_handle, CURLOPT_HTTPHEADER, $request_headers);
curl_setopt($curl_handle, CURLOPT_POSTFIELDS, $json);
curl_setopt($curl_handle, CURLOPT_RETURNTRANSFER, 1);
if (substr($_SERVER['HTTP_HOST'],0,4) !== 'www.') {curl_setopt($curl_handle, CURLOPT_SSL_VERIFYPEER, false);}
$result = curl_exec($curl_handle);
$json_response = json_decode($result,1);
curl_close($curl_handle);
我得到以下信息:
[category] => INVALID_REQUEST_ERROR
[code] => SANDBOX_NOT_SUPPORTED
[detail] => This endpoint is not supported in legacy Sandbox.
Learn more about the new Sandbox at https://developer.squareup.com/docs/testing/sandbox.
我希望能够通过电子邮件地址进行搜索。我尝试在页面上使用 JSON,但仍然收到相同的错误消息。有想法吗?
很遗憾,目前无法通过电子邮件地址查询客户搜索结果。
回顾 this documentation 我在弄清楚如何使搜索功能正常工作时遇到了问题,我遇到了一个错误:
$json = '{}';
$url = 'https://connect.squareup.com/v2/customers/search';
$curl_handle = curl_init($url);
$request_headers = array();
$request_headers[] = 'Accept: application/json';
$request_headers[] = 'Authorization: Bearer '.$token;
$request_headers[] = 'Content-Length: '.strlen($json);
$request_headers[] = 'Content-Type: application/json';
curl_setopt($curl_handle, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($curl_handle, CURLOPT_HTTPHEADER, $request_headers);
curl_setopt($curl_handle, CURLOPT_POSTFIELDS, $json);
curl_setopt($curl_handle, CURLOPT_RETURNTRANSFER, 1);
if (substr($_SERVER['HTTP_HOST'],0,4) !== 'www.') {curl_setopt($curl_handle, CURLOPT_SSL_VERIFYPEER, false);}
$result = curl_exec($curl_handle);
$json_response = json_decode($result,1);
curl_close($curl_handle);
我得到以下信息:
[category] => INVALID_REQUEST_ERROR
[code] => SANDBOX_NOT_SUPPORTED
[detail] => This endpoint is not supported in legacy Sandbox.
Learn more about the new Sandbox at https://developer.squareup.com/docs/testing/sandbox.
我希望能够通过电子邮件地址进行搜索。我尝试在页面上使用 JSON,但仍然收到相同的错误消息。有想法吗?
很遗憾,目前无法通过电子邮件地址查询客户搜索结果。