通过电子邮件的方形API搜索用户-旧版沙箱中不支持端点

问题描述 投票:0回答:1

遍历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,但仍然收到相同的错误消息。有想法吗?

php square-connect square
1个回答
0
投票

[遗憾的是,目前无法通过电子邮件地址查询客户搜索。

© www.soinside.com 2019 - 2024. All rights reserved.