SuiteCRM API V8没有给出任何回应



我想将套件升级到最新一代的suitecrm版本。由于我将REST API4.1用于现有的SuiteCRM,并且知道我必须使用API V8用于最新一代的SuiteCRM版本,因此我安装了SuiteCRM 7.11.3,并在我们的https上使用PHP版本7.1 7.1的演示服务器上使用虚拟数据7.1。.17。

之后,我通过在" admin"中导航 - " client_id"one_answers" client_secret",用于" client corterentials"授予类型 - " oauth2 client and tokens and tokens" - "新的客户端凭据clients client"。

现在,我正在检查CRM API是否使用客户端凭据进行身份验证,并尝试使用以下代码获得会话,但既不获取任何数组或会话或任何错误。

$ch = curl_init();
$header = array(
    'Content-type: application/vnd.api+json',
    'Accept: application/vnd.api+json',
);
$postStr = json_encode(array(
    'grant_type' => 'client_credentials',
    'client_id' => 'xxxxxxxxxx',
    'client_secret' => 'xxxxxxxxxx'
));
$url = 'https://url/Api/access_token';
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($ch, CURLOPT_POSTFIELDS, $postStr);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
$output = curl_exec($ch);

$tab = json_decode($output);
print_r($tab);
curl_close($ch);

我已经在$ poststr中添加"范围'=>''",如一篇文章所建议,但没有返回任何内容。

任何人都可以指导这个吗?

确保您先生成私钥和公共钥匙,否则它无法使用。https://docs.suitecrm.com/developer/api/version-8/json-api/#_before_you_start_calling_endpoints

您的帖子变量也应该在体内。

最新更新