Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/228.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 尝试刷新OAuth令牌时出现的问题_Php_Rest_Post_Infusionsoft - Fatal编程技术网

Php 尝试刷新OAuth令牌时出现的问题

Php 尝试刷新OAuth令牌时出现的问题,php,rest,post,infusionsoft,Php,Rest,Post,Infusionsoft,我正在尝试刷新我的infusionsoft令牌,使用他们文档中的以下指南: 有什么东西向你扑来吗?我也在Infusionsoft论坛上寻求帮助,但我想知道你们中是否有人曾经这样做过 grant_type和其他变量需要作为post参数发送,您当前正在将它们作为http头发送 这里也完成了:这并没有解决问题,但感谢您为我指出了正确的方向。我现在有:$jstr=array('grant\u type'=>'refresh\u token','refresh\u token'=>$refresh\u t

我正在尝试刷新我的infusionsoft令牌,使用他们文档中的以下指南:


有什么东西向你扑来吗?我也在Infusionsoft论坛上寻求帮助,但我想知道你们中是否有人曾经这样做过

grant_type和其他变量需要作为post参数发送,您当前正在将它们作为http头发送


这里也完成了:

这并没有解决问题,但感谢您为我指出了正确的方向。我现在有:$jstr=array('grant\u type'=>'refresh\u token','refresh\u token'=>$refresh\u token,)$options=array('http'=>array('header'=>Content Type:application/json\r\n.“Authorization:Basic”.base64_encode($client_id.:“$client_secret”),'method'=>POST','Content'=>json_encode($jstr));我有一种感觉,“授权:”标签不正确。那么,错误是什么?答案是否解决了您的问题?事实上,这是一个401未经授权的错误(尽管我相信客户ID和密码是正确的)
$url = "https://api.infusionsoft.com/token";
$client_id = '';
$client_secret = '';
$refresh_token = '';

$options = array(
'http' => array(
    'header'  => "Content-type: application/json\r\n".
        "Authorization: Basic ". base64_encode($client_id. ":". $client_secret),
    'grant_type' => 'refresh_token',
    'refresh_token' => $refresh_token,
    'method'  => 'POST',
  )
);